Chapter 4 · Statistical Predictive Models
Section 4.4 · Chapter 4 · Learning Statistics with Python
Statistical Predictive Models
Prof. Xuhu Wan
ISOM, HKUST Business School · 2026 Edition
Everything so far answered “given \(x\), what is \(y\)?”. A manager asks “if I change \(x\), what happens to \(y\)?”. You will build a case where the best predictor is a useless lever, fix it with a control, and then meet two designs for when the control is not observed.
“Borrowers who use our budgeting tool repay 20 % more.” Which action needs a causal answer?
Potential outcomes: each borrower has \(Y(1)\) with the tool and \(Y(0)\) without; we see one. The observed gap is \(\underbrace{E[Y(1)-Y(0)\mid T=1]}_{\text{causal}} + \underbrace{E[Y(0)\mid T=1] - E[Y(0)\mid T=0]}_{\text{selection bias}}\).
Simulate a hidden trait \(U\) (financial discipline) that drives both tool adoption \(T\) and repayment \(Y\). By construction the tool has zero effect.
Coefficient 2.17 with t = 24 and R² = 0.23. As a predictor of repayment, tool usage is excellent. As a policy, pushing the tool would move repayment by exactly 0.
Add \(U\) as a second regressor. The coefficient on \(T\) will:
Adjusted: 0.066 (truth 0). With a real effect of 0.5, naive says 2.67, adjusted says 0.45. This works only because \(U\) was measured. Draw the graph \(T \leftarrow U \rightarrow Y\) first; include confounders, never mediators or colliders.
U (unobserved)
/ \
v v
T -> Y
Treated group gets a policy between period 0 and 1; the control group does not. \[\hat\tau_{\text{DiD}} = (\bar Y^{\text{tr}}_{1} - \bar Y^{\text{tr}}_{0}) - (\bar Y^{\text{ctl}}_{1} - \bar Y^{\text{ctl}}_{0})\]
The identifying assumption of DiD is:
Treated group starts 1.0 higher, everyone drifts up 0.5, and the policy adds 0.8 to the treated group in period 1.
Both naive numbers are wrong: the post gap (1.85) includes the pre-existing level difference; the before-after (1.31) includes the common drift.
did currently holds the treated group’s before-after change. Subtract the control group’s change so that did is the difference-in-differences.
The regression \(y = \alpha + \beta\,\text{group} + \gamma\,\text{period} + \delta\,(\text{group} \times \text{period})\) gives \(\hat\delta\) = 0.861 (se 0.051) — identical to the hand calculation, now with a standard error. Parallel trends cannot be tested after treatment; with more pre-periods, check that the two groups moved in parallel before it.
An instrument \(Z\) moves \(T\) but touches \(Y\) only through \(T\). Three conditions: relevance (\(Z \to T\)), exclusion (no \(Z \to Y\) path except via \(T\)), independence (\(Z \perp U\)).
Which condition can never be verified from the data alone?
Classic instruments: distance to college for schooling (Card 1995), draft-lottery number for military service (Angrist 1990), rainfall for agricultural income. Two-stage least squares: regress \(T\) on \(Z\), then \(Y\) on \(\hat T\).
Hidden \(U\) drives \(T\) and \(Y\); true effect of \(T\) on \(Y\) is 1.0; \(Z\) is a clean shock to \(T\).
OLS says 2.013 — twice the truth, because \(U\) pushes \(T\) and \(Y\) the same way. 2SLS uses only the part of \(T\) that \(Z\) explains and lands on 1.027. The one-instrument case reduces to the ratio \(\text{cov}(Z,Y)/\text{cov}(Z,T)\).
Strong instrument: F = 637. Weak one: F = 7.0 and the 2SLS estimate drifts to 0.72 with a huge standard error. Rule of thumb: first-stage F above 10, or do not trust the second stage.
| Design | Replaces the missing control with | Fails when |
|---|---|---|
| Regression adjustment | the measured confounder | a confounder is unmeasured |
| Difference-in-differences | a control group’s time trend | trends are not parallel |
| Instrumental variables | an exogenous shock to \(T\) | \(Z\) is weak or has its own path to \(Y\) |
Prof. Xuhu Wan · HKUST ISOM · Learning Statistics with Python