I have to set up an LMM with just one independent variable and there is both monthly and yearly variation. I aim to get fixed effects coefficients (slope and intercept) for each month and year given as random effect.
can anyone suggest me how to code this? the below code just gives one intercept and different slope in fixed effects
summary(lmer(Y ∼ X+(1+month)+(1|year),data = dataset,REML="TRUE"))
Or should I give each month as a different dataset
summary(lmer(Y ∼ X+(1|year),data = June,REML="TRUE"))