1
$\begingroup$

I use glmer to model my data:

m1<-glmer(ambulation~ trt + test + trt:test
          +(1|calf),
          family=poisson(link="log"),
          data= data)
summary(m1)

ambulation is a count variable (integer), trt, test, and calf are factors. I get:

Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: poisson  ( log )
Formula: ambulation ~ trt + test + trt:test + (1 | calf)
Data: data

    AIC      BIC   logLik deviance df.resid 
 2525.1   2541.1  -1255.6   2511.1       65 

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-12.0392  -3.6718   0.1672   3.5336  14.2978 

Random effects:
Groups Name        Variance Std.Dev.
calf   (Intercept)  0.2746   0.524   
Number of obs: 72, groups:  calf, 24

Fixed effects:
                 Estimate Std. Error z value Pr(>|z|)    
(Intercept)       4.78214    0.15344  31.166  < 2e-16 ***
trtmother         0.13612    0.21685   0.628   0.5302    
testNO            0.13540    0.03282   4.126 3.69e-05 ***
testOF            0.36235    0.03122  11.605  < 2e-16 ***
trtmother:testNO -0.11084    0.04710  -2.353   0.0186 *  
trtmother:testOF -0.32936    0.04595  -7.167 7.64e-13 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) trtmth testNO testOF trt:NO
trtmother   -0.708                            
testNO      -0.114  0.081                     
testOF      -0.120  0.085  0.561              
trtmthr:tNO  0.080 -0.113 -0.697 -0.391       
trtmthr:tOF  0.082 -0.116 -0.381 -0.679  0.533

If I run anova(m1) instead of summary(m1) I get:

> anova(m1)
Analysis of Variance Table
         Df Sum Sq Mean Sq F value
trt       1  0.024   0.024  0.0238
test      2 89.561  44.780 44.7805
trt:test  2 54.305  27.153 27.1525
> 

How to get a report like anova(m1) but with associated p-values?

$\endgroup$
2
  • $\begingroup$ Have you tried using the Anova() function from the car package instead of the anova() function from base R? See also stats.stackexchange.com/questions/223626/…, which suggests that anova(model, test="Chisq") should produce a p-value. $\endgroup$ – Isabella Ghement Apr 1 '19 at 15:27
  • $\begingroup$ I edited your post by adding 4 white spaces in front of each line of R output. In the future, you can use this trick yourself to make sure your R output is readable. $\endgroup$ – Isabella Ghement Apr 1 '19 at 15:50
0
$\begingroup$

Not sure this is the most elegant way of doing this, but you can compare nested models (e.g. m2 would be the same model without one of the factors you're trying to estimate). Then you run anova(m1,m2). You can estimate the main effect of the missing predictor to the overall fit of the model. You'd report it as: χ²(Df)=Chisq, p=pvalue. See: https://verbingnouns.github.io/notebooks/prose_statistics.nb.html

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.