[R] package lme4
Douglas Bates
bates at stat.wisc.edu
Tue Nov 3 19:52:54 CET 2009
On Tue, Nov 3, 2009 at 8:08 AM, wenjun zheng <wjzheng09 at gmail.com> wrote:
> Thanks,Douglas,
> It really helps me a lot, but is there any other way if I want to show
> whether a random effect is significant in text file, like P value or other
> index.
> Thanks very much again.
> Wenjun.
Well there are p-values from the likelihood ratio tests in that
transcript I sent.
The point of those tests is that a p-value can only be calculated when
you know both the null hypothesis and the alternative, which is why
those p-values are the result of comparing two nested model fits.
> 2009/11/2 Douglas Bates <bates at stat.wisc.edu>
>>
>> On Sun, Nov 1, 2009 at 9:01 AM, wenjun zheng <wjzheng09 at gmail.com> wrote:
>> > Hi R Users,
>> > When I use package lme4 for mixed model analysis, I can't
>> > distinguish
>> > the significant and insignificant variables from all random independent
>> > variables.
>> > Here is my data and result:
>> > Data:
>> >
>> >
>> > Rice<-data.frame(Yield=c(8,7,4,9,7,6,9,8,8,8,7,5,9,9,5,7,7,8,8,8,4,8,6,4,8,8,9),
>> > Variety=rep(rep(c("A1","A2","A3"),each=3),3),
>> > Stand=rep(c("B1","B2","B3"),9),
>> > Block=rep(1:3,each=9))
>> > Rice.lmer<-lmer(Yield ~ (1|Variety) + (1|Stand) + (1|Block) +
>> > (1|Variety:Stand), data = Rice)
>> >
>> > Result:
>> >
>> > Linear mixed model fit by REML
>> > Formula: Yield ~ (1 | Variety) + (1 | Stand) + (1 | Block) + (1 |
>> > Variety:Stand)
>> > Data: Rice
>> > AIC BIC logLik deviance REMLdev
>> > 96.25 104.0 -42.12 85.33 84.25
>> > Random effects:
>> > Groups Name Variance Std.Dev.
>> > Variety:Stand (Intercept) 1.345679 1.16003
>> > Block (Intercept) 0.000000 0.00000
>> > Stand (Intercept) 0.888889 0.94281
>> > Variety (Intercept) 0.024691 0.15714
>> > Residual 0.666667 0.81650
>> > Number of obs: 27, groups: Variety:Stand, 9; Block, 3; Stand, 3;
>> > Variety, 3
>>
>> > Fixed effects:
>> > Estimate Std. Error t value
>> > (Intercept) 7.1852 0.6919 10.38
>>
>> > Can you give me some advice for recognizing the significant variables
>> > among
>> > random effects above without other calculating.
>>
>> Well, since the estimate of the variance due to Block is zero, that's
>> probably not one of the significant random effects.
>>
>> Why do you want to do this without other calculations? In olden days
>> when each model fit involved substantial calculations by hand one did
>> try to avoid fitting multiple models but now that is not a problem.
>> You can get a hint of which random effects will be significant by
>> looking at their precision in a "caterpillar plot" and then fit the
>> reduced model and use anova to compare models. See the enclosed
>>
>> > Any suggestions will be appreciated.
>> > Wenjun
>> >
>> > [[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