2x2 Fully Between ANOVA

Home        GLM Flex        FIVE        Downloads    Batch Scripts        News Feed

 

IN.N_subs = [5 5 5 5];  % note the the subjects are entered by condition

IN.Between = [2 2];       % Two factor

IN.BetweenLabs = {{‘Fac1Lev1’ ‘Fac1Lev2’} {‘Fac1Lev1’ ‘Fac1Lev2’}};

IN.Interactions = {[1 2]};

IN.FactorLabs = {‘Factor1’ ‘Factor2’};

IN.EqualVar = [0 0];

IN.Independent = [1 1];


F = CreateDesign(IN);


figure(20); clf

imagesc(F.XX); colormap(gray); shg




I.OutputDir = pwd;

I.F = F;

I.minN = 5;

I.DoOnlyAll = 1;

I.RemoveOutliers=0;

I.Scans = {...

‘s01_c11_c21.nii’;

‘s02_c11_c21.nii’; 

‘s03_c11_c21.nii’; 

‘s04_c11_c21.nii’;

‘s05_c11_c21.nii’;

‘s06_c11_c22.nii’;

‘s07_c11_c22.nii’;

‘s08_c11_c22.nii’;

‘s09_c11_c22.nii’;

‘s10_c11_c22.nii’;

‘s11_c12_c21.nii’;

‘s12_c12_c21.nii’;

‘s13_c12_c21.nii’;

‘s14_c12_c21.nii’;

‘s15_c12_c21.nii’;

‘s16_c12_c22.nii’;

‘s17_c12_c22.nii’;

‘s18_c12_c22.nii’;

‘s19_c12_c22.nii’;

‘s20_c12_c22.nii’;

};



Below are the standard contrasts for a 2x2 ANOVA.  Other contrasts are possible.


I.Cons(1).Groups = {1 2};

I.Cons(1).Levs = [2];

I.Cons(1).ET = 1;

I.Cons(1).mean = 0;


I.Cons(2).Groups = {3 4};

I.Cons(2).Levs = [2];

I.Cons(2).ET = 1;

I.Cons(2).mean = 0;


I.Cons(3).Groups = {5 6 7 8};

I.Cons(3).Levs = [2 2];

I.Cons(3).ET = 1;

I.Cons(3).mean = 0;


I = GLM_Flex(I);




IMPORTANT: Note that the order of scans will go as follows:


Cond1 Lev1 X Cond2 Lev1

Cond1 Lev1 X Cond2 Lev2

Cond1 Lev2 X Cond2 Lev1

Cond1 Lev2 X Cond2 Lev2


Think of this in terms of looping over the factors.  If this doesn’t make sense, be sure to look at the design matrix before inputting the scans.