Chapter 12 The Doubly Robust or the Augmented Inverse Propensity Score Weighting Estimator for the Average Causal Effect

Under ignorability Z\ind \{Y(1),Y(0)\}\mid X and overlap 0<e(X)<1, Chapter 11 has shown two identification formulas of the average causal effect \tau=E\{Y(1)-Y(0)\}. First, the outcome regression formula is

\displaystyle\tau=E\{\mu_{1}(X)\}-E\{\mu_{0}(X)\} (62)

where

\displaystyle\mu_{1}(X) \displaystyle= \displaystyle E\{Y(1)\mid X\}=E(Y\mid Z=1,X),
\displaystyle\mu_{0}(X) \displaystyle= \displaystyle E\{Y(0)\mid X\}=E(Y\mid Z=0,X)

are the two conditional mean functions of the outcome given covariates under the treatment and control, respectively. Second, the IPW formula is

\displaystyle\tau=E\left\{\frac{ZY}{e(X)}\right\}-E\left\{\frac{(1-Z)Y}{1-e(X)}\right\} (63)

where

e(X)=\textup{pr}(Z=1\mid X)

is the propensity score introduced in Chapter 11.

The outcome regression estimator requires fitting a model for the outcome given the treatment and covariates. It is consistent if the outcome model is correctly specified. The IPW estimator requires fitting a model for the treatment given the covariates. It is consistent if the propensity score model is correctly specified.

Mathematically, we have many combinations of (62) and (63) that lead to different identification formulas of the average causal effect. Below I will discuss a particular combination that has appealing theoretical properties. This combination motivates an estimator that is consistent if either the propensity score or the outcome model is correctly specified. It is called the doubly robust estimator, championed by James Robins (Scharfstein et al.,, 1999; Bang and Robins,, 2005).

62 The doubly robust estimator

62.1 Population version

We posit a model for the conditional means of the outcome \mu_{1}(X,\beta_{1}) and \mu_{0}(X,\beta_{0}), indexed by the parameters \beta_{1} and \beta_{0}. For example, if the conditional means are linear or logistic under the working model, then the parameters are just the regression coefficients. If the outcome model is correctly specified, then \mu_{1}(X,\beta_{1})=\mu_{1}(X) and \mu_{0}(X,\beta_{0})=\mu_{0}(X). We posit a working model for the propensity score e(X,\alpha), indexed by the parameter \alpha. For example, if the working model is logistic, then \alpha is the regression coefficient. If the propensity score model is correctly specified, then e(X,\alpha)=e(X). In practice, both models may be misspecified. Sometimes, we call them working models due to the possibility of misspecification.

Define

\displaystyle\tilde{\mu}_{1}^{\textup{dr}} \displaystyle= \displaystyle E\left[\frac{Z\{Y-\mu_{1}(X,\beta_{1})\}}{e(X,\alpha)}+\mu_{1}(X,\beta_{1})\right], (64)
\displaystyle\tilde{\mu}_{0}^{\textup{dr}} \displaystyle= \displaystyle E\left[\frac{(1-Z)\{Y-\mu_{0}(X,\beta_{0})\}}{1-e(X,\alpha)}+\mu_{0}(X,\beta_{0})\right], (65)

which can also be written as

\displaystyle\tilde{\mu}_{1}^{\textup{dr}} \displaystyle= \displaystyle E\left[\frac{ZY}{e(X,\alpha)}-\frac{Z-e(X,\alpha)}{e(X,\alpha)}\mu_{1}(X,\beta_{1})\right], (66)
\displaystyle\tilde{\mu}_{0}^{\textup{dr}} \displaystyle= \displaystyle E\left[\frac{(1-Z)Y}{1-e(X,\alpha)}-\frac{e(X,\alpha)-Z}{1-e(X,\alpha)}\mu_{0}(X,\beta_{0})\right]. (67)

The formulas in (64) and (65) augment the outcome regression estimator by inverse propensity score weighting terms of the residuals. The formulas in (66) and (67) augment the IPW estimator by the imputed outcomes. For this reason, the doubly robust estimator is also called the augmented inverse propensity score weighting (AIPW) estimator.

The augmentation strengthens the theoretical properties in the following sense.

Theorem 12.1

