[R] Hierarchical Linear Model using lme4's lmer

Doug Adams fog0 at gmx.com
Sun Jan 17 06:34:21 CET 2010


Hehe (about the kitchen sink)
Thanks very much to all three of you.




Douglas Bates-2 wrote:
> 
> On Sat, Jan 16, 2010 at 8:20 AM, Walmes Zeviani
> <walmeszeviani at hotmail.com> wrote:
>>
>> Doug,
>>
>> It appears you are mixing nlme and lme4 formulation type.
>> On nlme library you type
>>
>> lme(y~x, random=~1|subjetc)
>>
>> On lme4 library you type
>>
>> lmer(y~x+(1|subject))
>>
>> You mixed them.
>>
>> At your disposal.
> 
> Which is what I tell my wife when I am standing by our sink.
> 
>> Walmes.
>>
>>
>> Doug Adams wrote:
>>>
>>> Hi,
>>>
>>> I was wondering:  I've got a dataset where I've got student 'project's
>>> nested within 'school's, and 'division' (elementary, junior, or
>>> senior) at the student project level.  (Division is at the student
>>> level and not nested within schools because some students are
>>> registered as juniors & others as seniors within the same school.)
>>>
>>> So schools are random, division is fixed, and the student Score is the
>>> outcome variable.  This is what I've tried:
>>>
>>> lmer(data=Age6m, Score ~ division + (1|school), random=~1 | school)
>>>
>>> Am I on the right track?  Thanks everyone,   :)
>>>
>>> Doug Adams
>>> MStat Student
>>> University of Utah
> 
> Walmes is correct that this is mixing two formulations of the model.
> It turns out that the model will be fit correctly anyway.  The lmer
> function has a ... argument which will silently swallow the argument
> random = ~ 1|school and ignore it.  Looks like we should add a check
> for specification of a random argument and provide a warning if it is
> present.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 


-----
Doug Adams
MStat Student
University of Utah
-- 
View this message in context: http://n4.nabble.com/Hierarchical-Linear-Model-using-lme4-s-lmer-tp1015485p1015916.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list