[R-sig-ME] Group-level predictors which impact the random intercept
Yashree Mehta
y@@hree19 @ending from gm@il@com
Sun Jun 10 19:00:21 CEST 2018
Hello,
I had recently posted the following for understanding the syntax for adding
group-level predictors in a random intercept model:
"""""
Hi,
I am working with a random intercept model. I have the usual "X" vector of
covariates and one id variable which will make up the random intercept. Now
I wish to add group-level predictors (which are NOT in the X vector) such
that the random intercept depends on these predictors.
For example,
Response variable: Production of maize
Covariate: Size of plot
Group-level predictor: Age of farmer
ID variable: Household_ID
I wish to confirm the syntax for including the group-level "Age of farmer"
variable.
fit<-lmer(Production~ Size+ Age+ (1|Household_ID), data=data)
Is this correct or is there another way of declaring the group-level
predictor in the formula?
"""""
This syntax had been confirmed as correct. Now I am wondering how does lmer
really distinguish between the usual X covariates and group-level
predictors? We have not really differentiated them in the formula. How does
lmer construe Age to only impact the random intercept?
Thank you very much,
Regards,
Yashree
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list