Martin >I have one more question regarding the between groups analysis. > >As a reminder, I have two groups (15 and 13 subjects each) and >have made >contrast images for each subject as follows, based on the >three parameter >estimates for three basis functions (HRF + derivatives): > >con1: 1 0 0 -1 0 0 (1st beta A > B) >con2: 0 1 0 0 -1 0 (2nd beta A>B) >con3: 0 0 1 0 0 -1 (3rd beta A>B) > >Now I want to compare groups I and II, so I put the contrast >images into >one way ANOVA without constant: > >group 1: con1 group I >group 2: con2 group I >group 3: con3 group I >group 4: con1 group II >group 5: con2 group II >group 6: con3 group III > >I say [yes] to non-sphericity correction. > >Then is asks: replications are over? AND THIS THE PROBLEM. > >The replications should be over subjects but my first group >has 15 subjects >and the second one only 13. > >So I put in "repl(15)" but then the pre-whitened design matrix >looks weird. >The color changes for the first three columns (group I) but >not for the >next three columns (group II). So I think the error covariance >matrix is >not correct and furthermore is not the inhomogeneity of >variance is not >modelled the same way for the two groups. > >Because ultimately, I want to compare groups I and II for all three >parameters (F-test): >1 0 0 -1 0 0 >0 1 0 0 -1 0 >0 0 1 0 0 -1 Aha! My fault: remember, we are trying to trick SPM to handle within+between subject designs, but the SPM GUI cannot handle "correlated errors" when there are unequal numbers of replications per "group" (which makes sense, because if "group" really were a repeated measure - ie could induce correlated errors - it would have the same number of replications per level!). Try the attached "batch_mixed_anova.m" script. It should give you the kind of design you want, ie with the correct modelling of correlated errors for the within-subject factors (condition/basis function), but not for the between-subject factor (group). Again, I hope this messy GUI will be updated in SPM5! Rik -------------------------------------------------------- DR RICHARD HENSON MRC Cognition & Brain Sciences Unit 15 Chaucer Road, Cambridge, CB2 2EF England EMAIL: [log in to unmask] URL: http://www.mrc-cbu.cam.ac.uk/~rik.henson TEL +44 (0)1223 355 294 x522 FAX +44 (0)1223 359 062 MOB +44 (0)794 1377 345 -------------------------------------------------------- >At 09:44 AM 6/23/2005 +0100, Rik Henson wrote: >>>Martin wrote: >>>I have two groups: controls and schizophrenics. I used the >canonical hrf + >>>the two derivatives in my model. I created the following >contrasts for the >>>difference between A and B for each subject from each group: >>>[1 0 0 -1 0 0] canonical HRF A-B >>>[0 1 0 0 -1 0] temporal derivative A-B >>>[0 0 1 0 0 -1] dispersion derivative A-B >>>I was then able to examine the overall effect for _each >group_ separately >>>using a one-way ANOVA (without constant term), modelling the >three contrast >>>images as three groups using the F-contrast: >>>[1 0 0 >>> 0 1 0 >>> 0 0 1] >> >>>Antonia wrote: >>>I think this step is a mistake (one I was making until >yesterday!). This >>>ANOVA means that you are looking for areas where the HRF, temp >>>and disp differ from each other, not where they differ from zero. So >>>if you had a giant effect with positive values for all 3 contrasts, >>>you wouldn't find it in this analysis. Can anyone confirm >and suggest >>>the proper analysis, because I don't know what it is? >> >>No, Martin is correct. If the contrast images are already >>differences between conditions, then the F-contrast [1 0 0; 0 >1 0; 0 0 1] >>is CORRECT for testing any >>differences between the conditions in the shape of >>the HRF (at least those shape differences that can be captured by the >>three basis functions). >> >>You are correct that an F-contrast that tested for >>differences between the basis functions would NOT >>be appropriate. However, such an F-contrast would be >>some rotation of [1 -0.5 -0.5; -0.5 1 -0.5; -0.5 -0.5 1] >>instead. >> >>And this is why it is important NOT to include a constant >>term in the ANOVA. If you do include one, you will >>find that you cannot evaluate the F-contrast [1 0 0; 0 1 0; 0 0 1], >>because the design matrix is now rank deficient and the >>contrast weights will need to sum to 1. You will also see >>that the default "effects of interest" contrast looks like [1 >-0.5 -0.5; >>-0.5 1 -0.5; -0.5 -0.5 1], and so is not >>appropriate. You would need to redo without a constant. >> >>Finally, note that you should use "full" nonsphericity correction >>(ie non-identically distributed and non-independent (correlated >>errors)), because the (contrasts of) basis functions come from >>the same subjects, and have quite difference scalings, so both >>the variance and covariance of errors are likely to be nonspherical. >> >> >>>Martin wrote: >>>What if I want to compare the two groups now? Do I do a >one-way ANOVA where >>>I enter six groups - one for each contrast for each group >and then do an >>>F-contrast like: >>>[1 0 0 -1 0 0 >>> 0 1 0 0 -1 0 >>> 0 0 1 0 0 -1] >>>to get the overall effect? >> >>Yes. (If the contrast images were already differences between >>two conditions, then this would actually test the "Group X Condition >>interaction". To test the "main effect of Group", perform another >>ANOVA, but this time with the contrast images being the average >>(sum) of the two conditions, for each basis function). >> >>There is a slight problem here that this ANOVA really consists of >>one within-subject factor (basis function) and one between-subject >>factor (group), yet the SPM2 GUI does not allow you to specify a >>error covariance basis set (for nonsphericity correction) with only >>some (but not all) of the off-diagonal terms included. You can do this >>by hand in matlab (in a batch script), or you can wait until >(hopefully) >>the whole "second-level" stats GUI options in SPM5 are >over-hauled (about >>time!). >>But for now, I doubt there would be much harm in allowing "full" >>nonsphericity correction anyway, and hopefully ReML will estimate >>covariance terms close to zero for the between-subject covariances. >> >> >>>Can I do an equivalent of the t-test above, such as: >>>[1 0 0 -1 0 0] to find A>B group 1>2? >> >>Yes. >> >>Rik >> >> >>---------------------------------------- >>Dr Richard Henson >>MRC Cognition & Brain Sciences Unit >>15 Chaucer Road >>Cambridge >>CB2 2EF, UK >> >>Tel: +44 (0)1223 355 294 x522 >>Fax: +44 (0)1223 359 062 >> >>http://www.mrc-cbu.cam.ac.uk/~rik.henson >>---------------------------------------- >