[R-sig-ME] Significance of fixed factors using glmer

Ben Bolker bbolker at gmail.com
Thu Dec 21 15:01:39 CET 2017


Julia: that's interesting, but can you be more specific? I *never* get
p-values with a single-argument anova(),
but I do get p-values with car::Anova or other methods suggested below:

[1] lmerTest_2.0-36 afex_0.18-0     lsmeans_2.27-61 lme4_1.1-15
[5] Matrix_1.2-12

  Suggestions for improving the text in ?lme4::pvalues will be warmly
appreciated.

  cheers
   Ben Bolker




library(afex)
library(lmerTest)
library(car)
data("cbpp",package="lme4")
g1 <- glmer(cbind(incidence, size-incidence) ~ period + (1|herd),
    family=binomial,data=cbpp)
lme4:::anova.merMod(g1) ## no p-values
anova(g1)  ## from lmerTest: no p-values
find("anova")
## [1] "package:lmerTest" "package:stats"
summary(g1) ## Wald p-values
Anova(g1)  ## Wald (type II) p-values
drop1(g1,test="Chisq")
mixed(cbind(incidence, size-incidence) ~ period + (1|herd),
      family=binomial,data=cbpp, method="LRT")
sessionInfo()




On Thu, Dec 21, 2017 at 5:03 AM, Julia Chacon Labella
<juliachacon at gmail.com> wrote:
> Hi Silvia,
>
> If you have previously loaded other packages like afex package, then
> lmerTest cannot work properly and does not give you the p-values.
> Try to detach the other packages if it is the case, and let see if it works
> now.
>
> Example: detach("package:afex", unload=TRUE)
>
> Or...you can restart your R session and load only the packages you need.
> But I would try detach first.
>
> Hope it works!
> Julia
>
>
> 2017-12-20 15:43 GMT+01:00 Fox, John <jfox at mcmaster.ca>:
>
>> Dear Silvia,
>>
>> Both lmerTest::anova() and car::Anova() print p-values, so you'll have to
>> provide more information -- ideally a reproducible example demonstrating
>> the problem, or at least the problematic output with p-values absent.
>>
>> 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 Silvia Matesanz García
>> > Sent: Wednesday, December 20, 2017 5:06 AM
>> > To: r-sig-mixed-models at r-project.org
>> > Subject: [R-sig-ME] Significance of fixed factors using glmer
>> >
>> > Hi all
>> >
>> > I m fitting a model where the response variable is Flowering (0, the
>> plant didn t
>> > flower; 1, the plant did flower). I m using glmer with a binomial
>> distribution. I
>> > m trying to obtain the significance of fixed factors. I ve tried
>> lmerTest:anova
>> > and car:Anova but neither seem to provide p-values.
>> >
>> > Is there a way to do this?
>> >
>> >
>> >
>> > Thanks!
>> >
>> >
>> >
>> > ------------------------------------------------------------
>> ----------------
>> > -------
>> >
>> > Dra. Silvia Matesanz
>> >
>> > Investigadora Ram n y Cajal.
>> >
>> >  rea de Biodiversidad y Conservaci n.
>> >
>> > Universidad Rey Juan Carlos
>> >
>> >  <http://silviamatesanzgarc.wix.com/silviamatesanz>
>> > http://silviamatesanzgarc.wix.com/silviamatesanz
>> >
>> >  <https://scholar.google.es/citations?user=6xRDyPAAAAAJ&hl=es>
>> > https://scholar.google.es/citations?user=6xRDyPAAAAAJ&hl=es
>> >
>> >
>> >
>> >
>> >       [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>
>
> --
> Julia
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> 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