Null deviance
Topic of Paired comparisons, and how far a fit is from the data, part of Generalised linear models
Null deviance
| Type | Topic |
| Taught in | Paired comparisons, and how far a fit is from the data |
| Part | Generalised linear models |
| Questions using it | 2 |
The deviance of the intercept-only model. The drop from the null deviance to the residual deviance measures how much the covariates explain, and is tested on the difference in degrees of freedom.
In Paired comparisons, and how far a fit is from the data
Sex drops out, as we already found. Cholesterol alone, three links:
chol_file <- "data/cholest.csv"
if (!file.exists(chol_file)) {
stop("Could not find data/cholest.csv. Set the working directory to the folder that contains it.")
}
chol <- read.csv(chol_file)
for (lnk in c("logit", "probit", "cloglog")) {
fit <- glm(disease ~ cholesterol, data = chol, family = binomial(link = lnk))
cat(lnk, "null", fit$null.deviance, "on", fit$df.null, "df,",
"residual", fit$deviance, "on", fit$df.residual, "df,",
"AIC", AIC(fit), "\n")
}binomial logit: null 137.63 on 99 df, residual 114.04 on 98 df, AIC 118.04
binomial probit: null 137.63 on 99 df, residual 114.12 on 98 df, AIC 118.12
binomial cloglog: null 137.63 on 99 df, residual 111.90 on 98 df, AIC 115.90
The null deviance does not depend on the link. It is the intercept-only model, one probability for everyone. Logit and probit are not separable on this sample.
In Figure the solid and dashed curves sit on each other. Complementary log-log has the smaller deviance and the smaller AIC. It rises more slowly and then more steeply, and it picks up the high-cholesterol ones a little better. We cannot test that improvement. The models are not nested. There is no constraint on the logit coefficients that turns the fitted curve into a probit.
Used in
- Taught in Paired comparisons, and how far a fit is from the data
- Also used in Logistic regression
- Questions that use it (2) — Q34 · Question 19
- All 4 questions on Paired comparisons, and how far a fit is from the data
See also
Deviance · Residual deviance · Scaled deviance · Saturated model · Deviance residual · Explanatory variable · Degrees of freedom · Bradley–Terry model · Three links, one cholesterol slope