Dear Rik, Donald and Alexa,
Thank you very much for informative suggestions and such an in-depth discussion.
First, the code about spm_FcUtil can't work. It works for other conditions(eg, if building a model without subject effects). After testing, what I find is, the code works if we can make a contrast through
GUI, but fails if we can't through GUI.
Infomation that Matlab shows:
Warning:
c is not a proper contrast in +c->Tsp in spm_SpUtil
!!! projecting...
> In spm_SpUtil at 327
In spm_FcUtil at 219
from
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.9583
-0.0417
-0.0417
-0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
0.0417
??? Subscripted assignment between dissimilar structures.
and finally no new contrast is written in.
Though it can not work, it looks like this projecting process transfroms the original contrast to a new one in which the value of the 1st comlumn near 1, the other 23 column have the same small net value but the 2nd-4th are negative while
the left 20 positive. It will work, I think, If the sum of these reprojected values equals zero ( the sum of above values is 1.5004 so that may be why it fails). Nevertheless, such method is an approximation instead of a real [1 0 0 0], if succeed.
Second, the contrast [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]/20 can't work, too.
I am thinking what Donald said and materials Rik and Alexa provide, it takes time.
发件人: MCLAREN, Donald <[log in to unmask]>
主题: Re: [SPM] a simple question about one-way within-subjects ANOVA
收件人: [log in to unmask]
日期: 2011年4月7日,周四,上午2:03
My statement about the error term being wrong only applies to within-subject designs or mixed-designs. If you look at any other statistica program (SAS, SPSS, STATA, etc.) anytime that they compute the effect of an individual condition,
they use a different error term. The reason for this is that comparing a condition against 0 is a test of a between-subject effect, while comparing condition 1 versus condition 2 is a test of a within-subject effect. The test of each effect has its own error
term. However, in SPM (FSL, FAST, etc.) only 1 error term is generated. For within-subject or mixed-designs, the error term in SPM, etc. is the within-subject error term. One cannot partition this error term to derive the between-subject error term because
the between-subject error term is based on the between subject variance not the within-subject variance.
Here is a good example, of heights of people:
condition 1: height [ 61 62 59 63]
condition 2: height + 2 inch board [63 64 61 65]
condition 1 versus 60 is not significant (p=.25)
condition 2 versus 60 is significant (p=.024)
Now, if we build a big model and ask if condition 1 is different than 0, we get p=0, t-stastic=Inf. In other words, by measuring people's height with a board, their height without the board becomes significantly taller than 60 inches. To me, this demonstrates
that SPM's error term is wrong in make conclusions about individual conditions within a repeated measures design.
If one were to change condition 2: height +2 inch board to [63 64 61 64] (I guess the board shrunk before being used on the last person.
condition 1 versus 60 is not significant (p=.25)
condition 2 versus 60 is significant (p=.022)
Condition 1, using a paired test (e.g. a one-way ANOVA with 2 condition), is now still significant with a p-value of 0.005986. Thus, we would [incorrectly] conclude that these people are significant taller than 60 inches. This is a result
of making a second measurement that doesn't change the first measurement. Also, we want to make a inference about the between-subject effect, which should not be influenced by other measurements of the same subjects as it is asking about the population behavior.
In conclusion, asking about the effect of 1 condition within SPM is invalid because it doesn't represent the between-subject effect because it is not using the between subject error term as that error term is not currently provided by SPM.
Hopefully this clears up my original statement on the validity of asking the significance of a single condition or group of condition in a within-subject or mixed-design model.
Please feel free to ask any question or suggest comments on the approach or statistics.
Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Postdoctoral Research Fellow, GRECC, Bedford VA
Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended
recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action
in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Wed, Apr 6, 2011 at 9:46 AM, Alexa Morcom <[log in to unmask]" rel="nofollow" target="_blank">[log in to unmask]> wrote:
Donald, Rik, Pengxu
I agree about the contrast, and you can work out how to do others using the general system described in the excellent Gitelman/ Glascher tutorial for Flexible Factorial contrasts (I don't have a direct link, but google it).
I don't think the error term is wrong, though. All weighting the subject effect columns does here is to weight the 'contribution' of the effect you are interested in proportionately, and appropriately, for all columns to which it contributes. It would be incorrect
for these subject effects to go into the error term, even if it were possible to code it that way. I believe that doing this will have just the same effect as what Rik suggests, which might be useful if you don't want to use the GUI.
cheers
Alexa
On 6 April 2011 14:12, MCLAREN, Donald <[log in to unmask]" rel="nofollow" target="_blank">[log in to unmask]> wrote:
Rik and Pengxu,
They don't have to equal 0, for example if you had 4 condition and 20
subjects, (conditions then subject factors in the design matrix), then
the contrast for condition 1 would be:
While this contrast works, it is not valid for statistical inference
because you end up using the wrong error term because the error term
is for the within-subject errors. However, it is useful for getting
the mean response to condition1 across subjects if you just want to
plot the results.
Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Postdoctoral Research Fellow, GRECC, Bedford VA
Research Fellow, Department of Neurology, Massachusetts General
Hospital and Harvard Medical School
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain
PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED
and which is intended only for the use of the individual or entity
named above. If the reader of the e-mail is not the intended recipient
or the employee or agent responsible for delivering it to the intended
recipient, you are hereby notified that you are in possession of
confidential and privileged information. Any unauthorized use,
disclosure, copying or the taking of any action in reliance on the
contents of this information is strictly prohibited and may be
unlawful. If you have received this e-mail unintentionally, please
immediately notify the sender via telephone at (773) 406-2464 or
email.
On Wed, Apr 6, 2011 at 8:43 AM, Rik Henson <[log in to unmask]" rel="nofollow" target="_blank">[log in to unmask]> wrote:
>
>
> You can’t do this via SPM’s GUI, because it forces contrast weights to sum
> to zero for rank deficient design matrices (inestimable contrasts with
> respect to columns of interest).
>
>
>
> You can however estimate the equivalent contrast via calling SPM’s
> spm_FcUtil function directly, which will re-parametrise your contrast to
> make it estimable with respect to all columns in the design matrix, eg:
>
>
>
> SPM.xCon(end+1) = spm_FcUtil('Set',’Any_name’,'T','c',c',SPM.xX.xKXs);
>
> spm_contrasts(SPM);
>
>
>
> where c is your original contrast vector (eg [1 0 0 0]), which will be
> reprojected to include contributions from the subject effects. For further
> information, try Christophe Pallier’s document here:
>
>
>
>
http://www.pallier.org//ressources/glm_anova/glm_anova2.pdf
>
>
>
> BW,R
>
>
>
> -------------------------------------------------------
>
> Dr Richard Henson
>
> Assistant Director, Neuroimaging
>
> MRC Cognition & Brain Sciences Unit
>
> 15 Chaucer Road
>
> Cambridge, CB2 7EF, UK
>
>
>
> Office: +44 (0)1223 355 294 x522
>
> Mob: +44 (0)794 1377 345
>
> Fax: +44 (0)1223 359 062
>
>
>
>
http://www.mrc-cbu.cam.ac.uk/people/rik.henson/personal
>
> -------------------------------------------------------
>
>
>
> From: Pengxu Wei [mailto:[log in to unmask]" rel="nofollow" target="_blank">[log in to unmask]]
> Sent: 06 April 2011 11:52
> To: Rik Henson
> Subject: a simple question about one-way within-subjects ANOVA
>
>
>
> Dear Dr. Rik Henson,
>
>
>
> I am reading your paper "ANOVAs and SPM". One of my data is just the same of
> Figure 5: Design matrix for one-way (1x4) within-subjects ANOVA. The first 4
> columns are treatment effects and the last 12 are subject effects, except 20
> instead of 12 subjects in my study.
>
>
>
> In SPM5 I get this design matrix through 'Flexible factorial'
> specification. I want to check activation of each of the 4 conditions
> through this model, and then use inclusive masking or conjunction to explore
> the activation areas in common between each pair of the 4 treatment effects.
> But I failed when using the contrast like [1 0 0 0]. Only contrast with a
> zero sum(eg.1 -1 0 0) can be used. Would you like to show me a clue?
>
>
>
>
>
> Best regards,
>
>
>
> Pengxu Wei
> Director, Chinese Medicine and Rehabilitation Dept.
> National Rehabilitation Hospital,
> National Research Center for Rehabilitation Technical Aids, China
--
Dr. Alexa Morcom
RCUK Academic Fellow
Centre for Cognitive & Neural Systems/ Centre for Cognitive Ageing & Cognitive Epidemiology
Psychology, University of Edinburgh
http://www.ccns.sbms.mvm.ed.ac.uk/people/academic/morcom.html
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
|