Odds ratio
Topic of Introduction to generalised linear models, part of Generalised linear models · Also in Three species on one hillside, Categorical responses
Odds ratio
| Type | Topic |
| Taught in | Introduction to generalised linear models · Three species on one hillside · Categorical responses |
| Part | Generalised linear models · Correlated data |
| Questions using it | 6 |
The ratio of the odds of an event in two groups. In a logistic regression e^{\beta_j} is the odds ratio for a one-unit increase in x_j, the same at every value of the other covariates when x_j has no interaction terms. An odds ratio of 1 means no association.
In Introduction to generalised linear models
Two covariates are enough. If you can say what \beta_1 and \beta_2 mean here, you can say it for twenty: \log\frac{p}{1-p}=\beta_0+\beta_1 x_1+\beta_2 x_2. Hold x_2 fixed and increase x_1 by one unit. The log-odds increase by \beta_1. Equivalently, the odds p/(1-p) are multiplied by e^{\beta_1}. The same sentence with the labels swapped is the interpretation of \beta_2. Log-odds are not a quantity anyone should be expected to feel. Odds are usually as far as a collaborator needs to go: “the odds of disease are multiplied by e^{\beta_1}.”
The intercept is the log-odds when every covariate is zero, and p=\frac{e^{\beta_0}}{1+e^{\beta_0}} is the corresponding probability. That baseline is meaningful only when setting every covariate to zero is a real, or at least a hypothetical, situation. Otherwise it is an algebraically correct description of a point off the edge of the data.
In Three species on one hillside
Each margin is a logistic regression with its own intercept and its own slope on altitude: \mathrm{P}(Y_k=1\mid \text{altitude}) =\frac{\exp(\beta_{k0}+\beta_{k1}\,\text{altitude})}{1+\exp(\beta_{k0}+\beta_{k1}\,\text{altitude})}, and the working variance is the Bernoulli variance \mu_k(1-\mu_k). The working association between each pair is a log odds ratio: the odds of finding species k when species k' is present, divided by the odds of finding species k when species k' is absent. That is a two-way interaction. A three-way odds ratio, all three plants at once, can be written down but has no clear interpretation, so the working model stops at pairs. Any three species on a hillside do interact as a triple. The working model is therefore wrong. It does not have to be right for the slopes, once the sandwich standard errors are used.
In Categorical responses
Replacing the logit by the complementary log-log gives a proportional-hazards model, \log\bigl(-\log(1-\gamma_k)\bigr)=\beta_{0k}+{\boldsymbol{x}}^\top\boldsymbol{\beta}, with the same parallel-slope constraint and the same ordering of intercepts. The coefficient is a log hazard, not a log odds ratio. We can say what an odds ratio is. A hazard is a definition we can write down and a quantity we cannot usually explain. The call that forces the cumulative, reversed, parallel, complementary-log-log model is
need <- function(pkg) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg, repos = "https://cloud.r-project.org")
}
suppressPackageStartupMessages(library(pkg, character.only = TRUE))
}
need("VGAM")
data(pneumo, package = "VGAM")
pneumo$none <- pneumo$normal
pneumo$x <- log(pneumo$exposure.time)
fit <- vglm(cbind(none, mild, severe) ~ x,
family = cumulative(reverse = TRUE, parallel = TRUE, link = "cloglog"),
data = pneumo)
summary(fit)
deviance(fit)
logLik(fit)and it returns intercepts -8.60 and -9.35, with slope 2.21 (z=7.06). The residual deviance is 6.65 against 5.03 for the proportional-odds fit, and the log-likelihood is -25.90 against -25.09. The odds model fits this table a little better. The two models are not nested, so that comparison is not a likelihood-ratio test. It is the same kind of absolute comparison as an AIC when the parameter count matches, which here it does.
Used in
- Taught in Introduction to generalised linear models · Three species on one hillside · Categorical responses
- Also used in Categorical responses · Logistic regression · Random slopes, and a binary mixed model · Marginal models, and two responses at once · Three species on one hillside
- Questions that use it (6) — Odds ratios · Q35 (answer) · Q40 · Q53 (answer) · Question 20 (answer) · Question 21 (answer)
- All 9 questions on Introduction to generalised linear models
See also
Binary logistic regression · Interpreting a logistic regression · Logit link · Odds · Explanatory variable · Interaction · Proportional-hazards model · Exponential family