0todd0000 / spm1d

One-Dimensional Statistical Parametric Mapping in Python
GNU General Public License v3.0
61 stars 21 forks source link

Mixed models with random intercept #52

Closed zof1985 closed 8 years ago

zof1985 commented 8 years ago

Hi Todd,

I wonder if it is possible to perform a mixed model analysis considering only random intercept using spm1d. My model of interest would be:

 Y = aX * bX * cX + i | subjects

where Y is my variable of interest. a, b, c are the (fixed) factors and i is the intercept.

The model comes out from my experiemental hypothesis that the effects of the factors are somehow the same between subjects, but each subject has his/her own baseline level of Y. Thus, I assume that a mixed model where my factors are kept as fixed and the intercepts are allowed to be random across the subjects is what I am looking for. Am I right? I had a look to the documentation about Random Effects Analysis, but I don't think that it suit my case.

Many thanks, Luca

0todd0000 commented 8 years ago

Hi Luca,

General mixed modeling is not yet supported in spm1d but for this particular model I believe you could just subtract subject means and run (fixed) ANOVA. That is, I believe the model is equivalent to:

Y_m = aX * bX * cX

where Y_m contains mean-corrected data (i.e. the mean of Y_m is zero and the mean for each subject is also zero).

However, I wonder if the appropriate model is actually a three-way repeated-measures design? If each subject performs all combinations of aX, bX and cX, then a three-way repeated-measures design will automatically offset each subject's baseline response.

Regards,

Todd

zof1985 commented 8 years ago

Thank you Todd.

I will go for a 3-way RM ANOVA then.

Best, Luca.