Super Useful Sampling Distributions Applet


Similar to the applets I used for my P211 research methods class, there is an online program which allows the user to specify a population distribution, and then build a sampling distribution of statistics such as mean, median, and variance. When I was first starting out I had a difficult time grasping what exactly a sampling distribution was, or what it meant, exactly; but tools like this are great for visualizing the process and building an intuition about what's really going on. The result is, I still don't understand it - like, at all - but I sure as hell feel more confident. And that's what is really important.


Contrasts in SPM (with Outtakes!)

We have come to the end of the preprocessing pipeline, and lurch across the finish line with a discussion of contrasts. Often researchers will calculate the difference in beta estimates between two conditions (in SPM, the beta_000?.img files), and also determine whether the difference is significant or not. At the single-subject level both the magnitude of the beta estimate and the variance of the estimate is calculated for each condition, and then t-tests can be performed on these beta estimates by weighting them. For example, the contrast of [1 -1] for Left vs. Right button presses will subtract the beta estimates for the Right button presses from the Left button presses, similar to a paired t-test. A t-statistic is then calculated at each voxel using the following formula:


Where gamma represents the contrast vector (in this example, [1 -1]) and B-hat represents the beta estimates for each condition. The degrees of freedom for a single-subject analysis is based on the number of time points; although, since nearby timepoints share a high degree of correlation, the actual degrees of freedom is pared down to compensate. With most standard processing streams, the variance associated with a beta estimate is discarded when carried to a higher-level analysis, although programs such as FSL's FLAME and AFNI's 3dMEMA take this variance into account when weighting group-level estimates.

Details about how to perform a simple t-contrast in SPM are shown in the following video. The first twenty seconds or so is an outtake where my microphone fell over; we sure like to have fun around here!



Stats Videos (Why do you divide samples by n-1?)

Because FMRI analysis requires a strong statistical background, I've added a couple videos going over the basics of statistical inference, and I use both R and Excel to show the output of certain procedures. In this demo, I go over why the sums of squares of sample populations are divided by n-1; a concept not covered in many statistical textbooks, but an important topic for understanding both statistical inference and where degrees of freedom come from. This isn't a rigorous proof, just a demonstration of why dividing by n-1 is a unbiased estimation of sample variance.