4/12
Part 2 of 7 · ControlsLearn and do
The omitted variable bias formula says how far off you were
Gelman and Hill show how to quantify the bias from leaving out one confounder. The coefficient without it equals the true one plus two links multiplied together: the confounder's effect on the outcome, and how much the confounder moves with the treatment.
# how much more tenure comes with each discount point
delta = ols([discount], tenure)[1]
print(f"naive {b[1]:.2f} - adjusted {b2[1]:.2f} = {b[1] - b2[1]:.2f}")
print(f"tenure's effect x tenure per discount point = {b2[2]:.2f} x {delta:.3f} = {b2[2] * delta:.2f}")
naive 4.62 - adjusted 1.51 = 3.10
tenure's effect x tenure per discount point = 7.81 x 0.397 = 3.10
When does leaving out a variable cause no bias at all?
Pick an answer above to see the rest