6/36
Part 2 of 6 · The estimateLearn
After-only and before-and-after each look causal, and each keeps a bias
Two comparisons look causal and aren't. Interviewers want to hear you reject them and say why.
def easy_answers(y, treated, post):
def mean(t, p):
return y[(treated == t) & (post == p)].mean()
after_only = mean(1, 1) - mean(0, 1)
own_change = mean(1, 1) - mean(1, 0)
return after_only, own_change
for name, data in [("worked example", worked_example()),
("practice panel", panel())]:
a, b = easy_answers(*data[:3])
print(f"{name}: after only {a:5.2f} treated's change {b:5.2f}")
Which easy comparison still carries the gap that existed before launch?
Pick one to see what it prints.
Pick an answer above to see the rest