Dear Noelia,
there was a thread about a similar topic recently:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=spm;b2cb050d.1505
See code in the spm_spm.m function and the mentioned articles in the
link above for the exact computation details.
For first level fMRI, you have to take into account the DCT basis set of
the high pass filter, eg for a single session model, try something like
this:
load SPM.mat
X = [SPM.xX.X SPM.xX.K.X0];
size(X,1)-rank(X)
Best regards,
Guillaume.
On 27/05/15 13:54, Noelia Martinez Molina wrote:
> Dear SPM experts,
>
> I'm writing to you to request some information about how the degrees of freedom in the first level are computed in SPM. I read elsewhere that they can be calculated as the number of observations minus the number of conditions. However, when I do that I don't get the number of degrees of freedom that SPM gives me in the first level.
>
> We are several PhD students in the lab cracking our brains to find an answer but so far we cannot figure out how the actual calculation is made in SPM.
>
> Could you possible give us a hand, please?
>
> Thank you in advance for your assistance,
> Noelia
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|