Skip to content
Prev 3219 / 20628 Next

Science Fair data

On Mon, Jan 25, 2010 at 9:41 PM, Doug Adams <dougadams53 at gmail.com> wrote:
Well, actually it doesn't.  If you tried that it would fail because
there is no addition operator for factors.
In this model the effects of the district and the school are modeled
with random effects.  The model specification is equivalent to

 lmer(score ~ division + (1|district) + (1|school:district), Age6m)

and, if the levels of school are distinct (i.e. you don't have a
school 1 in both district 1 and district 2 or something like that),
then the specification is equivalent to

lmer(score ~ division + (1|district) + (1|school), Age6m)
In this model the effect of the school is modeled by random effects
but the effect of the district is modeled by fixed-effects parameters.

The choice of fixed effects or random effects depends on the structure
of the data and the type of inferences you wish to make.  If you have
data from only some of the school districts and you wish to form
conclusions about a generic district then random effects are
preferred.  If you have data from all districts and you want to reach
conclusions only about those specific districts then fixed effects are
preferred.  If you want to consider how the variability in the
responses splits into student-to-student variability and
school-to-school variability and district-to-district variability then
random effects are preferred.