[R-sig-ME] Syntax for adding group-level predictors

Yashree Mehta y@@hree19 @ending from gm@il@com
Fri May 11 14:50:51 CEST 2018

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"
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?

Thank you

	[[alternative HTML version deleted]]

More information about the R-sig-mixed-models mailing list