Section Progress
0% Complete

Logistic regression: the basics

Logistic regression is a statistical model used when you have a binary (or categorical) outcome (e.g., present/absent). It aims to model the relationship between one or multiple predictors (continuous, binary or nominal variables) with the binary outcome. The aim of any regression method is to get a linear equation that explains the outcome. To do so, we need to transform the binary outcome into a continuous variable, which can take any value from negative infinity to positive infinity. In the case of logistic regression, we use the log odds or logit. The odds of an event are the ratio of probability that the event occurs over the probability that the event will not occur, which can take any value between zero and infinity. The normal logarithmic function of the odds (logit) can take any value between negative to positive infinity. In linear regression, we use the method of least squares to estimate the equation coefficients. In logistic regression, we use the maximum likelihood, which estimates the coefficients that will maximize the probability of the observed data (i.e., coefficients that will result in predicted probabilities closest to observed probabilities).

Odds and odd ratio calculations

Odds and odds ratio

Estimating propensity score with logistic regression

Remember that a propensity score is an individual’s probability of receiving the treatment given their set of baseline characteristics.1 It’s usually estimated using a logistic regression where the outcome is treatment status and predictors are all confounders that we can measure. It’s important to keep in mind that we need to be able to measure the confounders for us to adjust for them in the propensity score. Other methods can also be used to estimate propensity score, but we will focus on logistic regression estimation in this module. So after using the logistic regression to estimate propensity score, we now know each individual’s probability of receiving the treatment (i.e., their PS), which can then be used as a balancing score to make the treatment/exposure groups similar in terms of the baseline characteristics/confounders.

Exercise 1 – Estimating PS with logistic regression