Correlation between fixed effect and random effect in mixed model

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.

• 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? – Alaa Feb 18 at 13:48
• @Alaa the grouping variable is a factor for which you can put different random effects, e.g., intercept, slope, etc. – Dimitris Rizopoulos Feb 18 at 13:51
• 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. – Erik Ruzek Feb 18 at 13:52
• Thanks @Dimitris Rizopoulos it helps – Alaa Feb 18 at 17:07
• thanks @Erik Ruzek. it helps – Alaa Feb 18 at 17:07