Assume ignorability Z\ind \{Y(1),Y(0)\}\mid X and overlap 0<e(X)<1.

  1. 1.

    If either e(X,\alpha)=e(X) or \mu_{1}(X,\beta_{1})=\mu_{1}(X), then \tilde{\mu}_{1}^{\textup{dr}}=E\{Y(1)\}.

  2. 2.

    If either e(X,\alpha)=e(X) or \mu_{0}(X,\beta_{0})=\mu_{0}(X), then \tilde{\mu}_{0}^{\textup{dr}}=E\{Y(0)\}.

  3. 3.

    If either e(X,\alpha)=e(X) or \{\mu_{1}(X,\beta_{1})=\mu_{1}(X),\mu_{0}(X,\beta_{0})=\mu_{0}(X)\}, then \tilde{\mu}_{1}^{\textup{dr}}-\tilde{\mu}_{0}^{\textup{dr}}=\tau.

By Theorem 12.1, \tilde{\mu}_{1}^{\textup{dr}}-\tilde{\mu}_{0}^{\textup{dr}} equals \tau if either the propensity score model or the outcome model is correctly specified. That’s why it is called the doubly robust estimator.

Proof of Theorem 12.1: I only prove the result for \mu_{1}=E\{Y(1)\}. The proof for the result for \mu_{0}=E\{Y(0)\} is similar.

We have the decomposition

\displaystyle\tilde{\mu}_{1}^{\textup{dr}}-E\{Y(1)\}
\displaystyle= \displaystyle E\left[\frac{Z\{Y(1)-\mu_{1}(X,\beta_{1})\}}{e(X,\alpha)}-\{Y(1)-\mu_{1}(X,\beta_{1})\}\right]\qquad(\text{by definition})
\displaystyle= \displaystyle E\left[\frac{Z-e(X,\alpha)}{e(X,\alpha)}\{Y(1)-\mu_{1}(X,\beta_{1})\}\right]\qquad(\text{combining terms})
\displaystyle= \displaystyle E\left(E\left[\frac{Z-e(X,\alpha)}{e(X,\alpha)}\{Y(1)-\mu_{1}(X,\beta_{1})\}\mid X\right]\right)\qquad(\text{tower property})
\displaystyle= \displaystyle E\left[E\left\{\frac{Z-e(X,\alpha)}{e(X,\alpha)}\mid X\right\}\times E\left\{Y(1)-\mu_{1}(X,\beta_{1})\mid X\right\}\right]\qquad(\text{ignorability})
\displaystyle= \displaystyle E\left[\frac{e(X)-e(X,\alpha)}{e(X,\alpha)}\times\left\{\mu_{1}(X)-\mu_{1}(X,\beta_{1})\right\}\right].

Therefore, \tilde{\mu}_{1}^{\textup{dr}}-E\{Y(1)\}=0 if either e(X,\alpha)=e(X) or \mu_{1}(X,\beta_{1})=\mu_{1}(X). \square

62.2 Sample version

Based on the population versions of \tilde{\mu}_{1}^{\textup{dr}} and \tilde{\mu}_{0}^{\textup{dr}}, we can obtain their sample analogs to construct a doubly robust estimator for \tau.

Definition 12.1 (doubly robust estimator for the average causal effect)

Based on the data (X_{i},Z_{i},Y_{i})_{i=1}^{n}, we can obtain a doubly robust estimator for \tau by the following steps:32

  1. [(1)]

  2. 1.

    obtain the fitted values of the propensity scores: e(X_{i},\hat{\alpha});

  3. 2.

    obtain the fitted values of the outcome means: \mu_{1}(X_{i},\hat{\beta}_{1}) and \mu_{0}(X_{i},\hat{\beta}_{0});

  4. 3.

    construct the doubly robust estimator: \hat{\tau}^{\textup{dr}}=\hat{\mu}_{1}^{\textup{dr}}-\hat{\mu}_{0}^{\textup{dr}}, where

    \hat{\mu}_{1}^{\textup{dr}}=\frac{1}{n}\sum_{i=1}^{n}\left[\frac{Z_{i}\{Y_{i}-\mu_{1}(X_{i},\hat{\beta}_{1})\}}{e(X_{i},\hat{\alpha})}+\mu_{1}(X_{i},\hat{\beta}_{1})\right]

    and

    \hat{\mu}_{0}^{\textup{dr}}=\frac{1}{n}\sum_{i=1}^{n}\left[\frac{(1-Z_{i})\{Y_{i}-\mu_{0}(X_{i},\hat{\beta}_{0})\}}{1-e(X_{i},\hat{\alpha})}+\mu_{0}(X_{i},\hat{\beta}_{0})\right].

