[R-sig-ME] Science Fair data
Douglas Bates
bates at stat.wisc.edu
Wed Jan 27 16:07:59 CET 2010
On Tue, Jan 26, 2010 at 10:10 PM, Doug Adams <fog0 at gmx.com> wrote:
> I appreciate that, both of you (& that's ok for the mistake Christopher) :)
> So fixed factors as simply listed by themselves (no 1| notation) and
> random effects are listed with appropriate nesting... I do want to
> consider schools as random effects; that will give me the information
> I'd like to have about the variability (and reliability too?) of the
> schools as they fit into the big picture.
> When I use fixef & ranef to extract estimates for division and schools
> (& maybe districts eventually too now), am I right in thinking that
> the 3 numbers given for each level of division (fixef) are the
> intercepts for each level -- as if there were individual OLS
> regressions performed for each?
Not quite. They should be labeled "(Intercept)" and something like
division2 and division 3. (By the way, it helps if you quote the
output when you want to discussion what particular values mean.) The
(Intercept) coefficient represents the prediction at the first level
of the division factor. The next two coefficients are the change from
the first to the second level and from the first to the third level.
> And are the random effects for the
> schools (ranef) are the slopes associated with those regression lines?
>
> Thanks again everyone :)
>
> Doug
>
>
>
>
>>>>
>>>> What's the difference between
>>>> listing your factors as:
>>>>
>>>>
>>>> lmer(score ~ division + (1|district/school), data=Age6m)
>>>>
>>>
>>> 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)
>>>
>>>>
>>>> and
>>>> lmer(score ~ division + (1|school) + district, data=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.
>>>
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list