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
Category Archives: R
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
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
Code: mtable-ext updated
I have fixed a small bug in mtable-ext that prevented asterisks from being printed for negative coefficients in mixed effects models output by lme4. Thanks to Reinhold Kliegl and Martin Elff for pointing out the bug and for providing the … Continue reading
A simple frequency plot
I’m currently working on a paper that uses Polish survey data (EVS 2008). I am specifically looking at regional variation in particular responses. Because there are only around 1800 observations in the survey, which are split across 66 subregions of … Continue reading
Posted in Data analysis, Graphics, R
1 Comment
A very short and unoriginal introduction to snow
As Jian-Feng rightly pointed out in a comment on my guide to setting up snow on the OSC cluster, it was probably somewhat cavalier of me to say: Getting snow to run properly on single machines, or ever with a cluster of … Continue reading
Posted in R
4 Comments