Skip to content
Back to formatted view

Raw Message

Message-ID: <ACD1644AA6C67E4FBD0C350625508EC836BA4B38@FHSDB2D11-2.csu.mcmaster.ca>
Date: 2019-05-07T17:49:39Z
From: John Fox
Subject: A consultation about DF of the result of lmer
In-Reply-To: <15858_1557246694_x47GVXNA004405_8b3d3fe4-ab47-ea83-e2c2-ffc1d77f0488@gmail.com>

Dear Rumeng He,

For what it's worth, my guess is the same as Ben's. If we're wrong, then you'll have to send more information about what you did, ideally including a reproducible example of the problem.

Best,
 John

--------------------------------------
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: socialsciences.mcmaster.ca/jfox/



> -----Original Message-----
> From: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces at r-
> project.org] On Behalf Of Ben Bolker
> Sent: Tuesday, May 7, 2019 12:31 PM
> To: r-sig-mixed-models at r-project.org
> Subject: Re: [R-sig-ME] A consultation about DF of the result of lmer
> 
>    It's very hard to say without more information (try e.g. here
> <https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-
> reproducible-example>
> or look at other posts in the list archive
> <https://stat.ethz.ch/pipermail/r-sig-mixed-models/>
> 
>   A first guess is that you have a fixed-effect predictor that's
> supposed to be a factor with 6 levels, but is actually being interpreted
> as a numeric variable.  If that's the case, then either changing it
> within the data set
> 
>   mydata$pred1 <- factor(mydata$pred1)
> 
> or doing it on the fly in your  model
> 
>   lmer(response ~ factor(pred1) + ...)
> 
> should fix the problem.
> 
> 
> On 2019-05-05 9:11 p.m., ??? wrote:
> > Dear,
> > I am a graduated student who's topic is  ecology. Recently, I am
> studying how to establish a liner mixed model to exclude the error
> caused by the difference of site by using lme4 in R. I found  when I
> calculated p value by using the function of "Anova" of car package the
> Df is 1. But in fact the data set has 6 levels. Then I also operate
> according to the code of reference PDF of lme4 in P52(lmer) without any
> change. When run "anova(fm1, fm2)" I found the Df of fm1 also is 1. As I
> see if the Df is wrong the p value would be wrong either. I want to know
> how to correct my wrong. I will very appreciate your reply.
> >
> >
> > Best regards,
> > Rumeng He
> > 	[[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-models at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models