May 2013 M T W T F S S « Dec 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Categories
-
Recent Posts
Meta
Social science
Statistics
Author Archives: Jason
Pearson’s r: Not a good measure of electoral persistence
Pearson’s product-moment correlation, \(r\), is an incredibly useful tool for getting some idea about how two variables are (linearly) related. But there are times when using Pearson’s \(r\) is not appropriate and, even if linearity and all other assumptions hold, … Continue reading
Posted in Data analysis, Graphics, Poland, Political parties, R
1 Comment
R Tip: Avoid using T and F as synonyms for TRUE and FALSE
By default when you start R, T and F are defined as TRUE and FALSE. When I review other people’s code, I often see functions defined with arguments set to these values by default. This is a very bad idea. … Continue reading
Closures in R: A useful abstraction
People who have been using R for any length of time have probably become accustomed to passing functions as arguments to other functions. From my experience, however, people are much less likely to return functions from their own custom code. … Continue reading
Filtering a list with the Filter higher-order function
Last week markbulling over at Drunks & Lampposts posted a method of using sapply to filter a list by a predicate. Today the @RLangTip tip of the day was to use sapply similarly. This made makes me wonder if R‘s … Continue reading
Posted in R
Leave a comment
Announcing boolean3 (beta)
After entirely too long, I am happy to announce the beta release of boolean3, an R package for modeling causal complexity. The package can be downloaded at the following links: Unix/Linux: boolean3_3.0.20.tar.gz Windows: boolean3_3.0.20.zip (Please let me know if you have any … Continue reading
Welford’s method for calculating the sample variance: An implementation in Scheme
John Cook has three entries up on his blog discussing the pitfalls of calculating the sample variance using the mathematical textbook definitions. He provides a Monte Carlo comparison of methods here, and a theoretical discussion here. He also provides a … Continue reading
Posted in Code, Data analysis, Scheme
Leave a comment
Three free books for better programming in R (and any other language)
Like many users and producers of R packages, I have never had any formal training in computer science. I’ve come to to the conclusion that this is a serious omission in a professional researcher’s training. Computer scientists and professional hackers … Continue reading
Posted in Hacking, R
4 Comments
The performance cost of a for-loop, and some alternatives
I’ve recently been spending a lot of time running various simulations in R. Because I often use snow to perform simulations across several computers/cores, results typically come back in the form of a list object. Summarizing the results from a list … Continue reading
Posted in R
10 Comments
Emacs-fu: The place to go for useful Emacs tips
After 5 years or so of using Emacs almost exclusively as my “text editor”, somehow I just ran across Emacs-fu for the first time today. It’s an incredibly useful site with numerous Emacs tips and tricks. If you are an Emacs user, you should check the … Continue reading
Posted in Emacs, Hacking
Leave a comment
Stronger instruments by design: Polmeth 2011 poster
I just got back from Polmeth 2011 at Princeton, where I presented a poster for a project Luke Keele and I are working on. It deals with the problem of statistical inference in the presence of a weak instrument and the … Continue reading