I am doing an analysis with 2 groups of patients (control and disease) whose blood pressures have been measured continuously for 24 hours. My first goal is to test the effect of GROUP on BP. In the beginning, I built the mixed effect model with TIME as random effect variable and group as fixed effect model. The model I used is listed below:

mod <- lme(BP ~ factor(GROUP), random=~1+ TIME| ID, data=gdata)

However, the experimenter wants to know the effects of GROUP on the slope of blood pressure changing per hour. In another words, we need to have blood pressure slope, which is the change of blood pressure by time, as response variable in the model. And I generated another model as bellow:

mod <- lme(BP ~ factor(GROUP)*TIME, random=~1+ TIME| ID , data=gdata)

However, in the new model, the time works both as random effect variable and fixed effect variable. I am not sure if this is allowed in the mixed effect model.


1 Answer 1


Absolutely. In fact, the vast majority of the time, you absolutely should include a fixed effect.

The reason for this is that random effects are restrained to $\sum \gamma = 0$, or always centered around 0. Thus, the random effect is the individual's estimated deviation from the group average for that individual. By leaving out the fixed effect, you would imply that the average effect of time must be 0.

  • $\begingroup$ thanks for the explanation! this makes a lot of sense! (I was actually wondering if using a predictor only as a random effect was ok). $\endgroup$ May 4, 2018 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.