[R] Random slopes in lmer
Samantha Patrick
samantha.patrick at plymouth.ac.uk
Thu Aug 26 17:57:06 CEST 2010
Hi
Thanks for your help - however if I have a model of:
mod1<-lmer(B~ A+C+(A|bird), family=quasibinomial)
coef then gives me an individual slope for factors A and C. However the random effect is only nested within factor - so I am only trying to allow the slope to vary in relation to effect A
Many Thanks
Sam
Dr Samantha Patrick
EU INTERREG Post Doc
Davy 618
Marine Biology & Ecology Research Centre
University of Plymouth
Plymouth
PL4 8AA
T: 01752 586165
M: 07740472719
-----Original Message-----
From: Darin A. England [mailto:england at cs.umn.edu]
Sent: 26 August 2010 16:12
To: Samantha Patrick
Cc: r-help at R-project.org
Subject: Re: [R] Random slopes in lmer
coef(mod1)$bird will give you a matrix with two columns. The first
column is the intercept for each bird and the second column is the
slope for each bird.
ranef(mod1) will also give you a matrix of two columns. These
represent the random effects. That is, how much the intercept (or
slope) is shifted from overall mean.
HTH,
Darin
On Thu, Aug 26, 2010 at 01:15:10PM +0100, Samantha Patrick wrote:
> Hi
>
> I want to extract the random slopes from a lmer (I am doing a random regression), but are the answers obtained from ranef or coef?
>
> My model is: mod1<-lmer(B~ A +(A|bird), family=quasibinomial)
>
> And I want to obtain a slope for each individual bird but am not sure which output I need and can't find the answer anywhere.
>
> Thanks
>
> Sam
>
>
> Dr Samantha Patrick
> EU INTERREG Post Doc
> Davy 618
> Marine Biology & Ecology Research Centre
> University of Plymouth
> Plymouth
> PL4 8AA
>
> T: 01752 586165
> M: 07740472719
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
More information about the R-help
mailing list