Skip to content
Back to formatted view

Raw Message

Message-ID: <CAOE=hqKtHUZWxY-qR=BC_EgUzfZF6WFBVhgJVTU65WvGg0XW-w@mail.gmail.com>
Date: 2018-05-11T12:50:51Z
From: Yashree Mehta
Subject: Syntax for adding group-level predictors

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?

Thank you

	[[alternative HTML version deleted]]