Publications by John Myles White
Academics’ Slang: Orthogonal
H. G. Wells famously said that, “statistical thinking will one day be as necessary for efficient citizenship as the ability to read and write.” I think we’re getting closer to that day: even the Supreme Court of the United States plans to start using the word ‘orthogonal’ colloquially. Related To leave a comment for the author, please...
715 sym
Gay Marriage: Another Data Point
Relevant to my earlier post about the relationship between direct democracy and laws prohibiting gay marriage, Pew Research just published poll data showing that a majority of Americans disapprove of same-sex marriage. Related To leave a comment for the author, please follow the link and comment on their blog: John Myles White: Die Sudelbüche...
647 sym
The Price of Calculation
In a world in which the price of calculation continues to decrease rapidly, but the price of theorem proving continues to hold steady or increase, elementary economics indicates that we ought to spend a larger and larger fraction of our time on calculation.1 Over the next ten years, I hope that more and more mathematically minded hackers, empowe...
1011 sym
Doing Maximum Likelihood Estimation by Hand in R
Lately I’ve been writing maximum likelihood estimation code by hand for some economic models that I’m working with. It’s actually a fairly simple task, so I thought that I would write up the basic approach in case there are readers who haven’t built a generic estimation system before. First, let’s start with a toy example for which ther...
4941 sym R (4301 sym/20 pcs) 8 img 10 tbl
Unit Testing in R: The Bare Minimum
Introduction This week I decided to start unit testing my R code, so I taught myself the bare minimum about the RUnit and testthat packages to be able to use them. Here’s what I found necessary to get started writing tests with both packages. RUnit Basic Example I’m going to assume that you’ve got a bunch of functions in sample.R that you w...
4341 sym R (1233 sym/10 pcs) 5 tbl
Twifficiency Scores
Neil Kodner wrote a great post this morning about yesterday’s Twifficiency scores outbreak. He grabbed all the auto-tweeted scores he could find and plotted their distribution. I was struck by the asymmetry of the resulting distribution, which you can see below: Thankfully, Neil handed me the raw data for his plot, so I was able to run a K-S t...
1331 sym R (418 sym/2 pcs) 2 img 1 tbl
Using JAGS in R with the rjags Package
Get Everything Set Up I’m going to assume that you have access to a machine that will run JAGS. If you don’t, then you should be able to use WinBUGS, which is very easy to get set up. Unfortunately, the details of what follows may not help you as much if you’re using WinBUGS. To set up your system for using JAGS, there are two very easy ste...
8685 sym R (2410 sym/20 pcs) 10 tbl
ProjectTemplate
Introduction As many people already know, I’ve recently uploaded a new R package called ProjectTemplate to GitHub and CRAN. The ProjectTemplate package provides a function, create.project(), that automatically builds a directory for a new R project with a clean sub-directory structure and automatic data and library loading tools. My hope is tha...
5701 sym R (203 sym/10 pcs) 5 tbl
Blegging for Data
I’m in the middle of a new project that involves analyzing the packages that are currently on CRAN. As part of my work, I could really benefit from information about which packages are installed on people’s computers. If you’re willing to part with a bit of your time and privacy, I’d very much appreciate you running the following script i...
845 sym R (152 sym/2 pcs) 1 tbl
MCMC Diagnostics in R with the coda Package
This is a follow up to my recent post introducing the use of JAGS in R through the rjags package. In the comments on that post, Bernd Weiss encouraged me to write a short addendum that describes diagnostic functions that you should use to assess the output from an MCMC sampler. I’ve only been using these diagnostics for a week now for an academ...
4960 sym R (3014 sym/18 pcs) 12 img 9 tbl