I'm interested to study weather conditions on species diversity. To this end, I used a mixed model, where Julian-day, temperature, and precipitations are the fixed effects, while the month is used as a random effect. My question is: Is it a problem to use a random effect that is correlated with one of the variables in fixed term?


Random effects terms are used to account for correlations in grouped/clustered data. When you include a random effect for the grouping factor month, then you postulate that species diversity measurements in the same month are correlated. The fixed effects are used to specify the mean of your outcome variable (i.e., species diversity).

When you put month as a grouping factor it is not treated as an ordered factor. Hence, if you have that month is January, February, March, and April, you could recode it to banana, apple, orange, and grape, and you would get the same results.

| cite | improve this answer | |
  • $\begingroup$ Thanks a lot @Dimitris Rizopoulos it is really helpful. So the random effect should be factor with different levels not continuous variable, Am I right? $\endgroup$ – Alaa Feb 18 at 13:48
  • 1
    $\begingroup$ @Alaa the grouping variable is a factor for which you can put different random effects, e.g., intercept, slope, etc. $\endgroup$ – Dimitris Rizopoulos Feb 18 at 13:51
  • $\begingroup$ Correct, @Alaa. You could theoretically have a random intercept with 5 levels, 20, 100, or 1000. A random slope could be estimated on a continuous variable or a 0/1 binary variable. $\endgroup$ – Erik Ruzek Feb 18 at 13:52
  • $\begingroup$ Thanks @Dimitris Rizopoulos it helps $\endgroup$ – Alaa Feb 18 at 17:07
  • $\begingroup$ thanks @Erik Ruzek. it helps $\endgroup$ – Alaa Feb 18 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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