[FieldTrip] ft_freqstatistics and FDR-correction
Patricia Wollstadt
Patricia.Wollstadt at gmx.de
Tue Feb 1 22:26:51 CET 2011
Dear all,
the problem was caused by the wrong design matrix (and thus the superfluous cfg.uvar), sorry for not making this clear. So actually I just need a vector that specifies the group for each subject,
Best
Patricia
-------- Original-Nachricht --------
> Datum: Tue, 1 Feb 2011 11:38:26 -0600
> Von: Rodolphe Nenert <batrod at gmail.com>
> An: Email discussion list for the FieldTrip project <fieldtrip at donders.ru.nl>
> Betreff: Re: [FieldTrip] ft_freqstatistics and FDR-correction
> Dear Patricia and others that participated to this discussion.
>
> I had recently the same problem, using ft_freqstatistics with Montecarlo
> to
> correlate Time-frequency power values and behavioral results.
> All my p-values were first found to be 0, resulting in a mask full of 1.
> By removing the useless cfg.uvar, the script made the correct analysis and
> reported good correlation values.
>
> Hope this helps,
>
> Rodolphe.
>
> On Tue, Feb 1, 2011 at 11:29 AM, Michael Wibral
> <michael.wibral at web.de>wrote:
>
> > Hi Patricia,
> >
> > it seems that things are clarified now. I just do not know what was
> > actually wrong with your code Was it the superfluous specification of
> > cfg.uvar??
> > Could you let us know? Thanks.
> >
> > Michael
> > -----Ursprüngliche Nachricht-----
> > Von: "Patricia Wollstadt" <Patricia.Wollstadt at gmx.de>
> > Gesendet: Feb 1, 2011 4:34:04 PM
> > An: "Email discussion list for the FieldTrip project" <
> > fieldtrip at donders.ru.nl>
> > Betreff: Re: [FieldTrip] ft_freqstatistics and FDR-correction
> >
> > >Hi Michael, Hi Jan-Mathijs,
> > >
> > >thank you very much for the advice/clarification. Everything seems to
> run
> > fine now (with the corrected design).
> > >
> > >Thank you very much,
> > >
> > >Best
> > >
> > >Patricia
> > >
> > >
> > >-------- Original-Nachricht --------
> > >> Datum: Wed, 26 Jan 2011 10:08:51 +0100 (CET)
> > >> Von: "Michael Wibral" <michael.wibral at web.de>
> > >> An: "Email discussion list for the FieldTrip project" <
> > fieldtrip at donders.ru.nl>
> > >> Betreff: Re: [FieldTrip] ft_freqstatistics and FDR-correction
> > >
> > >> Hi Patricia,
> > >>
> > >> I also would have thought your design to be correct. Maybe the
> > >> unneccessary specification of the uvar screws thinsg up??
> > >>
> > >> However, you really do not have any repeated measures in your design
> -
> > >> here the output of FT is correct. I interpret it in the following
> way:
> > You
> > >> specified cfg.uvar - indicating to FT the possibility that this might
> be
> > a
> > >> repeated measures design. FT identified the units of observation as
> > being 80
> > >> (correct), and then checked how many repeated measures you ran in
> each
> > UO
> > >> and found just 1 - which is also correct. I agree that naming the
> units
> > of
> > >> observation (UO) as 'levels' of the UO variable is a bit odd, should
> > rather
> > >> be 'units of observation'.
> > >>
> > >> The concept of repeated measures is also very often misunderstood: in
> > >> repated measures you do not actually repeat anything, rather you
> perform
> > >> different measurements (treatments) WITHIN a unit of observation - so
> a
> > repated
> > >> measures design is a within UO design. Your subjects just have one
> age,
> > so
> > >> there are no different treatments (levels of the indep variable) per
> > >> subjects and, hence, no 'repeated measures'.
> > >>
> > >> Hope this clarifies terminology for further discussion.
> > >>
> > >> Michael
> > >>
> > >>
> > >> -----Ursprüngliche Nachricht-----
> > >> Von: "jan-mathijs schoffelen" <jan.schoffelen at donders.ru.nl>
> > >> Gesendet: Jan 25, 2011 8:57:03 PM
> > >> An: "Email discussion list for the FieldTrip project"
> > >> <fieldtrip at donders.ru.nl>
> > >> Betreff: Re: [FieldTrip] ft_freqstatistics and FDR-correction
> > >>
> > >> >Hi Patricia,
> > >> >
> > >> >I don't really understand what is going on, but could you try to
> > >> >specify your design only in a single row (design = design(2,:) in
> your
> > >> >case), specify cfg.ivar = 1; and cfg=rmfield(cfg,'uvar'), and see
> how
> > >> >it runs? As such the uvar row is not relevant in an independent
> > >> >samples design.
> > >> >
> > >> >Best,
> > >> >
> > >> >Jan-Mathijs
> > >> >
> > >> >
> > >> >
> > >> >On Jan 25, 2011, at 6:08 PM, Patricia Wollstadt wrote:
> > >> >
> > >> >> Dear all,
> > >> >>
> > >> >> I'm still trying to identify the underlying reason for the issue
> > >> >> described below. I ran the analysis in debug mode (I'm using
> > >> >> Matlab2008b and the Fieldtrip-release from the 16th of January
> 2011)
> > >> >> and found that the matrix 'resample', that is generated in
> > >> >> 'statistics_montecarlo', line 187:
> > >> >>
> > >> >> resample = resampledesign(cfg, design);
> > >> >>
> > >> >> doesn't contain actual permutations of my initial design, but
> rather
> > >> >> sorted rowvectors from 1 to 80 (no of subjects). So (since there
> is
> > >> >> no permutation of the units of observation) the 'randstat' that is
> > >> >> subsequently calculated for each row of the resample-matrix is
> > >> >> always the same.
> > >> >> Is this maybe due to my design and my units of observations
> > >> >> respectively? I am looking at age-dependent variations in resting-
> > >> >> state data, so my UO are 80 subjects, divided into four age
> groups.
> > >> >> The commandline-output of the 'resampledesign'-function is as
> > follows:
> > >> >>
> > >> >> total number of measurements = 80
> > >> >> total number of variables = 2
> > >> >> number of independent variables = 1
> > >> >> number of unit variables = 1
> > >> >> number of within-cell variables = 0
> > >> >> number of control variables = 0
> > >> >> using a permutation resampling approach
> > >> >> repeated measurement in variable 1 over 80 levels
> > >> >> number of repeated measurements in each level is 1 1 1 1 1 1 1 1 1
> 1
> > >> >> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1
> > >> >> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1
> > >> >> 1 1
> > >> >>
> > >> >>
> > >> >> Is this correct? Shouldn't this read 'repeated measurement in
> > >> >> variable 2 over 4 levels' with the number of subjects per group as
> > >> >> repeated measurements within a condition? Still I am pretty sure
> > >> >> about my design matrix, which contains the indices 1 to 80 (for
> all
> > >> >> subjects) in the first row (this is my cfg.uvar) with the
> > >> >> corresponding age groups (1 to 4) in the second row (cfg.ivar, see
> > >> >> my previous email below). I use an 'indepsamplesF'-statistic,
> since
> > >> >> I am comparing between four groups of different subjects (averaged
> > >> >> over trials).
> > >> >>
> > >> >> I hope, I got the settings and my design right. Any suggestions,
> > >> >> whether this is a problem due to wrong configurations in my script
> > >> >> are very welcome.
> > >> >>
> > >> >> Right now I work around this issue by replacing line 279 in
> > >> >> 'statistics_montecarlo':
> > >> >>
> > >> >> tmpdesign = design(:,resample(i,:));
> > >> >>
> > >> >> with:
> > >> >>
> > >> >> tmpdesign = design(:,randperm(size(design,2)));
> > >> >>
> > >> >> creating permutations of my design 'by hand'. Is this acceptable
> or
> > >> >> is there anything I'm maybe missing.
> > >> >>
> > >> >> Thank you very much, kind regards,
> > >> >>
> > >> >> Patricia
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >> -------- Original-Nachricht --------
> > >> >>> Datum: Mon, 24 Jan 2011 17:47:26 +0100
> > >> >>> Von: "Patricia Wollstadt"
> > >> >>> An: fieldtrip at donders.ru.nl
> > >> >>> Betreff: [FieldTrip] ft_freqstatistics and FDR-correction
> > >> >>
> > >> >>> Dear Fieldtrip-users,
> > >> >>>
> > >> >>> I'm currently trying to calculate freqstatistics for four
> > >> >>> experimental
> > >> >>> groups, using the following options:
> > >> >>>
> > >> >>> groupSize=[length(subjects{1}) length(subjects{2})
> > >> >>> length(subjects{3})
> > >> >>> length(subjects{4})];
> > >> >>>
> > >> >>> design = [1:groupSize(1)+groupSize(2)+groupSize(3)+groupSize(4)];
> > >> >>> % 1 to N subjects
> > >> >>> design(2,:) = [ones(1,groupSize(1)) 2*ones(1,groupSize(2))
> > >> >>> 3*ones(1,groupSize(3)) 4*ones(1,groupSize(4))]; % indep var ->
> > >> >>> group membership
> > >> >>>
> > >> >>>
> > >> >>> cfg=[];
> > >> >>> cfg.design=design;
> > >> >>> cfg.uvar = 1;
> > >> >>> cfg.ivar = 2;
> > >> >>> cfg.method = 'montecarlo';
> > >> >>> cfg.statistic = 'indepsamplesF';
> > >> >>> cfg.correctm = 'fdr';
> > >> >>> cfg.numrandomization = 180000;
> > >> >>> cfg.alpha = 0.01/7;
> > >> >>> cfg.tail = 1;
> > >> >>> cfg.design = design;
> > >> >>> cfg.channels = myChannels;
> > >> >>> cfg.avgovertime = 'yes';
> > >> >>> cfg.avgoverfreq = 'yes';
> > >> >>> cfg.frequency = [1 3];
> > >> >>>
> > >> >>> stat = ft_freqstatistics(cfg, group1avg, group2avg, group3avg,
> > >> >>> group4avg);
> > >> >>>
> > >> >>> With these settings, the coputation itself runs fine, but the
> > >> >>> resulting
> > >> >>> 'prob'-matrix contains only zeros (accordingly the 'mask'-matrix
> > >> >>> consists of
> > >> >>> only ones). This would mean, that I found significant effects for
> > all
> > >> >>> channels. Is this possible or rather due to an error somewhere in
> > >> >>> my script? Is
> > >> >>> it likely, that these are 'real' zeroes or rather very small
> > >> >>> values, close
> > >> >>> to zero?
> > >> >>> Any hints and suggestions are very welcome, thank you in advance,
> > >> >>>
> > >> >>> Kind regards
> > >> >>>
> > >> >>> Patricia Wollstadt
> > >> >>>
> > >> >>>
> > >> >>> --
> > >> >>> GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
> > >> >>> gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
> > >> >>> _______________________________________________
> > >> >>> fieldtrip mailing list
> > >> >>> fieldtrip at donders.ru.nl
> > >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > >> >>
> > >> >> --
> > >> >> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> > >> >> belohnen Sie mit bis zu 50,- Euro!
> > https://freundschaftswerbung.gmx.de
> > >> >> _______________________________________________
> > >> >> fieldtrip mailing list
> > >> >> fieldtrip at donders.ru.nl
> > >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > >> >
> > >> >Dr. J.M. (Jan-Mathijs) Schoffelen
> > >> >Donders Institute for Brain, Cognition and Behaviour,
> > >> >Centre for Cognitive Neuroimaging,
> > >> >Radboud University Nijmegen, The Netherlands
> > >> >J.Schoffelen at donders.ru.nl
> > >> >Telephone: 0031-24-3614793
> > >> >
> > >> >_______________________________________________
> > >> >fieldtrip mailing list
> > >> >fieldtrip at donders.ru.nl
> > >> >http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > >
> > >--
> > >GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
> > >gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
> > >_______________________________________________
> > >fieldtrip mailing list
> > >fieldtrip at donders.ru.nl
> > >http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> >
--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
More information about the fieldtrip
mailing list