Hi Kevin,
you can, of course, specify nuisance variables via the GUI. They just
don't end
up in the iG partition of the design matrix. The latter, as Volkmar pointed
out, cannot and should not be done via the GUI (as there is no way for SPM of
knowing if this is nuisance variable or a covariate of no interest.
You can, however, you the little script that I attached to this email to
reassign the columns in the design matrix *after* design specification and
*before* estimation (both can be done by setting up a jobs struct for
spm_jobman). Have a look at the help text in the function -- it's rather
lengthy compared to the few lines of actual code. When you use it, check your
xX.i{C,H,G,B} against xX.name afterwards to see if everything is setup as
intended. Don't forget to save your modified SPM struct afterwards.
I reassign the nuisance variables (mostly realignment parameters) to IG
routinely justto be on the safe side, but in practice it does not make much of
a difference. This reassignment of columns is only important for the initial
F-Test for determining the voxels of interest. So if you don't do it, you are
most likely to be OK, too.
Hope this helps,
Jan
Quoting Kevin Hill <[log in to unmask]>:
> Thanks for the reply,
>
> Doesn't that mean that anyone using the GUI w/ SPM5 has no way of
> specifying nuisance variables?
>
> -Kevin Hill
>
> Volkmar Glauche wrote:
>> Dear Kevin,
>>
>> this is the intended behaviour for regressors, because they can't be
>> assumed to be nuisance in general. The only bug is that the job
>> configuration does not allow to set nuisance covariates at all.
>>
>> Volkmar
>>
>> Am Mittwoch, den 27.02.2008, 14:56 -0800 schrieb Kevin Hill:
>>
>>> Hello, we seem to be experiencing a minor problem with spm_jobman
>>> with all versions of spm5.
>>>
>>> the 'jobs' struct has two fields:
>>> jobs{1}.stats{1}.fmri_spec.sess.multi and
>>> jobs{1}.stats{1}.fmri_spec.sess.multi_reg which I believe are
>>> supposed to hold location of files which contain the covariates of
>>> interest and nuisance regressors respectively. However the
>>> resulting SPM structure has all of the regressors specified by the
>>> files indicated in both fields as covariates of interest in
>>> SPM.xX.iC, and no regressors are listed in SPM.xX.iG, as I think
>>> they should be. So I have two questions:
>>>
>>> 1) Am I specifying the nuisance regressors incorrectly? If so, what
>>> is the proper way to specify them?
>>>
>>> 2) My understanding is that the non-sphericity of the noise is
>>> computed only in the voxels which pass a F-test for the covariates
>>> of interest, so would this bug/error result in a small
>>> mischaracterization of the noise?
>>>
>>> -Kevin Hill
>>>
>>>
>
function SPM = nuis2iG(SPM,str)
%
% this function will move the movement regressors to the
% nuisance partition prior to the estimation of the
% design.
%
% ARGS:
% SPM -- SPM structure
% str -- cell array of strings containing unique parts of the
% names of the movement parameters or regressors to be
% moved to iG (defaults to {'bs','R','nuis','miss'})
%
% The names of regressors can be found in SPM.xX.name. They
% always start with 'SN(x) ' indicating the session of the
% regressors. Then follows the given name, followed by '*bf(x)'
% indicating that it has be convolved with the x column of the
% basis set.
%
% The argument "str" should be the first letters of the given
% name without the session specifier. For example, you have named
% your movement parameters rp1, rp2 etc. Then the SPM name of
% these regressors are: 'Sn(1) rp1', Sn(1) rp2', etc. The "str"
% argument to this function should then be 'rp'. By default, when
% using the "Multiple Regressor" option and specifying the text
% file with the motion parameters, the motion regressors are
% called R1 - R6; hence the default is "R" (but you shouldn't
% have another regressors starting with "R"). You can also
% specify addition nuisance variable through the "Covariates'
% interface of the job manager (giving them different names).
% Speciying their prefix in the "str" cell array will also move
% them to the iG partition of the design matrix.
%
% Explanation:
% SPM partitions the design matrix into 4 different partitions:
% 1. effects if interest (iC)
% 2. effects of no interest (iH)
% 3. nuisance regressors (iG)
% 4. block effects (session constants) (iB)
%
% These different partitions are field in the struct SPM.xX. They
% are vectors of columns number indicating which regressors are
% in different partitions.
%
% Upon estimation SPM internally runs and effects of interest
% F-Test to determine which are are the interesting voxels on
% which the statistics should be run. Only voxel surviving this
% initial F-Test are subsequently considered for further
% statistical analysis. The threshold for this initial F-Test can
% be set in spm_defaults.m: defaults.stats.fmri.ufp (defaults to
% 0.001)
%
% This initial F-Contrast is an identity matrix spanning the
% columns of the effects of interest and no interest (iC and iH),
% ignoring the nuisance and block regressors (iG and iB).
%
% The inclusion of the movement parameters in the iG partition is
% not done automatically, because SPM doesn't know which
% additional regressors are of interest or simply nuisance. Thus,
% this has to be done manually by the user (there is no way to do
% this in the GUI).
%
% This can turn out to be important, if for some reason, voxels
% that show strong momvement-related activation survive the
% initial F-Test and are therefore included in the statistical
% analysis.
% ----------------------------------------------------------------
% Jan Glaescher Oct-17-2007
if nargin < 2; str = {'bs','R','nuis','miss'}; end
if nargin < 1
error('Must supply an SPM struct.')
end
iG = [];
name = SPM.xX.name;
for n = 1:length(name)
name{n} = name{n}(7:end);
end
for s = 1:length(str)
iG = [iG strmatch(str{s},name)'];
end
SPM.xX.iG = sort(iG);
for g = 1:length(iG)
SPM.xX.iC(SPM.xX.iC==iG(g)) = [];
end
return;
|