[FieldTrip] Combine Grand Average

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Mon Mar 19 13:35:17 CET 2012


Hi Mark,

I agree with Steve. Though, in order to not re-compute the averages, you 
could create the weighted average yourself. Just make a weight vector 
like this:

/weights = no_trials_cond_A / (no_trials_cond_A+no_trials_cond_B);/

Where /no_trials_cond_A /and /*_b/ contai  the number of trials in 
condition A and B, respectively.
Then you can take the weighted sum of the two grand-averages you have, 
something like:

/    grandavg.individual = condA.individual * weights + condB.individual 
* (1-weights);/

This is mathematically equivalent to re-computing the average on all 
trials (note that I am not sure whether this holds for spectral denisity 
matrices and stuff like that, but for ERPs and plain powerspectra, does).

Best,
Jörn

On 3/19/2012 12:08 PM, Stephen Politzer-Ahles wrote:
> Hi Mark,
>
> Do you mean to combine multiple conditions into a single condition? 
> For that I'm not sure of a built-in function that can do this using 
> grand averages; you might need to re-do ft_timelockanalysis for the 
> new condition and then make new grand averages. Since it's possible 
> that a given subject has more trials contributing to her average for 
> condition A than for condition B, simply averaging the two condition 
> averages together might not be accurate.
>
> Best,
> Steve Politzer-Ahles
>
>     Message: 2
>     Date: Mon, 19 Mar 2012 11:37:47 +0100
>     From: Eelke Spaak <eelke.spaak at donders.ru.nl
>     <mailto:eelke.spaak at donders.ru.nl>>
>     To: Email discussion list for the FieldTrip project
>     <fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>>
>     Subject: Re: [FieldTrip] Combine Grand Average
>     Message-ID:
>     <CABPNLUoTApRzDeyZGvWFfwJjxQcE_QgTwf+pRJcy-jjh+_E7iA at mail.gmail.com <mailto:CABPNLUoTApRzDeyZGvWFfwJjxQcE_QgTwf%2BpRJcy-jjh%2B_E7iA at mail.gmail.com>>
>     Content-Type: text/plain; charset=ISO-8859-1
>
>     Hi Mark,
>
>     I am not entirely sure, but I think ft_appendtimelock might be what
>     you are looking for. If not, you could probably also just append the
>     timelocked information 'by hand':
>
>     tl_combined = tl1;
>     tl_combined.individual = [tl1.individual; tl2.individual];
>
>     But be aware that this could get messy, and you then need to make sure
>     the .avg and other fields are still consistent. So, if at all
>     possible, stick to ft_appendtimelock :)
>
>     Best,
>     Eelke
>
>     On 16 March 2012 18:05, Mark Noordenbos <mark.noordenbos at gmail.com
>     <mailto:mark.noordenbos at gmail.com>> wrote:
>     > Hi,
>     >
>     > I'm looking for a function that combines two timelocked Grand
>     Averages
>     > (keeping the 'subj_chan_time' dimord).
>     > I have for several conditions seperate Grand Averages, but now I
>     need to
>     > combine some of them into a new Grand Average while keeping the
>     individual
>     > data.
>     >
>     > Does Fieldtrip has a buit-in function to do this?
>     >
>     > When just calculating the mean, one dimension ('subj' or 'chan'
>     or 'time')
>     > is always lost.
>     >
>     > Thanks,
>     > Mark
>     >
>     >
>     > --
>     > Mark Noordenbos, MSc
>     >
>     > Radboud University Nijmegen
>     > Behavioural Science Institute
>     >
>     > P.O. Box 9104, Room A05.36
>     > 6500 HE Nijmegen
>     > The Netherlands
>     >
>     > Email: m.noordenbos at bsi.ru.nl <mailto:m.noordenbos at bsi.ru.nl>
>     > Telephone: +31 24 3612070 <tel:%2B31%2024%203612070>
>     > Fax:? ? ? ? ? +31 24 3616211 <tel:%2B31%2024%203616211>
>     >
>     > http://www.ru.nl
>     >
>     >
>     > _______________________________________________
>     > fieldtrip mailing list
>     > fieldtrip at donders.ru.nl <mailto: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


-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: jm.horschig at donders.ru.nl
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120319/a6dad453/attachment.html>


More information about the fieldtrip mailing list