Regression baseline correction

@CarinaFo I have questions about the tutorial for regression based baseline correction.
So, I am trying to understand this part :

design_matrix = np.vstack(
    [
        aud_predictor,
        vis_predictor,
        baseline_predictor,
        baseline_predictor * vis_predictor,
    ]
).T

for the last part, why is it only baseline_predictor * vis_predictor ? because there is also aud_predictor

Also for the fitting :

reg_model = mne.stats.linear_regression(
    epochs, design_matrix, names=["auditory", "visual", "baseline", "baseline:visual"]
)

I only noticed “baseline:visual”. So, I am wondering why there is no baseline:auditory ?

1 Like

Hello Jane,

that is a good point, I should have mentioned that in the tutorial. The reason why there is the interaction term for baseline:visual is arbitrary, we could have also used auditory:baseline, it depends on the researcher what should be the baseline to compare it to. The regression weights will be slightly different but the overall conclusion should be the same, no matter which stimulus you choose for the interaction term. We could have also set up the design matrix differently. Instead of a separate column for visual and auditory, another way would have been to create a column e.g. names “stimulus_type” that codes both for visual and auditory at the same time (aka dummy coding). The idea here is that if the stimulus is a visual stimulus it can’t be a auditory one (at least in this design) and vice versa, therefore including two separate columns is a bit redundant. Dummy coding a stimulus column is more efficient but the interpretation can be less straight forward, as you only get beta weights for the difference between stimuli and not separate weights for each stimulus.
I hope this made things clearer.

Comments are highly encouraged, I am not super good at explaining stats.

Best,

Carina

1 Like