Professional Documents
Culture Documents
Rhoderick Machekano
March, 2010
Association
Unit Pretreat Treat Potential Treat Unit Pretreat Treat Potential Treat
i inputs indic ouctomes effect i inputs indic ouctomes effect
Xi Ti y0i y1i y1i − y0i Xi Ti y0i y1i y1i − y0i
1 1 50 0 69 75 6 1 1 50 0 69 ? ?
2 1 98 0 111 108 -3 2 1 98 0 111 ? ?
3 2 80 1 92 102 10 3 2 80 1 ? 102 ?
4 1 98 1 112 111 -1 4 1 98 1 ? 111 ?
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
100 1 104 1 111 114 3 100 1 104 1 ? 114 ?
We wish to compare a novel study program to a standard program of study on fourth graders. Outcome is a score on test at the
end of the year.
1
Source: Gelman & Hill
R. Machekano ( Center for Health Care Research and Policy
CausalDepartment
Inference of Medicine Case Western Reserve
March
University
2010 Cleveland
5 / 27
Fundamental Problem of Causal Inference1
Unit Pretreat Treat Potential Treat Unit Pretreat Treat Potential Treat
i inputs indic ouctomes effect i inputs indic ouctomes effect
Xi Ti y0i y1i y1i − y0i Xi Ti y0i y1i y1i − y0i
1 1 50 0 69 75 6 1 1 50 0 69 ? ?
2 1 98 0 111 108 -3 2 1 98 0 111 ? ?
3 2 80 1 92 102 10 3 2 80 1 ? 102 ?
4 1 98 1 112 111 -1 4 1 98 1 ? 111 ?
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
100 1 104 1 111 114 3 100 1 104 1 ? 114 ?
We wish to compare a novel study program to a standard program of study on fourth graders. Outcome is a score on test at the
end of the year.
1
Source: Gelman & Hill
R. Machekano ( Center for Health Care Research and Policy
CausalDepartment
Inference of Medicine Case Western Reserve
March
University
2010 Cleveland
5 / 27
Fundamental Problem of Causal Inference1
Unit Pretreat Treat Potential Treat Unit Pretreat Treat Potential Treat
i inputs indic ouctomes effect i inputs indic ouctomes effect
Xi Ti y0i y1i y1i − y0i Xi Ti y0i y1i y1i − y0i
1 1 50 0 69 75 6 1 1 50 0 69 ? ?
2 1 98 0 111 108 -3 2 1 98 0 111 ? ?
3 2 80 1 92 102 10 3 2 80 1 ? 102 ?
4 1 98 1 112 111 -1 4 1 98 1 ? 111 ?
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
100 1 104 1 111 114 3 100 1 104 1 ? 114 ?
We wish to compare a novel study program to a standard program of study on fourth graders. Outcome is a score on test at the
end of the year.
1
Source: Gelman & Hill
R. Machekano ( Center for Health Care Research and Policy
CausalDepartment
Inference of Medicine Case Western Reserve
March
University
2010 Cleveland
5 / 27
Fundamental Problem of Causal Inference1
Unit Pretreat Treat Potential Treat Unit Pretreat Treat Potential Treat
i inputs indic ouctomes effect i inputs indic ouctomes effect
Xi Ti y0i y1i y1i − y0i Xi Ti y0i y1i y1i − y0i
1 1 50 0 69 75 6 1 1 50 0 69 ? ?
2 1 98 0 111 108 -3 2 1 98 0 111 ? ?
3 2 80 1 92 102 10 3 2 80 1 ? 102 ?
4 1 98 1 112 111 -1 4 1 98 1 ? 111 ?
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
100 1 104 1 111 114 3 100 1 104 1 ? 114 ?
We wish to compare a novel study program to a standard program of study on fourth graders. Outcome is a score on test at the
end of the year.
1
Source: Gelman & Hill
R. Machekano ( Center for Health Care Research and Policy
CausalDepartment
Inference of Medicine Case Western Reserve
March
University
2010 Cleveland
5 / 27
Approaches to the fundamental problem of causal
inference
Non-randomized T
Not all studies can be
randomized
Units often end up treated
or not based on
characteristics that are
T Y
predictive of the outcome -
systematic differences
Solution is statistical
adjustments
X
1
1 Calculate weights wi = pr (Ti =t|Xi )
2 Perform a weighted regression of the outcome Y on exposure
variable T
3 Why does this work?
Creats a psuedo-population consisting of wi copies of unit i
In the pseudo-population, treatment T is unconfounded
The distribution of the counterfactuals in the pseudo-population is
the same as in the study population
1
1 Calculate weights wi = pr (Ti =t|Xi )
2 Perform a weighted regression of the outcome Y on exposure
variable T
3 Why does this work?
Creats a psuedo-population consisting of wi copies of unit i
In the pseudo-population, treatment T is unconfounded
The distribution of the counterfactuals in the pseudo-population is
the same as in the study population
1
1 Calculate weights wi = pr (Ti =t|Xi )
2 Perform a weighted regression of the outcome Y on exposure
variable T
3 Why does this work?
Creats a psuedo-population consisting of wi copies of unit i
In the pseudo-population, treatment T is unconfounded
The distribution of the counterfactuals in the pseudo-population is
the same as in the study population
1
1 Calculate weights wi = pr (Ti =t|Xi )
2 Perform a weighted regression of the outcome Y on exposure
variable T
3 Why does this work?
Creats a psuedo-population consisting of wi copies of unit i
In the pseudo-population, treatment T is unconfounded
The distribution of the counterfactuals in the pseudo-population is
the same as in the study population
1
1 Calculate weights wi = pr (Ti =t|Xi )
2 Perform a weighted regression of the outcome Y on exposure
variable T
3 Why does this work?
Creats a psuedo-population consisting of wi copies of unit i
In the pseudo-population, treatment T is unconfounded
The distribution of the counterfactuals in the pseudo-population is
the same as in the study population
1
1 Calculate weights wi = pr (Ti =t|Xi )
2 Perform a weighted regression of the outcome Y on exposure
variable T
3 Why does this work?
Creats a psuedo-population consisting of wi copies of unit i
In the pseudo-population, treatment T is unconfounded
The distribution of the counterfactuals in the pseudo-population is
the same as in the study population
Xi A A A B B B C C C
Y1i 1 1 1 2 2 2 3 3 3
Ti 1 0 0 1 1 1 1 1 0
1 2 2
πi 3
1 1 1 3 3
Ti
πi
3 0 0 1 1 1 1.5 1.5 0
> head(simdat)
+ tail(simdat)
covar y1 y0 treat outcome
1 0.08317643 1.650394 0.8060006 1 1.650394
2 0.82471339 3.546720 2.5126394 0 2.512639
3 0.98284952 4.650695 2.2191206 1 4.650695
4 0.91146710 3.433277 2.1412135 0 2.141214
5 0.81274144 3.584094 2.4440184 0 2.444018
6 0.71152091 4.019010 2.6391156 1 4.019010
covar y1 y0 treat outcome
45 0.16681624 2.558554 1.155048 1 2.558554
46 0.30581451 2.131925 1.416699 1 2.131925
47 0.49911482 2.943167 2.886796 1 2.943167
48 0.24429569 2.524773 1.514149 1 2.524773
49 0.08419395 1.004389 1.284473 1 1.004389
50 0.65493092 3.387608 2.819581 0 2.819581
1
pr (T = 1|w) = 1+exp −(1−2w)
We know the true propensity of treat i.e. the probability of receiving treatment or control
given the covariates
Calculate the weights
wt=ifelse(A==1,1/pa,1/(1-pa))
> head(nws)
age educ black married nodegree re75 re78 hisp treat educ_cat4
1 42 16 0 1 0 0.000 100.4854 0 0 4
2 20 13 0 0 0 3317.468 4793.7451 0 0 3
3 37 12 0 1 0 22781.855 25564.6699 0 0 2
4 48 12 0 1 0 20839.355 20550.7441 0 0 2
5 51 12 0 1 0 21575.178 22783.5879 0 0 2
6 18 11 0 0 1 1455.532 2157.4807 0 0 1
There are systematic differences between subjects exposed to the job training
program compared to those not exposed
> nws.unadjusted=glm(re78˜treat)
> display(nws.unadjusted)
glm(formula = re78 ˜ treat)
coef.est coef.se
(Intercept) 15750.30 79.84
treat -9401.16 801.98
---
n = 18667, k = 2
residual deviance = 2.198893e+12, null deviance = 2.215081e+12 (differen
overdispersion parameter = 117808349.3
residual sd is sqrt(overdispersion) = 10853.96
> mean(re78[treat==1])-mean(re78[treat==0])
[1] -9401.156
> nws.adjusted=glm(re78˜treat+age+educ+married+black+hisp+nodegree+re75+re
+ display(nws.adjusted)
glm(formula = re78 ˜ treat + age + educ + married + black + hisp +
nodegree + re75 + re74)
coef.est coef.se
(Intercept) 4427.01 449.18
treat 640.50 583.24
age -110.15 5.88
educ 247.02 28.80
married 180.24 144.33
black -387.15 190.58
hisp -50.18 228.22
nodegree 645.35 179.45
re75 0.51 0.01
re74 0.30 0.01
---
n = 18667, k = 10
residual deviance = 1.074142e+12, null deviance = 2.215081e+12 (differen
overdispersion parameter = 57573147.6
residual sd is sqrt(overdispersion) = 7587.70
wt = ifelse(treat==1,1/phat,1/(1-phat))
st.wt = ifelse(treat==1,mean(treat)/phat,mean(1-treat)/(1-phat))
> nws.weighted=glm(re78˜treat,weights=wt)
> display(nws.weighted)
glm(formula = re78 ˜ treat, weights = wt)
coef.est coef.se
(Intercept) 15647.00 91.82
treat -7116.53 151.84
---
n = 18667, k = 2
residual deviance = 2.937325e+12, null deviance = 3.282995e+12 (differen
overdispersion parameter = 157370755.5
residual sd is sqrt(overdispersion) = 12544.75
> nws.weighted=glm(re78˜treat,weights=wt2)
+ display(nws.weighted)
+
glm(formula = re78 ˜ treat, weights = wt2)
coef.est coef.se
(Intercept) 8037.06 159.77
treat 493.40 204.14
---
n = 6809, k = 2
residual deviance = 1.182667e+12, null deviance = 1.183682e+12 (differen
overdispersion parameter = 173742743.2
residual sd is sqrt(overdispersion) = 13181.15