liveBook · Manning

Logistic regression

As explained in Causal Inference for Data Science

Logistic regression is a statistical model that estimates the probability of a categorical, often binary, outcome using a logistic function of input variables.

Logistic regression estimates the probability of a categorical, often binary, outcome from input variables through a logistic function. In causal analysis, it commonly predicts whether a patient received treatment from measured confounders, producing propensity scores rather than only 0-or-1 labels. section 5.3.2

A practical propensity-score workflow is:

  • Organize one patient per row, with treatment T as a binary variable and confounders C1 through Cp as the remaining columns. section 5.3.2
  • Fit a classifier such as logistic regression to estimate the probability that treatment equals 1 for each patient. section 5.3.2
  • Compare alternative predictive models with cross-validation, and evaluate probability predictions with AUC rather than accuracy when ranking matters. section 5.3.2

A confounded treatment decision

Suppose a confounder Z affects treatment X and outcome Y. The probability of X = 1 is calculated with a logistic regression model whose probability depends on Z; X is then sampled from a Bernoulli distribution. This synthetic setup separates treatment assignment from the outcome’s effect and helps expose failures in causal estimation, such as an S-learner returning an ATE of zero. section 4.2.4

Table 5.1 Table describing whether each patient was treated (variable T) and their description in terms of confounders (C1, …, Cp)
T
C 1
…
Cp
t 1
c 1 1
…
c 1 p
…
…
…
…
t n
c n 1
…
c n p

Use the patient-by-treatment-and-confounder table to inspect the data structure required for propensity-score modeling. section 5.3.2

How Causal Inference for Data Science covers it

How deep it goes
Explains binary probability prediction, model comparison, cross-validation, and AUC, while stopping short of detailed coefficient interpretation.
Examples
Uses a patient treatment table and synthetic variables where confounder Z influences binary treatment X and outcome Y.
What it assumes
Assumes binary treatment data and measured confounders organized by patient, while introducing probability prediction for propensity scores.
What you can do after
Apply it to estimate each patient’s probability of receiving treatment and compare the resulting classifier with alternatives.
How it connects
Connects propensity scores with confounders, machine learning classifiers, cross-validation, AUC, and causal effect estimation.

Also explained in

Compare how 12 books explain logistic regression →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal Inference for Data Science. The section links point to the parts of the book it draws on.