Publications by Dan Mirman
Crawford-Howell (1998) t-test for case-control comparisons
Cognitive neuropsychologists (like me) often need to compare a single case to a small control group, but the standard two-sample t-test does not work for this because the case is only one observation. Several different approaches have been proposed and in a new paper just published in Cortex, Crawford and Garthwaite (2012) demonstrate that the Cr...
2376 sym R (302 sym/1 pcs) 2 img
Customizing ggplot graphs
There are many things I love about the R package ggplot2. For the most part, they fall into two categories:The “grammar of graphics” approach builds a hierarchical relationship between the data and the graphic, which creates a consistent, intuitive (once you learn it), and easy-to-manipulate system for statistical visualization. Briefly, th...
2116 sym
Plotting model fits
We all know that it is important to plot your data and explore the data visually to make sure you understand it. The same is true for your model fits. First, you want to make sure that the model is fitting the data relatively well, without any substantial systematic deviations. This is often evaluated by plotting residual errors, but I ...
3470 sym R (3719 sym/5 pcs) 8 img
More on fixed and random effects: Plotting and interpreting
In a recent post I showed how plotting model fits can help to interpret higher-order polynomial terms. The key comparison there was between a model that did and did not have the higher order fixed effect terms. If you're going to use this strategy, you need to remember that fixed and random effects capture some of the same variance, so if you're...
3384 sym R (1927 sym/3 pcs) 4 img
Two ways that correlation and stepwise regression can give different results
[Expanding on my recent answer on Cross Validated, aka stats.stackexchange.com]In general, a correlation test is used to test the association between two variables (y and z). However, if there is a third variable (x) that might be related to z or y, it makes sense to use stepwise regression (or partial correlation). There are two quite differen...
2318 sym R (1477 sym/2 pcs)
Using R to create visual illusions
This brings together two of my favorite (professional) things: R and visual illusions. Aside from being an extremely impressive application of R, it’s a cool way of making it clear that the illusion is, in fact, an illusion. Here’s a simple example:library(grid)grid.newpage()grid.rect(c(1,3,1,3)/4, c(3,3,1,1)/4, 1/2, 1/2, gp =...
1266 sym 2 img
Using R to get h5-index for a list of journals
In my last blog post I wrote about impact factors and h-index for different journals. That got me wondering about what the h5 index is for all of the journals that I read and may want to publish in. I could look them all up individually, but that sounds boring and monotonous. I’d much rather figure out how to get R to do it for me. I’ve never...
855 sym R (1060 sym/2 pcs) 1 tbl
R 3.0 released; ggplot2 stat_summary bug fixed!
The new version of R was released yesterday. As I understand it, the numbering change to 3.0 represents the recognition that R had evolved enough to justify a new number rather than the addition of many new features. There are some important new features, but I am not sure they will affect me very much. For me, the much bigger change occurred in...
1441 sym
Multiple pairwise comparisons for categorical predictors
Dale Barr (@datacmdr) recently had a nice blog post about coding categorical predictors, which reminded me to share my thoughts about multiple pairwise comparisons for categorical predictors in growth curve analysis. As Dale pointed out in his post, the R default is to treat the reference level of a factor as a baseline and to estimate parameter...
3655 sym R (3785 sym/6 pcs) 2 img
A function for comparing groups on a set of variables
I’m often in the position of needing to compare groups of either items or participants on some set of variables. For example, I might want to compare recognition of words that differ on some measure of lexical neighborhood density but are matched on word length, frequency, etc. Similarly, I might want to compare individuals with aphasia that ha...
2528 sym R (1713 sym/1 pcs)