Three links, one cholesterol slope
Section of Paired comparisons, and how far a fit is from the data, part of Generalised linear models
Three links, one cholesterol slope
| Type | Section |
| Taught in | Paired comparisons, and how far a fit is from the data |
| Part | Generalised linear models |
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
See also
Bradley–Terry model · Deviance · Analysis of deviance · Residuals in a GLM · Saturated model · Residual deviance · Null deviance · Scaled deviance