I have been playing around with over-dispersion in binomial data and looking into qausi-binomial models as a solution. When comparing binomial models through the change in deviance, I can reproduce the p-value for the test-statistic using pchi(deviance_change, df)
. However, in a similar quasi-binomial comparison where the change of deviance and df are the same, the p-value is different.
I vaguely understand that quasi-approaches don't strictly have likelihood functions, but could someone explain how the change in model deviance between two candidate models is being used in the Chi-squarred test?
An example is below.
# some binomial data
x <- 1:5
yb1 <- matrix(c(4, 4, 5, 7, 8, 6, 6, 5, 3, 2), ncol = 2)
## binomial model
mb0 <- glm(yb1 ~ 1, family = binomial)
mb1 <- glm(yb1 ~ x, family = binomial)
anova(mb1, mb0, test='LRT')
Analysis of Deviance Table
Model 1: yb1 ~ x
Model 2: yb1 ~ 1
Resid. Df Resid. Dev Df Deviance Pr(>Chi)
1 3 0.5243
2 4 5.5842 -1 -5.0599 0.02449 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
## quasibinomial model
mqb0 <- glm(yb1 ~ 1, family = quasibinomial)
mqb1 <- glm(yb1 ~ x, family = quasibinomial)
anova(mqb1, mqb0, test='LRT')
Analysis of Deviance Table
Model 1: yb1 ~ x
Model 2: yb1 ~ 1
Resid. Df Resid. Dev Df Deviance Pr(>Chi)
1 3 0.5243
2 4 5.5842 -1 -5.0599 8.325e-08 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1