By Definition 12.1, we can also write the doubly robust estimator as

\hat{\tau}^{\textup{dr}}=\hat{\tau}^{\textup{reg}}+\frac{1}{n}\sum_{i=1}^{n}\frac{Z_{i}\{Y_{i}-\mu_{1}(X_{i},\hat{\beta}_{1})\}}{e(X_{i},\hat{\alpha})}-\frac{1}{n}\sum_{i=1}^{n}\frac{(1-Z_{i})\{Y_{i}-\mu_{0}(X_{i},\hat{\beta}_{0})\}}{1-e(X_{i},\hat{\alpha})}.

Analogous to (66) and (67), we can also rewrite it as

\hat{\tau}^{\textup{dr}}=\hat{\tau}^{\textup{ipw}}-\frac{1}{n}\sum_{i=1}^{n}\frac{Z_{i}-e(X_{i},\hat{\alpha})}{e(X_{i},\hat{\alpha})}\mu_{1}(X_{i},\hat{\beta}_{1})+\frac{1}{n}\sum_{i=1}^{n}\frac{e(X_{i},\hat{\alpha})-Z_{i}}{1-e(X_{i},\hat{\alpha})}\mu_{0}(X_{i},\hat{\beta}_{0}).

Funk et al., (2011) suggested to approximate the variance of \hat{\tau}^{\textup{dr}} via the nonparametric bootstrap by resampling from (Z_{i},X_{i},Y_{i})_{i=1}^{n}.

63 More intuition and theory for the doubly robust estimator

Although the beginning of this chapter claims that the basic identification formulas based on outcome regression and IPW immediately yield infinitely many other identification formulas, the particular forms of the doubly robust estimators in (64) and (65) are not obvious to come up with. The original motivation for (64) and (65) was quite theoretical, and relied on something called the semiparametric efficiency theory in advanced mathematical statistics (Bickel et al.,, 1993). It is beyond the level of this book. Below I will give two intuitive perspectives to construct (64) and (65). Both Sections 63.1 and 63.2 below focus on the estimation of E\{Y(1)\} since the estimation of E\{Y(0)\} is similar by symmetry.

63.1 Reducing the variance of the IPW estimator

The IPW estimator for \mu_{1} based on

\mu_{1}=E\left\{\frac{ZY}{e(X)}\right\}

completely ignores the outcome model of Y. It has the advantage of being consistent without assuming any outcome model. However, if the covariates are predictive of the outcome, the residual based on a working outcome model usually has a smaller variance than the outcome even when this working outcome model is wrong. With a possibly misspecified outcome model \mu_{1}(X,\beta_{1}), a trivial decomposition holds:

\mu_{1}=E\{Y(1)\}=E\{Y(1)-\mu_{1}(X,\beta_{1})\}+E\{\mu_{1}(X,\beta_{1})\}.

If we apply the IPW formula to the first term in the above formula viewing Y(1)-\mu_{1}(X,\beta_{1}) as a “pseudo potential outcome” under the treatment, we can rewrite the above formula as

\displaystyle\mu_{1} \displaystyle= \displaystyle E\left\{\frac{Z\{Y-\mu_{1}(X,\beta_{1})\}}{e(X)}\right\}+E\{\mu_{1}(X,\beta_{1})\} (68)
\displaystyle= \displaystyle E\left\{\frac{Z\{Y-\mu_{1}(X,\beta_{1})\}}{e(X)}+\mu_{1}(X,\beta_{1})\right\}, (69)

which holds if the propensity score model is correct without assuming that the outcome model is correct. Using a working model to improve efficiency is an old idea from survey sampling. Little and An, (2004) and Lumley et al., (2011) pointed out its connection with the doubly robust estimator.

63.2 Reducing the bias of the outcome regression estimator

The discussion in Section 63.1 starts with the IPW estimator and improves its efficiency based on a working outcome model. Alternatively, we can also start with an outcome regression estimator based on

