For an example data set, see the data in /export/x/JoeData/Harv. Consider copying this entire directory into your own directory so that you can try out the commands below.
You need the six motion parameter files, so that you can include motion parameters as covariates (regressors) of no interest in the analysis. These are the files named motion?.1D You also need two text files encoding regressors of interest. In this example, the regressors of interest are
(RealWord and Pseudoword) vs. Fix
and
RealWord vs. Pseudoword
Note that these last two regressors are inherently orthogonal to one another. I.e., they're 90 degrees or perpendicular to one another.
This is a total of eight regressors -- six motion parameters plus the two regressors of interest.
I then orthogonalized the eight regressors. This removes variance that could be explained by any of the six motion parameters from the two regressors of interest, reducing false positives due to task-correlated motion.
orthogonalizeTextFileRegressors.csh Orthog motion?.1D RealAndPseudowordsVsFix.txt RealWordsVsPseudoWords.txt
I then checked the resulting eight regressors for linear dependence (they were not linearly dependent), and also checked something called the "reciprocal condition number" (RCN) to make sure that the design matrix composed of these eight regressors was "well-behaved."
checkLinearDependence.csh motion?.Orthog.1D RealAndPseudowordsVsFix.Orthog.txt RealWordsVsPseudoWords.Orthog.txt
Since the RCN was okay, I proceeded to make a design matrix from the eight orthogonalized regressors, and
ran multiple regression in MEDx using that design matrix.
CreateMEDxDesignMatrix.tcl DesignMatrix.vst 1 . motion1.Orthog.1D motion2.Orthog.1D \
motion3.Orthog.1D motion4.Orthog.1D motion5.Orthog.1D motion6.Orthog.1D \
RealAndPseudowordsVsFix.Orthog.txt RealWordsVsPseudoWords.Orthog.txt