[FieldTrip] repeated measures ANOVA (statfun_depsamplesF): dfdenom problems

Eric Maris e.maris at psych.ru.nl
Fri Nov 1 22:40:10 CET 2013


Dear Tim,

> We have recently run into problems using the implementation of a
> repeated measures ANOVA in statfun_depsamplesF.m. In our experiment, we
> have recorded data of 16 subjects, and the factor of the repeated-
> measures ANOVA has 37 levels (admittedly quite a few but that's just
> how it is).
> 
> Now if I am not mistaken, then for a repeated measures ANOVA, the
> degrees of freedom in above case should be: df1 = 36 and df2 = 540
> (this is in line with the results of SPSS, too). However, the
> statfun_depsamplesF.m function seems to compute dfdenom as nunits -
> ncontrasts (nunits is the number of subjects, and ncontrasts is
> nlevels-1). This of course leads to a different value as compared to
> SPSS and what I found in the literature, in which dfdenom is computed
> as (K-1)*(n-1), so in the current case as (nunits-1)*ncontrasts.
> 
> For a one-factor repeated measures ANOVA, I could so far not find a
> principled reason why the number of levels should not exceed the number
> of subjects (which is the error message we get). In fact, SPSS works
> just fine in above scenario. Could someone please explain the logic
> behind the dfdenom computation in fieldtrip? Could it be that there is
> an error in how the degrees of freedom are computed, or am I missing
> something obvious here? For a MANOVA, the story would be different of
> course.

Here, you suggest the answer yourself: in Fieldtrip, we (I) have
implemented the MANOVA dependent samples F-test, which requires more units
than repeated measures. However, within the permutation framework, nothing
prevents you from using the mixed F-statistic that you want to use
(probably because it can deal with the situation of less units than
repeated measures). You can write your own statfun, e.g.
statfun_depsamplesFmixedmodel, and call this function in Fieldtrip's
higher level statistics functions. 

Good to know, the false alarm rate control of your p-value-based inference
does not depend on the sphericity assumption behind the use of the mixed
model dependent samples F-test in a parametric context.

Best,

Eric Maris


> 
> I should add that we are currently interfacing fieldtrip from eeglab
> and get above error only if we choose the nonparametric fieldtrip
> statistics (with cluster correction), but the parametric tests
> implemented in eeglab work just fine.
> 
> 
> Thank you very much for your help, I am looking forward to your
> responses Tim
> 
> 
> 




More information about the fieldtrip mailing list