\tilde{\mu}_{1}=E\{\mu_{1}(X,\beta_{1})\}

which may not be the same as \mu_{1} since the outcome model may be wrong. The bias of this estimator is E\{\mu_{1}(X,\beta_{1})-Y(1)\}, which can be estimated by an IPW estimator

B=E\left\{\frac{Z\{\mu_{1}(X,\beta_{1})-Y\}}{e(X)}\right\}

if the propensity score model is correct. So a de-biased estimator is \tilde{\mu}_{1}-B, which is identical to (69).

64 Examples

64.1 Summary of some canonical estimators for \tau

The following R code implements the outcome regression, HT, Hajek, and doubly robust estimators for \tau. These estimators can be conveniently implemented based on the fitted values of the glm function. The default choice for the propensity score model is the logistic model, and the default choice for the outcome model is the linear model with out.family = gaussian33. For binary outcomes, we can also specify out.family = binomial to fit the logistic model.

OS_est = function(z, y, x, out.family = gaussian,
truncps = c(0, 1))
{
## fitted propensity score
pscore = glm(z ~ x, family = binomial)$fitted.values
pscore = pmax(truncps[1], pmin(truncps[2], pscore))
## fitted potential outcomes
outcome1 = glm(y ~ x, weights = z,
family = out.family)$fitted.values
outcome0 = glm(y ~ x, weights = (1 - z),
family = out.family)$fitted.values
## outcome regression estimator
ace.reg = mean(outcome1 - outcome0)
## IPW estimators
y.treat = mean(z*y/pscore)
y.control = mean((1 - z)*y/(1 - pscore))
one.treat = mean(z/pscore)
one.control = mean((1 - z)/(1 - pscore))
ace.ipw0 = y.treat - y.control
ace.ipw = y.treat/one.treat - y.control/one.control
## doubly robust estimator
res1 = y - outcome1
res0 = y - outcome0
r.treat = mean(z*res1/pscore)
r.control = mean((1 - z)*res0/(1 - pscore))
ace.dr = ace.reg + r.treat - r.control
return(c(ace.reg, ace.ipw0, ace.ipw, ace.dr))
}

It is tedious to calculate the analytic formulas for the variances of the above estimators. The bootstrap provides convenient approximations to the variances based on resampling from \{Z_{i},X_{i},Y_{i}\}_{i=1}^{n}. Building upon the function OS_est above, the following function returns point estimators as well as the bootstrap standard errors.

OS_ATE = function(z, y, x, n.boot = 2*10^2,
out.family = gaussian, truncps = c(0, 1))
{
point.est = OS_est(z, y, x, out.family, truncps)
## nonparametric bootstrap
n = length(z)
x = as.matrix(x)
boot.est = replicate(n.boot, {
id.boot = sample(1:n, n, replace = TRUE)
OS_est(z[id.boot], y[id.boot], x[id.boot, ],
out.family, truncps)
})
boot.se = apply(boot.est, 1, sd)
res = rbind(point.est, boot.se)
rownames(res) = c("est", "se")
colnames(res) = c("reg", "HT", "Hajek", "DR")
return(res)
}
64.2 Simulation

I will use simulation to evaluate the finite-sample properties of the estimators under four scenarios:

  1. 1.

    both the propensity score and outcome models are correct;

  2. 2.

    the propensity score model is wrong but the outcome model is correct;

  3. 3.

    the propensity score model is correct but the outcome model is wrong;

  4. 4.

    both the propensity score and outcome models are wrong.

I will report the average bias, the true standard error, and the average estimated standard error of the estimators over simulation.

In case 1, the data generating process is

x = matrix(rnorm(n*2), n, 2)
x1 = cbind(1, x)
beta.z = c(0, 1, 1)
pscore = 1/(1 + exp(- as.vector(x1%*%beta.z)))
z = rbinom(n, 1, pscore)
beta.y1 = c(1, 2, 1)
beta.y0 = c(1, 2, 1)
y1 = rnorm(n, x1%*%beta.y1)
y0 = rnorm(n, x1%*%beta.y0)
y = z*y1 + (1 - z)*y0

In case 2, I modify the propensity score model to be nonlinear:

