Publications by Will

Formulae in R: ANOVA and other models, mixed and fixed

10.01.2013

R’s formula interface is sweet but sometimes confusing. ANOVA is seldom sweet and almost always confusing. And random (a.k.a. mixed) versus fixed effects decisions seem to hurt peoples’ heads too. So, let’s dive into the intersection of these three. I’m aware that there are lots of packages for running ANOVA models that make things nicer...

6665 sym R (992 sym/24 pcs)

No more ascii-art

24.01.2013

At least fourfive R packages will turn your regression models into pretty latex tables: texreg, xtable, apsrtable, memisc, and stargazer.  This is very nice if you happen to be a latex document or its final reader, but it’s not so great if you’re making those models to start with. What if you wanted to see these as you were working on them? ...

2819 sym R (1361 sym/4 pcs) 2 img

Show me the pdf already

01.02.2013

You’ve got a pdf file and you’d like to view it with whatever the system viewer is. As usual, that requires something special for Windows and something general for the rest of us. Here goes… openPDF <- function(f) { os <- .Platform$OS.type if (os=="windows") shell.exec(normalizePath(f)) else { pdf <- getOption("pdfview...

2163 sym R (416 sym/4 pcs)

Quantifying the international search for meaning

09.02.2013

Inspired by Preis et al.’s article Quantifying the advantage of looking forward, recently published in Scientific Reports (one of Nature publishing group’s journals), I wondered if similar big-data web-based research methods might address a question even bigger than how much different countries wonder about next year. How about the meaning of...

2994 sym R (1554 sym/1 pcs) 2 img

Tools for making a paper

01.03.2013

Since it seems to be the fashion, here’s a post about how I make my academic papers. Actually, who am I trying to kid? This is also about how I make slides, letters, memos and “Back in 10 minutes” signs to pin on the door. Nevertheless it’s for making academic papers that I’m going to recommend this particular set of tools. I use the...

8457 sym R (2251 sym/10 pcs)

R to Latex packages: Coverage

12.03.2013

There are now quite a few R packages to turn cross-tables and fitted models into nicely formatted latex. In a previous post I showed how to use one of them to display regression tables on the fly. In this post I summarise what types of R object each of the major packages can deal with. Unsurprisingly, there’s quite some variation… The packag...

2209 sym 1 tbl

Which political science journals will have a data policy?

18.03.2013

Making available replication materials for the research you do is A Good Thing. It’s also work, and it’s quite easy to never get around to. Certainly I claim no special virtue in this department so I am always happy when there’s an institutional stick to prod my better nature in the right direction. One such institutional prod comes from a...

5297 sym R (1220 sym/7 pcs) 2 img

Call them what you will

28.10.2013

I’ve been playing around with the R package texreg for creating combined regression tables for multiple models. It’s not the only package to do that – see here for a review – but it’s often handy to be able to generate both ascii art, latex, and html versions of the same table using almost identical syntax. Also, the ascii art creati...

8213 sym R (7917 sym/12 pcs)

A Mitochondrial Manhattan Plot

06.11.2013

Manhattan plots have become the standard way to visualize results for genetic association studies, allowing the viewer to instantly see significant results in the rough context of their genomic position.  Manhattan plots are typically shown on a linear X-axis (although the circos package can be used for radial plots), and this is consistent with...

1797 sym 2 img

More SOTU Scaling

30.01.2014

A couple of days ago the Monkey Cage featured Ben Lauderdale’s one-dimensional scaling model of US State of the Union addresses. In this post, I replicate the analysis with a closely related model, ask what the scaled dimension actually means, and consider what things would look like if we added another one. The technical details are all at the...

4280 sym R (600 sym/3 pcs) 6 img