mne.stats.linear_regression

Hi Mne users,

Is there a way to use mne.stats.linear_regression on epoch data or stc
data with *binary/categorical* predictors?

In the MEG data I'm analyzing, the regressor I would like to use is a
categorical variable with 4 different categories of objects indicating
which type of object participants saw in each trial.

I've tried to create the design_matrix with a column of intercept + 4
column of dummy variables for each category. But it didn't work. Following
is the error messages I got:

hi Emma,

yes in your case the intercept column is the sum of the dummy variables
so your design matrix is ill-posed.

it's a standard GLM problem. Cf. articles and textbooks

Maybe someone has a good suggestion for you.

Alex

Indeed, this has a trivial solution: drop the column corresponding to your
"base" condition, which will then load on the intercept.

Thanks very much, Alexandre & Alik!
It does work with only three dummy variables.

Best,
Emma