x1 = cbind(1, x, exp(x))
beta.z = c(-1, 0, 0, 1, -1)
pscore = 1/(1 + exp(- as.vector(x1%*%beta.z)))

In case 3, I modify the outcome model to be nonlinear:

beta.y1 = c(1, 0, 0, 0.2, -0.1)
beta.y0 = c(1, 0, 0, -0.2, 0.1)
y1 = rnorm(n, x1%*%beta.y1)
y0 = rnorm(n, x1%*%beta.y0)

In case 4, I modify both the propensity score and the outcome model.

We set the sample size to be n=500 and generate 500 independent data sets according to the data-generating processes above. In case 1,

reg HT Hajek DR
ave.bias 0.00 0.02 0.03 0.01
true.se 0.11 0.28 0.26 0.13
est.se 0.10 0.25 0.23 0.12

All estimators are nearly unbiased. The two weighting estimators have larger variances. In case 2,

reg HT Hajek DR
ave.bias 0.00 -0.76 -0.75 -0.01
true.se 0.12 0.59 0.47 0.18
est.se 0.13 0.50 0.38 0.18

The two weighting estimators are severely biased due to the misspecification of the propensity score model. The outcome regression and doubly robust estimators are nearly unbiased.

In case 3,

reg HT Hajek DR
ave.bias -0.05 0.00 -0.01 0.00
true.se 0.11 0.15 0.14 0.14
est.se 0.11 0.14 0.13 0.14

The outcome regression estimator has a larger bias than the other three estimators due to the misspecification of the outcome model. The weighting and doubly robust estimators are nearly unbiased.

In case 4,

reg HT Hajek DR
ave.bias -0.08 0.11 -0.07 0.16
true.se 0.13 0.32 0.20 0.41
est.se 0.13 0.25 0.16 0.26

All estimators are biased because both the propensity score and outcome models are wrong. The HT and doubly robust estimator has the largest bias. When both models are wrong, the doubly robust estimator appears to be doubly fragile.

In all the cases above, the bootstrap standard errors are close to the true ones when the estimators are nearly unbiased for the true average causal effect.

64.3 Applications

Revisiting Example 10.3, we obtain the following estimators and bootstrap standard errors:

reg HT Hajek DR
est -0.017 -1.516 -0.156 -0.019
se 0.230 0.492 0.246 0.233

The two weighting estimators are much larger than the other two estimators. Truncating the estimated propensity score at [0.1,0.9], we obtain the following estimators and bootstrap standard errors:

reg HT Hajek DR
est -0.017 -0.713 -0.054 -0.043
se 0.223 0.422 0.235 0.231

The Hajek estimator becomes much closer to the outcome regression and doubly robust estimators, while the Horvitz–Thompson estimator is still an outlier.

65 Some further discussion

Recall the proof of Theorem 12.1, the key for the double robustness property is the product structure in

\tilde{\mu}_{1}^{\textup{dr}}-E\{Y(1)\}=E\left[\frac{e(X)-e(X,\alpha)}{e(X,\alpha)}\times\left\{\mu_{1}(X)-\mu_{1}(X,\beta_{1})\right\}\right],

which ensures that the estimation error is zero if either e(X)=e(X,\alpha) or \mu_{1}(X)=\mu_{1}(X,\beta_{1}). This delicate structure renders the doubly robust estimator possibly doubly fragile when both the propensity score and the outcome models are misspecified. The product of two errors multiply to yield potentially much larger errors. The simulation in Chapter 64.2 confirms this point.

Kang and Schafer, (2007) criticized the doubly robust estimator based on simulation studies. They found that the finite-sample performance of the doubly robust estimator can be even wilder than the simple outcome regression and IPW estimators. Despite the critique from Kang and Schafer, (2007), the doubly robust estimator has been a standard strategy in causal inference since the seminal work of Scharfstein et al., (1999). Recently, it was resurrected in the theoretical statistics and econometrics literature with a fancier name “double machine learning” (Chernozhukov et al.,, 2018). The basic idea is to replace the working models for the propensity score and outcome with machine learning tools which can be viewed as more flexible models than the traditional parametric models.

66 Homework problems

12.1 A sanity check

