[FieldTrip] grand average (with average across frequencies)
sarathykousik at gmail.com
Wed Jul 13 10:09:01 CEST 2016
It might not be the most elegant solution, but I would suggest something
like ft_selectdata with ''cfg.avgovrfreq" & cfg.frequency=[10 50] arguments
before the actual grandaverage.
Hope it helps.
Kousik Sarathy, S
On Wed, Jul 13, 2016 at 4:22 AM, Xie Wanze <xiew1202 at gmail.com> wrote:
> It is not difficult to do grand average across subjects or frequencies if
> I understand your questions correctly.
> After you get the powspctrm matrix (chan x freq) for each subject, you
> can write a "for loop" to read in each person's data and then divided by
> the total number of subjects. Assuming you name your output structure as
> EEG_freq for each subject, the syntax would be something like:
> freqtotal = ; numsubject = 0;
> for i = 1:length(subjects)
> ...load your data here;
> if ~numsubject; freqtotal = EEG_freq.powspctrm;
> else; freqtotal = freqtotal + EEG_freq.powspctrm;
> numsubject = numsubject + 1;
> freqavg = freqtotal / numsubject; or freqavg = freqtotal /
> To get average across frequencies, simply use the "mean" function. If you
> have the chan x pow structure for your output then use "mean (freqavg, 2)"
> will do the average across the second dimension (i.e., frequencies).
> Or you can do the average for frequencies for each subject then do the
> average across subjects.
> Hope this will answer your questions.
> 2016-07-12 13:45 GMT-04:00 Jose <joseluisblues at gmail.com>:
>> dear list,
>> I'm analysing CTF MEG data. I computed the power of my data for
>> frequencies from 1 to 50 Hz. Is it possible to perform a grand average
>> across my subjects, but additionally averaging across frequencies for
>> exploratory purposes? Maybe there is a way to do it with
>> ft_freqgrandaverage?, but so far I haven't find it,
>> Many thanks for any hint,
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fieldtrip