# Seeking advices for baseline correction in SEEG time-frequency analysis

**URL:** <https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354>\
**Category:** Support & Discussions\
**Tags:** time-frequency, eeg, ieeg-and-ecog\
**Created:** [September 25, 2024, 1:27pm UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354 "2024-09-25T13:27:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![const](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@const](https://mne.discourse.group/u/const)\
**Post date:** [September 25, 2024, 1:27pm UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354/1 "2024-09-25T13:27:56Z")

</div>

Hi all,

I’m currently working on **single-trial GLM analysis** of SEEG data in the high-gamma band. My initial steps involve extracting epochs and calculating the time-frequency representation (TFR) for each trial. However, I have some uncertainties regarding the baseline correction process.

Currently, I epoch the data from -1.5s to 2s around stimulus onset and apply baseline correction from -1.5s to 0s for each trial (this is inherently done in `mne.Epoch`, which subtracts the mean amplitude of the pre-stimulus EEG signal I guess). After this, I perform Morlet wavelet TFR for each trial and crop the data to the -1s to 1.5s window. I then apply `apply_baseline(baseline=(None, 0), mode=??)` to the trial-level TFR.

The TFR data would be used for subsequent GLM analysis on frequency band power. More specifically, I extract the mean time series from the high-gamma band frequencies and compute the mean time series for each trial and contact. I then conduct GLM on each time point, using high-gamma activity as the dependent variable and behavioral indices as independent variables.

For my purpose, I have a few questions:

1. Is my procedure for TFR analysis appropriate in this context?
2. I know that MNE offers multiple baseline correction modes, including `mean, ratio, logratio, percent, zscore, zlogratio`. Which one would be most suitable for my analysis, and why? Most iEEG papers seem to use `mean` or `zscore`, but their descriptions are often ambiguous, leaving me uncertain about the rationale.
3. Should I crop the data before or after applying baseline correction?
4. Should I consider the baseline mode when epoching the data?

Thank you!  
Kun

---

<div class="post-metadata">

**Author:** ![contsili](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/contsili/32/3932_2.png) [@contsili](https://mne.discourse.group/u/contsili)\
**Post date:** [September 28, 2024, 1:05am UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354/2 "2024-09-28T01:05:15Z")

</div>

Hi Kun,

I haven’t worked with SEEG, but I have with MEG. Here’s my advice:

1. I would not recommend using `apply_baseline(baseline=(None, 0), mode=??)` to the trial-level TFR. (see: [General question: Applying baseline](https://mne.discourse.group/t/general-question-applying-baseline/2958)). I believe it’s best not to over-clean the data, as we risk losing valuable signals. I’d only clean them if there were clear artifacts. However, keep in mind that opinions vary and some believe baseline correction can increase statistical sensitivity.

2. I suggest using mode=‘ratio’ or ‘zratio’ instead of ‘mean.’ This makes data unitless, and easy to compare between modalities like MEG and EEG, Also, it deals better with the brain’s 1/f effect (see: [[FieldTrip] TFR Baseline Correction Type](https://mailman.science.ru.nl/pipermail/fieldtrip/2021-July/040965.html)).

3. If you apply baseline correction to the trial-level TFR, I recommend applying it _before_ cropping trials (see: [Question about baseline in time-frequency representation - #3 by drammock](https://mne.discourse.group/t/question-about-baseline-in-time-frequency-representation/8033/3)).

4. During epoching of your data with `mne.Epoch`, I think you can’t specify a mode. I think it automatically subtracts the mean amplitude of the pre-stimulus EEG signal, as you already pointed out.

I hope that helps! 🙂

Best,  
Konstantinos

---

<div class="post-metadata">

**Author:** ![const](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@const](https://mne.discourse.group/u/const)\
**Post date:** [September 28, 2024, 1:25pm UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354/3 "2024-09-28T13:25:49Z")

</div>

Hi Konstantinos,

Thank you for your detailed reply; it was very helpful!

Since most SEEG studies use baseline correction, so I’ve applied it here as well. However, I’m still unclear about the different baseline correction methods—specifically, how they generally impact the results and when to choose one over the other.

Here are my two figures from my TFR-based GLM result with `ratio` (top) or `zlogratio` (bottom) correction for TFR. The `ratio` based result looks quite unusual. Do you have any insights  
on this?

 ![valence_high-gamma_ratio](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/4/4e4e7fd932f9ffc7e7aac28ca2fa47943641fb80.jpeg)  
 ![valence_high-gamma_zlogratio](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/2/29b188494dc85caf490ccdbe6042aab3db5e6029.jpeg)

Thank you!  
Kun

---

<div class="post-metadata">

**Author:** ![contsili](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/contsili/32/3932_2.png) [@contsili](https://mne.discourse.group/u/contsili)\
**Post date:** [September 28, 2024, 3:19pm UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354/4 "2024-09-28T15:19:14Z")

</div>

Dear Kun,

I would not say that the ‘ratio’ based result looks unusual. Just different from the ‘logratio’ one. With a robust analysis both methods should give the same results. So something should be off in your results

Note that the two methods have different values on the y axes. But this is expected. If you plan to contrast the two conditions (‘current’ vs ‘previous’) the value on the y axis is irrelevant. You only care about the difference between the y-values.

I would suggest to plot the TFR (y:freq., x:time, colorcode:power) and see if the two methods match. Then we can further discuss how this might affect your statistics/regression coefficients.

A thought I had is that you use GLM which is a linear model. This linear model will change depending on the way you calculated your power (log vs ratio - note that log and ratio are both non-linear methods). Maybe for your analysis the best mode to use is the ‘mean’ which is a linear method.

Best,  
Konstantinos

---

<div class="post-metadata">

**Author:** ![const](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@const](https://mne.discourse.group/u/const)\
**Post date:** [September 30, 2024, 3:06am UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354/5 "2024-09-30T03:06:35Z")

</div>

Thanks for your valuable suggestions! I will check it.

---

<div class="post-metadata">

**Author:** ![contsili](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/contsili/32/3932_2.png) [@contsili](https://mne.discourse.group/u/contsili)\
**Post date:** [September 30, 2024, 11:56am UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354/6 "2024-09-30T11:56:48Z")

</div>

Of course, I am happy to help!

> [@const](#):
>
> I then apply `apply_baseline(baseline=(None, 0), mode=??)` to the trial-level TFR

Just as a note, in MEG/EEG we do not recommend applying baseline correction _per trial_ since one trial has a lot of variance and by doing baseline correction you introduce only variance to your data.

It is better to _average across trials_ and then perform baseline correction.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [October 7, 2024, 11:57am UTC](https://mne.discourse.group/t/seeking-advices-for-baseline-correction-in-seeg-time-frequency-analysis/9354/7 "2024-10-07T11:57:09Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
