[R-sig-ME] P-value associated to explanatory from glmer binomial family

Thierry Onkelinx thierry@onkelinx @ending from inbo@be
Thu May 24 10:55:32 CEST 2018


Dear Mario,

Calculating the degrees of freedom of a mixed model is not straightforward.

A workaround would be to use a likelihoodratio test between two nested
models: one with and one without the variable. See the example below.

library(lme4)
gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
              data = cbpp, family = binomial)
anova(gm1)
gm0 <- glmer(cbind(incidence, size - incidence) ~ (1 | herd),
              data = cbpp, family = binomial)
anova(gm1, gm0)


Best regards,


ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx at inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>

2018-05-23 13:14 GMT+02:00 Mario Garrido <gaiarrido at gmail.com>:

> Dear lme4-users,
> I am trying to get the P-value associated with a glmer model from the
> binomial family.
> My model is the following:
> glmer(Infection.status~origin+ (1|donationID), family=binomial)->q7H
>
> where Infection status is a dummy variable with two levels, infected and
> uninfected
> I tried to get the P-value associated to the the explanatory variable
> origin
> but I get only the F-value and the degrees of freedom
>
> (aov <- anova(q7H))
> Analysis of Variance Table
>          Df Sum Sq Mean Sq F value
> origin   2 5.3061  2.6531  2.6531
>
> I have 2 different questions
> 1. Am I doing correctly or am I using an incorrect command?
>
> 2. with the F-value I get and the df, should I go to test the significance
> to a F or Chi-squared table? I guess I should go to the latest since I am
> running a binomial test, right?
> In case I have to go to an F table, how can I know the numerator and
> denominator degrees of freedom?
>
> Thanks in advance
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list