Testing for an interaction effect with more than 1 ivar using depsamplesF

Saskia Helbling chavera at GMX.DE
Thu Nov 18 18:01:56 CET 2010


Dear Myriam,

earlier threads about 2-way ANOVA can be found here:
https://listserv.surfnet.nl/scripts/wa.cgi?A2=ind1009&L=FIELDTRIP&P=R11455
or here:
https://listserv.surfnet.nl/scripts/wa.cgi?A2=ind0911&L=FIELDTRIP&P=R2726

You are right, depsamplesF accepts only one independent variable and therefor only works for a 1-way ANOVA.

It is not possible to construct an exact permutation test for an interaction, as you'd have to restrict permutations within the levels of the main effects - which leaves you with no exchangeable units you may permute.

There are approximate tests, though. The paper of Anderson et al was posted here already, but since I found it very useful, I cite it again: Anderson MJ and Ter Braak CJF, "PERMUTATION TESTS FOR MULTI-FACTORIAL ANALYSIS OF VARIANCE", J Statistical Computation and Simulation, 2003.

The easiest way to do an approximate test mentioned there, would be Manly's approach of unrestricted (not limited to occur only within levels) permutations of the raw data (raw meaning you do not subtract any cell means). There are more sophisticated approaches, as restricted permutation of residuals, with higher power and a more intuitive justification. However, unrestricted permutations are easiest to implement.

You can start with the statfun_depsamplesF function, which would give you  a suitable data structure (with unrestricted permutations), and feed this data into your ANOVA model (I used the resampling_statistical_toolkit of Delorme). You'll have to adapt the critical values, dfs & the probabilities with respect to the interaction effect. Then you just test your found interaction effect against your "interaction effect distribution" gained by the permutations - as usually.

Approximate tests haven't been discussed at this list, as far as I know, I'd highly appreciate any objections/comments on this topic.

Thanks in advance, best Saskia



--

Saskia Helbling
Institute of Medical Psychology
Goethe University
Frankfurt am Main, Germany
Tel. +49-69-63015661
Fax. +49-69-63017606



-------- Original-Nachricht --------
> Datum: Thu, 18 Nov 2010 15:48:43 +0100
> Von: "Sander, Myriam" <sander at MPIB-BERLIN.MPG.DE>
> An: FIELDTRIP at NIC.SURFNET.NL
> Betreff: [FIELDTRIP] Testing for an interaction effect with more than 1 ivar using depsamplesF

> Dear Fieldtrip-Users,
>
>
>
> I would like to test for an interaction effect in a within-subject
> experiment. I know there was a similar question by Tzvetan Popov this
> year, but I did not find an answer to his question in the archives, so I
> would like to ask this again.
>
>
>  I have 5 subjects and 2 within-factors, one with 2 levels and one with
> 3 levels.
>
> I specified the design matrix as
>
>
>
> 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
>
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
>
> 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3
>
>
>
> clusterstatcfg.ivar   = [2,3];
>
> clusterstatcfg.uvar   = 1;
>
>
>
> I want to use freqstatistics with depsamplesF using montecarlo / cluster
> as correction method, but I get the following error:
>
> Error using ==> statfun_depsamplesF at 110
>
> Invalid specification of the design array.
>
>
>
> The problem seems to me that depsamplesF only allows for 1 ivar, but not
> two - is that right?
>
>
>
> Is there a way how to test interaction effects in this way? Or is it
> necessary to first take the difference between the 2 levels of the first
> factors and then only test for the effect of the second factor?
>
>
>
> Thanks a lot for your help,
>
> Myriam
>
>
>
> ______________________________________
>
>
>
> Myriam Sander, Dipl.-Psych.
>
> Predoctoral Research Fellow
>
> Center for Lifespan Psychology
>
> Max Planck Institute for Human Development
>
> Lentzeallee 94
>
> 14195 Berlin Germany
>
>
>
> Office Phone: (49) 30-82406-414
>
> Fax: (49) 30-8249939
>
>
>
> sander at mpib-berlin.mpg.de <mailto:sander at mpib-berlin.mpg.de>
>
> ______________________________________
>
>
>
>
> ---------------------------------------------------------------------------
> You are receiving this message because you are subscribed to
> the  FieldTrip list. The aim of this list is to facilitate the discussion
> between  users of the FieldTrip  toolbox, to share experiences
> and to discuss  new ideas for MEG and EEG analysis.
> See also http://listserv.surfnet.nl/archives/fieldtrip.html
> and http://www.ru.nl/neuroimaging/fieldtrip.
> ---------------------------------------------------------------------------

---------------------------------------------------------------------------
You are receiving this message because you are subscribed to
the  FieldTrip list. The aim of this list is to facilitate the discussion
between  users of the FieldTrip  toolbox, to share experiences
and to discuss  new ideas for MEG and EEG analysis.
See also http://listserv.surfnet.nl/archives/fieldtrip.html
and http://www.ru.nl/neuroimaging/fieldtrip.
---------------------------------------------------------------------------



More information about the fieldtrip mailing list