[FieldTrip] Discrepancy between trialwise and average data using ft_freqanalysis

Dan McCarthy mccarthyd at mail.wou.edu
Thu Sep 5 18:06:07 CEST 2019


Hi Eelke,

Thanks for clarifying - that was my intuition. My remaining question is
then how best to perform a trial-by-trial analysis for the LMM?

I believe it would be best to baseline trial wise to get an accurate
measure of change relative to baseline for each trial, then use those
values. Without doing so, it would not be an accurate measure of power over
time because each trial would have an arbitrary baseline. Is this correct?

Cheers,
Dan

On Thu, Sep 5, 2019 at 1:11 AM Eelke Spaak <e.spaak at donders.ru.nl> wrote:

> Dear Dan,
>
> Note that db = 10 * log10(stim/bsl), so a non-linear operation.
> Therefore the order of steps matters. Let mean(x) denote mean over
> trials for x. Then the keeptrials=yes approach results in mean(10 *
> log10(stim/bsl)), whereas the keeptrials=no approach results in 10 *
> log10(mean(stim) / mean(bsl)). These are in general not the same.
>
> Cheers,
> Eelke
>
> On Wed, 4 Sep 2019 at 23:34, Dan McCarthy <mccarthyd at mail.wou.edu> wrote:
> >
> > Dear list,
> >
> > I am conducting a trialwise LMM analysis on time-frequency data and
> compared my grand averages between two ft_freqanalysis pipelines for sanity
> checking. Though the data look qualitatively similar, I noticed the values
> are baselined roughly 1.5 dB lower (i.e., values around zero vs. -1.5) for
> the grand averages using the cfg.keeptrials = 'yes' option compared to the
> cfg.keeptrials = 'no' option.
> >
> > Here are the processing steps for the keeptrials = 'yes' dataset:
> >
> > nSteps = 90;
> >
> > fRange = [1 30]; % Range of frequencies to analyze
> >
> > nCyc = [2 12]; % range of cycle widths for each freq
> >
> >
> > cfg = [];
> >
> > cfg.output = 'pow'; % return power spectra
> >
> > cfg.channel = 'all';
> >
> > cfg.method = 'wavelet'; % multipaper method
> >
> > cfg.foi = linspace(fRange(1),fRange(2),nSteps); % 1 to 30 Hz in 90 steps
> >
> > cfg.width = linspace(nCyc(1),nCyc(2),nSteps); % width of  wavelets in
> number of cycles
> >
> > cfg.toi = [-3 3]; % time windows of interest
> >
> >
> > cfg.keeptrials = 'yes';
> >
> > cfg.baseline = [-.3 0];
> >
> > cfg.baselinetype = 'db';
> >
> >
> > for i = 1:nSub
> >
> >
> >      tfDataSLLoCohQ1{i} = ft_freqanalysis(cfg, eeg{bin1,a});
> >
> >
> >
> >      tfNormDataSLLoCohQ1{i} = ft_freqbaseline(cfg, tfDataSLLoCohQ1{i});
> >
> >
> > end
> >
> >
> >
> > cfg = [];
> >
> >
> >
> > % Get subject averages
> >
> > for j = 1:length(tfNormDataSLLoCohQ1)
> >
> >
> >
> >     tfNormAvgQ1{j} = ft_freqdescriptives(cfg,tfNormDataSLLoCohQ1{j});
> >
> >
> >
> > end
> >
> >
> >
> > % Get grand average
> >
> > tfNormGrandAvgQ1 = ft_freqgrandaverage(cfg,tfNormAvgQ1{:});
> >
> >
> > % Get theta band for frontocentral sites
> >
> > cfg.channel = {'Cz','FC1','FC2'};
> >
> > cfg.avgoverchan = 'yes';
> >
> > cfg.frequency = [4 8];
> >
> > cfg.avgoverfreq = 'yes';
> >
> >
> >
> > singleThetaQ1 = ft_selectdata(cfg,tfNormGrandAvgQ1);
> >
> >
> > In the cfg.keeptrials = 'no' pipeline, all is the same except the option
> is switched off and the extra step to get descriptives
> (ft_freqdescriptives) is removed before ft_freqgrandaverage as the trials
> were discarded so the extra step isn't necessary.
> >
> > When I plot the theta time course, all the values in the cfg.keeptrials
> = 'yes' data are shifted roughly 1.5 units down on the y-axis compared to
> the cfg.keeptrials = 'no' data.
> >
> > Has anyone else experienced a similar issue? Any insight into why these
> two approaches end up with different results?
> >
> > Any help is greatly appreciated. Thank you!
> >
> > Best,
> >
> > Dan McCarthy
> > _______________________________________________
> > fieldtrip mailing list
> > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > https://doi.org/10.1371/journal.pcbi.1002202
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-- 
Dan McCarthy, Ph.D.
Assistant Professor of Psychology
Behavioral Sciences Division
Western Oregon University
345 N. Monmouth Ave
Monmouth, OR 97361
Phone: (503) 838-9378
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190905/c3f9398c/attachment.html>


More information about the fieldtrip mailing list