<div><div dir="auto">Hi Eelke,</div></div><div dir="auto"><br></div><div dir="auto">Thanks for clarifying - that was my intuition. My remaining question is then how best to perform a trial-by-trial analysis for the LMM?</div><div dir="auto"><br></div><div dir="auto">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?</div><div dir="auto"><br></div><div><div dir="auto">Cheers,</div><div dir="auto">Dan</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 5, 2019 at 1:11 AM Eelke Spaak <<a href="mailto:e.spaak@donders.ru.nl">e.spaak@donders.ru.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Dan,<br>
<br>
Note that db = 10 * log10(stim/bsl), so a non-linear operation.<br>
Therefore the order of steps matters. Let mean(x) denote mean over<br>
trials for x. Then the keeptrials=yes approach results in mean(10 *<br>
log10(stim/bsl)), whereas the keeptrials=no approach results in 10 *<br>
log10(mean(stim) / mean(bsl)). These are in general not the same.<br>
<br>
Cheers,<br>
Eelke<br>
<br>
On Wed, 4 Sep 2019 at 23:34, Dan McCarthy <<a href="mailto:mccarthyd@mail.wou.edu" target="_blank">mccarthyd@mail.wou.edu</a>> wrote:<br>
><br>
> Dear list,<br>
><br>
> 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.<br>
><br>
> Here are the processing steps for the keeptrials = 'yes' dataset:<br>
><br>
> nSteps = 90;<br>
><br>
> fRange = [1 30]; % Range of frequencies to analyze<br>
><br>
> nCyc = [2 12]; % range of cycle widths for each freq<br>
><br>
><br>
> cfg = [];<br>
><br>
> cfg.output = 'pow'; % return power spectra<br>
><br>
> cfg.channel = 'all';<br>
><br>
> cfg.method = 'wavelet'; % multipaper method<br>
><br>
> cfg.foi = linspace(fRange(1),fRange(2),nSteps); % 1 to 30 Hz in 90 steps<br>
><br>
> cfg.width = linspace(nCyc(1),nCyc(2),nSteps); % width of wavelets in number of cycles<br>
><br>
> cfg.toi = [-3 3]; % time windows of interest<br>
><br>
><br>
> cfg.keeptrials = 'yes';<br>
><br>
> cfg.baseline = [-.3 0];<br>
><br>
> cfg.baselinetype = 'db';<br>
><br>
><br>
> for i = 1:nSub<br>
><br>
><br>
> tfDataSLLoCohQ1{i} = ft_freqanalysis(cfg, eeg{bin1,a});<br>
><br>
><br>
><br>
> tfNormDataSLLoCohQ1{i} = ft_freqbaseline(cfg, tfDataSLLoCohQ1{i});<br>
><br>
><br>
> end<br>
><br>
><br>
><br>
> cfg = [];<br>
><br>
><br>
><br>
> % Get subject averages<br>
><br>
> for j = 1:length(tfNormDataSLLoCohQ1)<br>
><br>
><br>
><br>
> tfNormAvgQ1{j} = ft_freqdescriptives(cfg,tfNormDataSLLoCohQ1{j});<br>
><br>
><br>
><br>
> end<br>
><br>
><br>
><br>
> % Get grand average<br>
><br>
> tfNormGrandAvgQ1 = ft_freqgrandaverage(cfg,tfNormAvgQ1{:});<br>
><br>
><br>
> % Get theta band for frontocentral sites<br>
><br>
> cfg.channel = {'Cz','FC1','FC2'};<br>
><br>
> cfg.avgoverchan = 'yes';<br>
><br>
> cfg.frequency = [4 8];<br>
><br>
> cfg.avgoverfreq = 'yes';<br>
><br>
><br>
><br>
> singleThetaQ1 = ft_selectdata(cfg,tfNormGrandAvgQ1);<br>
><br>
><br>
> 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.<br>
><br>
> 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.<br>
><br>
> Has anyone else experienced a similar issue? Any insight into why these two approaches end up with different results?<br>
><br>
> Any help is greatly appreciated. Thank you!<br>
><br>
> Best,<br>
><br>
> Dan McCarthy<br>
> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
> <a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Dan McCarthy, Ph.D.<br>Assistant Professor of Psychology<br>Behavioral Sciences Division<br>Western Oregon University<br>345 N. Monmouth Ave<br>Monmouth, OR 97361<br>Phone: (503) 838-9378<br></div>