Dear Darren,
if it is not just a typo in your email, you may have missed the
'-' (minus) sign for the subject weights in group two. Otherwise I don't
know...
For 3 conditions the weighting factor should be 3/...
The 'repl' factor is only useful if you have replications of the same
condition within each subject. Its behaviour has changed since the very
early days of SPM5, and I believe the fixes for the examples section in
the manual are not yet released. The online help should be accurate.
Volkmar
On Thu, 2008-01-03 at 08:58 -0600, d gitelman wrote:
> Dear Boris, Volkmar, SPM
>
> I had found your posting but this does not work for me and produces the
> message invalid contrast. Just to give a bit more information on the
> flexible factorial setup.
>
> The order of factors (going down in the batch box) is subject, group,
> condition. Independence is yes, yes, no. Variance is equal, unequal,
> unequal.
>
> I have specified the design by subject. For each subject in the first group
> (n=9) the condition matrix is
>
> [1 1; 1 2; 1 3] which gives [ 1 1
> 1 2
> 1 3 ]
>
>
> Similarly for the second group (n=12) I used [2 1; 2 2; 2 3]
>
> There is a main effect of subject (factor number 1)
> There is an interaction of group x condition (factor numbers 2 3)
>
> This produces the design I previously attached which has 21 columns for the
> subject effects (each with 3 rows), 3 columns of group 1 x condition and 3
> columns of group 2 x condition.
>
> Entering a contrast of 2*1/9*ones(1,9) 2*1/12*ones(1,12) 1 1 1 -1 -1 -1 is
> invalid
> I've also tried substituting 3 for the 2 above, 2/3 and 3/2 or leaving off
> the 2 entirely. All are invalid.
>
> The contrasts zeros(1,21) 1 -1 0 1 -1 0 or zeros(1,21) 1 0 -1 -1 0 1
> are valid.
>
> ------------------------
> Have I set this up differently than you did?
>
> When accounting for the subject means why is there a factor of 2 included?
>
> ------------------------
>
> As a separate but related question for flexible factorial designs, how does
> one use the repl condition?
>
> Darren
>
>
> ----------
> Darren Gitelman, MD
> Department of Neurology
> Northwestern University
> voice: (312) 908-8614
> fax: (312) 908-5073
> page: (312) 695-1849
> email: [log in to unmask]
> ----------
>
> > -----Original Message-----
> > From: boris suchan [mailto:[log in to unmask]]
> > Sent: Thursday, January 03, 2008 3:51 AM
> > To: 'd gitelman'
> > Subject: AW: [SPM] questions on perfroming 2 x 2
> > within-subjects ANOVA in SPM5
> >
> > Hi Darren,
> > try 2*1/N1*ones(1,N1) 2*1/N2*ones(1,N2) 1 1 -1 -1 this was
> > from a post by Volkmar Glauche
> > http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind0709&L=SPM&P=R2
> > 1228&I=-3&X=2D
> > 3AC4620A117A0F02&Y=boris.suchan%40rub.de
> >
> > and for me it worked...
> > best wishes
> > boris
> >
> > Priv.-Doz. Dr. Boris Suchan
> > Institute of Cognitive Neuroscience
> > Ruhr University Bochum
> > Universitätsstr. 150
> > 44780 Bochum
> > GAFO 05/613
> > Tel.: + 49 234 3227575
> > Fax: + 49 234 3214622
> > mailto: [log in to unmask]
> > http://www.ruhr-uni-bochum.de/neuropsy/mitarbeiter/boris_suchan.html
> > > -----Ursprüngliche Nachricht-----
> > > Von: SPM (Statistical Parametric Mapping)
> > [mailto:[log in to unmask]]
> > > Im Auftrag von d gitelman
> > > Gesendet: Mittwoch, 2. Januar 2008 20:44
> > > An: [log in to unmask]
> > > Betreff: Re: [SPM] questions on perfroming 2 x 2
> > within-subjects ANOVA
> > > in
> > > SPM5
> > >
> > > Hi Matt/Will/SPM
> > >
> > > I've been reading over this thread. I have a couple questions and I
> > > also run into trouble specifying appropriate contrasts.
> > >
> > > My experiment has 21 subjects in 2 groups- 9 in group 1, and 12 in
> > > group 2.
> > > Each subject performs 3 levels of a task which is an n-back working
> > > memory task.
> > >
> > > Following the discussion I should have 3 factors (i think)
> > > Independence Variance
> > > Subject Yes Equal?
> > > Group Yes Unequal
> > > Condition No* Unequal
> > >
> > > I would think that condition should be non-independent because they
> > > all are drawn from the same subject, but in Will's original
> > email on
> > > this topic he chose independent, which I don't understand.
> > >
> > > Would the variance setup be correct?
> > >
> > > ------
> > > I then chose 1 main effect of subject and 1 interaction of
> > factors 2
> > > and 3.
> > >
> > > this produces a design matrix (attached) with 21 subject
> > columns, then
> > > 3 columns of the interaction of group 1 with each condition and 3
> > > columns with the interaction of group 2 with each condition.
> > > ------
> > >
> > > I can examine some t-tests on the interaction columns. For example
> > > this contrast is valid (looking at group differences of condition
> > > differences)
> > > zeros(1,21) 1 0 -1 -1 0 1
> > >
> > > but this contrast is not valid (looking at group
> > differences of single
> > > conditions)
> > > zeros(1,21) 1 0 0 -1 0 0
> > >
> > > ------
> > > For the main effect of condition I did an F test [
> > zeros(1,21) 1 -1 0
> > > 1 -1 0
> > > zeros(1,21) 0 1 -1 0 1 -1]
> > >
> > > Is this correct? It seems to be valid.
> > >
> > > ------
> > >
> > > I cannot seem to specify a valid contrast for the main
> > effect of group.
> > >
> > > t-test: ones(1,9) -1*ones(1,12) <- invalid
> > > f-test: ones(1,9) -1*ones(1,12) <- invalid
> > > f-test: zeros(1,21) 1 1 1 -1 -1 -1 <- invalid
> > >
> > > and also invalid is the following.
> > > f-test: zeros(1,21) 1 0 0 -1 0 0
> > > zeros(1,21) 0 1 0 0 -1 0
> > > zeros(1,21) 0 0 1 0 0 -1
> > >
> > > any suggestions or comments? I have attached the design matrix.
> > >
> > > Darren
> > >
> > > ----------
> > > Darren Gitelman, MD
> > > Department of Neurology
> > > Northwestern University
> > > voice: (312) 908-8614
> > > fax: (312) 908-5073
> > > page: (312) 695-1849
> > > email: [log in to unmask]
> > > ----------
> > >
> > > > -----Original Message-----
> > > > From: SPM (Statistical Parametric Mapping)
> > > > [mailto:[log in to unmask]] On Behalf Of Matt Shane
> > > > Sent: Thursday, December 20, 2007 2:44 PM
> > > > To: [log in to unmask]
> > > > Subject: Re: [SPM] questions on perfroming 2 x 2 within-subjects
> > > > ANOVA in SPM5
> > > >
> > > > Dear Will (or anyone else who can help),
> > > >
> > > > Your reply to Michiru was very timely for me, and I have just
> > > > attempted to undertake an analysis guided by your steps below. I
> > > > feel like the design matrix is correct, but unfortunately the
> > > > contrast manager doesn't appear to be appreciating the
> > design I've
> > > > created. And so I'm thinking that I might have gone
> > astray from your
> > > > advice in some manner.
> > > >
> > > > In short: I have 30 participants in a 3 (Group) x 3
> > > > (TrialType) mixed-model design. I've thus created 3
> > factors in the
> > > > flexible-factorial model: Subject, Group and TrialType.
> > The design
> > > > matrix (which I'm attaching to this
> > > > post) appears (to me) to be right: I have 30 subject columns,
> > > > followed by the three group columns, followed by the three
> > > > trial-type columns, and finally the group x trial type
> > interactions.
> > > >
> > > > My problem arises when I try to create contrasts in the contrast
> > > > manager, however: I'm able to create contrasts with the first 30
> > > > 'subject' columns, but I'm told that any contrast utilizing the
> > > > 'group' or 'trial type' columns is invalid. Which, obviously, is
> > > > problematic since it's the group and trial type that I want to
> > > > interrogate!
> > > >
> > > > Does anyone have any advice? Have I set up my matrix incorrectly?
> > > > I'm attaching both the matrix and the .mat file, and
> > would be ever
> > > > thankful for anyone willing to take the time to look it over.
> > > >
> > > > Thanks,
> > > > Matt
> > > >
> > > > __________________________
> > > > Matthew S. Shane, Ph.D.
> > > > Research Scientist
> > > > The MIND Institute
> > > > 1101 Yale Blvd NE
> > > > Albuquerque, NM, 87131
> > > > (505) 272-4374
> > > > [log in to unmask]
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: SPM (Statistical Parametric Mapping) on behalf of Will Penny
> > > > Sent: Thu 12/20/2007 9:20 AM
> > > > To: [log in to unmask]
> > > > Subject: Re: [SPM] questions on perfroming 2 x 2 within-subjects
> > > > ANOVA in SPM5
> > > >
> > > > Dear Michiru,
> > > >
> > > > This is most easily done using the 'Flexible Factorial'
> > > > option.
> > > >
> > > > 1. Create two factors.
> > > >
> > > > 2. Call the the first one Subject. Independence Yes,
> > Variance Equal.
> > > >
> > > > 3. Call the second one 'Condition'. Independence Yes, Variance
> > > > Unequal.
> > > >
> > > > 4. Under, Specify Subjects or all Scans, Choose Subjects
> > > >
> > > > 5. Under Subjects, create a new 'Subject' for each
> > subject that you
> > > > have eg. 5.
> > > >
> > > > 6. Then, for each Subject, under 'Scans'. Enter the 4
> > scans you have
> > > > for each subject.
> > > >
> > > > 7. Also, for each Subject, under 'Conditions' enter the
> > vector [1:4]
> > > >
> > > > 8. Under Main effects and Interactions create 2 main
> > effects; factor
> > > > 1 and factor 2.
> > > >
> > > > 9. Specify other covariates as necessary and your o/p directory.
> > > >
> > > > 10. Then save your design job as 'within_subject_design'
> > and press
> > > > run.
> > > >
> > > > I have attached my saved job file 'within_subject_design.mat'
> > > > as a template for you. When you run it, SPM should create
> > the design
> > > > matrix shown in 'design-matrix.png'.
> > > >
> > > > Note the 5 subject columns on the left. Without these 5
> > columns you
> > > > do not have a 'within-subject' design.
> > > >
> > > > Also I have treated your 2 x 2 design as a 1 x 4. So
> > you'll need to
> > > > bear this in mind when doing your contrasts eg. 1 1
> > > > -1 -1 and 1 -1 1 -1 to test for main effects and 1 -1 -1
> > 1 for the
> > > > interaction (of course, pre-pad these with 5 0's).
> > > >
> > > > Best wishes,
> > > >
> > > > Will.
> > > > Michiru Makuuchi wrote:
> > > > > Hi,
> > > > >
> > > > >
> > > > > I have tired to perfrom 2 x 2 within-subjects ANOVA in
> > SPM5, but I
> > > > > couldn't find how I could do that in 'Full factorial'
> > > > dsign. Therefore
> > > > > I designed the design matrix via 'Multiple regression'
> > option. The
> > > > > resulted design matrix was similar to Fig 7 of Henson
> > and Penny's
> > > > > online document (ANOVA and SPM). The difference was only
> > > > the position
> > > > > of constant term. In Fig 7, it was the 4th column, but it
> > > > was on the
> > > > > last column in my design matirix.
> > > > >
> > > > > Here are my questions.
> > > > > Is my approach acceptible for the purpose?
> > > > > Can someone point out the exact procedure to build the
> > > > model for 2 x 2
> > > > > within-subject ANOVA?
> > > > >
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Michiru
> > > > >
> > > > > Michiru Makuuchi
> > > > > Max Planck Institute
> > > > > for Human Cognitive and Brain Sciences Stephanstrasse 1a, 04103
> > > > > Leipzig, Germany
> > > > >
> > > > >
> > > >
> > > > --
> > > > William D. Penny
> > > > Wellcome Trust Centre for Neuroimaging University College London
> > > > 12 Queen Square
> > > > London WC1N 3BG
> > > >
> > > > Tel: 020 7833 7475
> > > > FAX: 020 7813 1420
> > > > Email: [log in to unmask]
> > > > URL: http://www.fil.ion.ucl.ac.uk/~wpenny/
> > > >
> > > >
> > > >
> > > >
> > > >
> >
--
Volkmar Glauche
Freiburg Brain Imaging
http://fbi.uniklinik-freiburg.de/
Phone +49(0)761 270-5331
Fax +49(0)761 270-5416
|