A Tutorial on Modeling fMRI Data using a General Linear Model
Functional magnetic resonance imaging (fMRI) has quickly become the most commonly used method among scientists in many disciplines for examining brain function. However, there are challenges in translating the underlying statistics from specialized fMRI analysis tools to a more general statistical language such as R. This paper translates key terminology and is a self contained tutorial of how to model a single voxel of fMRI data using the nlme mixed effects framework in R. This translation is not only interesting pedagogically, but many advanced statistical modeling techniques of interest in psychology, for example, growth models that are implemented using structural equation modeling, are unavailable for fMRI. This need for more modeling flexibility to advance the study of developmental cognitive neuroscience, and similarly the trajectories of aging and neurodegenerative change, also motivates this tutorial as a first step to understanding how to script more complicated analyses. Finally, this tutorial is written using Rmarkdown (see Supplemental Materials) so that it is itself an example for writing reproducible analysis.