On Thursday, October 24, 2013 1:27:38 AM UTC+2, Jeff Miller wrote: > On Thursday, October 24, 2013 10:37:52 AM UTC+13, Bruce Weaver wrote: > > > For those who are interested, here's the code: > > > http://code.google.com/p/fieldtrip/source/browse/trunk/statfun/statfun_depsamplesF.m?r=935 > > > > This part of the code looks suspect to me: > > > > nunits = max(design(cfg.uvar,:)); > > dfdenom = nunits - ncontrasts; > > > > I'm not confident, but it looks to me like: > > > > nunits = the number of subjects. > > ncontrasts = (at least by default) the number of df's > > for the repeated measures factor factor. > > > > In that case, dfdenom for the factor effect in a repeated measures design should be (nunits-1)*ncontrasts.
Thanks for looking into this. The line you are referring to is the suspicious one (in fact the one that made me wonder whether I had a conceptual misunderstanding here).
Below the line, they compute the actual F statistic with
for smplindx=1:nsmpls datonesmpl=reshape(dat(smplindx,poslabelsperunit),nunits,nconds); contrasts=datonesmpl*cfg.contrastcoefs'; contrastavg=mean(contrasts,1); dev=contrasts-repmat(contrastavg,nunits,1); covmat=(dev'*dev)/(nunits-1); s.stat(smplindx)=nunits*contrastavg*inv(covmat)*contrastavg'; end;
Apparently, they are comparing the factor levels to their average, which makes a MANOVA unlikely. I will go and see whether there is something on this in the fieldtrip mailing list. I will keep you updated.
If someone has a suggestion in the meantime, of course please let me know about it.