Consider the case in which the covariate is discrete X\in\{1,\ldots,K\} and the parameter of interest is \tau. Without imposing any model assumptions, the estimated propensity score \hat{e}(X) equals \hat{e}_{[k]}=\hat{\textup{pr}}(Z=1\mid X=k), the proportion of units receiving the treatment, and the estimated outcome means are the sample means of the outcomes \hat{\bar{Y}}_{[k]}(1)=\hat{E}(Y\mid Z=1,X=k) and \hat{\bar{Y}}_{[k]}(0)=\hat{E}(Y\mid Z=0,X=k) under treatment, within stratum X=k\ (k=1,\ldots,K). Show that the stratified estimator, outcome regression estimator, HT estimator, Hajek estimator, and doubly robust estimator are all identical numerically.

12.2 An alternative form of the doubly robust estimator for \tau

Motivated by (68), we have an alternative form of the doubly robust estimator for \mu_{1}=E\{Y(1)\}:

\tilde{\mu}_{1}^{\text{dr2}}=\frac{E\left[\frac{Z\{Y-\mu_{1}(X,\beta_{1})\}}{e(X,\alpha)}\right]}{E\left[\frac{Z}{e(X,\alpha)}\right]}+E\{\mu_{1}(X,\beta_{1})\}.

Show that \tilde{\mu}_{1}^{\text{dr2}}=\mu_{1} if either e(X,\alpha)=e(X) or \mu_{1}(X,\beta_{1})=\mu_{1}(X). Give the analogous formula for estimating \mu_{0}. Give the sample analog of the doubly robust estimator for \tau based on these formulas.

Remark: This form of doubly robust estimator appeared in Robins et al., (2007).

12.3 An upper bound of the bias of the doubly robust estimator

Consider the population version of the doubly robust estimator \tilde{\mu}_{1}^{\textup{dr}} for E\{Y(1)\}. Show that

|\tilde{\mu}_{1}^{\textup{dr}}-E\{Y(1)\}|\leq\sqrt{E\left[\frac{\{e(X)-e(X,\alpha)\}^{2}}{e(X,\alpha)^{2}}\right]\times E\left[\left\{\mu_{1}(X)-\mu_{1}(X,\beta_{1})\right\}^{2}\right].}

Find the analogous upper bound for the bias of \tilde{\mu}_{0}^{\textup{dr}} for E\{Y(0)\}.

Remark: You may find Section 30.A.4 useful for the proof.

12.4 Data analysis of Example 10.1

Analyze the dataset cps1re74.csv using the methods discussed so far.

12.5 Analyzing a dataset from the Karolinska Institute

Rubin, (2008) used the dataset karolinska.txt to illustrate the ideas of causal inference in observational studies. The dataset has 158 cardia cancer patients diagnosed between 1988 and 1995 in Central and Northern Sweden, 79 diagnosed at large volume hospitals, defined as treating more than ten patients with cardia cancer during that period, and 79 diagnosed at the remaining small volume hospitals. The treatment z is the indicator of whether a patient was diagnosed at a large volume hospital. The outcome y is whether the patient survived longer than 1 year after the diagnosis. The covariates x contain information about age, whether a patient was from a rural area, and whether a patient was male.

karolinska = read.table("karolinska.txt", header = TRUE)
z = karolinska$hvdiag
y = 1 - (karolinska$year.survival == 1)
x = as.matrix(karolinska[, c(3, 4, 5)])

Analyze the dataset using the methods discussed so far.

12.6 Recommended reading

Lunceford and Davidian, (2004) gave a review and comparison of many methods discussed in Chapters 11 and 12.

脚注

32. I used \hat{e}(X_{i}) for e(X_{i},\hat{\alpha}) and \hat{\mu}_{z}(X_{i}) for \mu_{z}(X_{i},\hat{\beta}_{1}) before when I did not want to emphasize the parameters in the working models.

33. The glm function is more general than the lm function. With out.family = gaussian, glm is identical to lm.

本书:A First Course in Causal Inference,作者 Peng Ding。原文:arXiv:2305.18793v2,按 CC BY 4.0 许可发布。本站(yuanens.com)把 arXiv 网页版改成分章的纯 HTML,把公式渲染成图片,方便在 Kindle 等电子书阅读器上看,内容没有改动。转换难免有错,以原文为准。本站与作者和出版社无关。