The package multe
implements contamination bias diagnostics for regressions with multiple
treatments developed in Goldsmith-Pinkham, Hull,
and Kolesár (2024). This vignette illustrates the methods using
data from Fryer and Levitt (2013).
First, we fit a regression of test scores on a race dummy (treatment of interest) and a few controls, weighting using sampling weights:
library("multe")
## Regression of IQ at 24 months on race indicators
## and baseline controls
r1 <- stats::lm(std_iq_24 ~ race + factor(age_24) + female +
SES_quintile, weight = W2C0, data = fl)
## Compute alternatives estimates free of
## contamination bias
m1 <- multe(r1, "race", cluster = NULL)
print(m1, digits = 3)
#> Estimates on full sample:
#> PL OWN ATE EW CW
#> Black -0.2574 -0.2482 -0.2655 -0.2550 -0.2604
#> SE 0.0281 0.0291 0.0298 0.0289 0.0292
#> Hispanic -0.2931 -0.2829 -0.2992 -0.2862 -0.2944
#> SE 0.0260 0.0267 0.0299 0.0268 0.0279
#> Asian -0.2621 -0.2609 -0.2599 -0.2611 -0.2694
#> SE 0.0343 0.0343 0.0418 0.0343 0.0475
#> Other -0.1563 -0.1448 -0.1503 -0.1447 -0.1522
#> SE 0.0369 0.0370 0.0359 0.0368 0.0370
#>
#> P-values for null hypothesis of no propensity score variation:
#> Wald test: 0, LM test: 0
#>
#> SD(estimated propensity score), maximum over treatment arms:
#> Full sample: 0.196
The package reports five different estimators:
Precise definitions of these estimators are given in the Methods section below.
In this example, the propensity score varies significantly with covariates, as indicated by the p-values of the Wald and LM tests.
Including many controls may result in overlap failure, as the next example demonstrates:
r2 <- stats::lm(std_iq_24 ~ race + factor(age_24) + female +
SES_quintile + factor(siblings) + family_structure,
weight = W2C0, data = fl)
m2 <- multe(r2, treatment = "race")
#> For variable factor(siblings) the following levels fail overlap:
#> 6
#> Dropping observations with these levels
print(m2, digits = 3)
#> Estimates on full sample:
#> PL OWN ATE EW CW
#> Black -0.2438 -0.2043 -0.2482 -0.2180 -0.2408
#> SE 0.0308 0.0332 0.0355 0.0328 0.0389
#> Hispanic -0.2928 -0.2801 -0.2878 -0.2850 -0.2964
#> SE 0.0259 0.0267 0.0300 0.0267 0.0299
#> Asian -0.2739 -0.2836 -0.2742 -0.2839 -0.2916
#> SE 0.0342 0.0343 0.0420 0.0343 0.0459
#> Other -0.1520 -0.1277 NA -0.1295 -0.1459
#> SE 0.0369 0.0374 NA 0.0371 0.0385
#>
#> Estimates on overlap sample:
#> PL OWN ATE EW CW
#> Black -0.2444 -0.2049 -0.2505 -0.2191 -0.2426
#> SE 0.0309 0.0334 0.0357 0.0329 0.0388
#> Hispanic -0.2915 -0.2791 -0.2871 -0.2839 -0.2974
#> SE 0.0259 0.0267 0.0300 0.0267 0.0299
#> Asian -0.2766 -0.2863 -0.2769 -0.2865 -0.2924
#> SE 0.0344 0.0345 0.0421 0.0345 0.0459
#> Other -0.1522 -0.1280 -0.1397 -0.1298 -0.1465
#> SE 0.0369 0.0374 0.0362 0.0371 0.0385
#>
#> P-values for null hypothesis of no propensity score variation:
#> Wald test: 0, LM test: 0
#>
#> SD(estimated propensity score), maximum over treatment arms:
#> Full sample: 0.211, Overlap sample: 0.21
The issue is that no observations with 6 siblings have race equal to
other
:
Thus, the ATE estimator comparing other
to
white
is not identified. The package drops observations
with 6 siblings from the sample to form an “overlap sample” (see Methods
section below for precise construction of this sample), where the all
estimators are identified.
For a researcher who wants to check whether there is a significant
difference between the PL estimator and the other estimators, the data
frame cb_f
reports the difference between the estimates in
the full sample, along with the corresponding standard error. The data
frame cb_o
reports the differences and standard errors for
the overlap sample:
print(m2$cb_f, digits = 3)
#> PL OWN ATE EW CW
#> Black NA -0.03947 0.004397 -0.02573 -0.00292
#> pop_se NA 0.01204 0.017297 0.01027 0.02078
#> Hispanic NA -0.01269 -0.004962 -0.00783 0.00362
#> pop_se NA 0.00571 0.013143 0.00497 0.01274
#> Asian NA 0.00975 0.000265 0.01001 0.01769
#> pop_se NA 0.00487 0.024595 0.00480 0.02847
#> Other NA -0.02430 NA -0.02246 -0.00605
#> pop_se NA 0.00738 NA 0.00684 0.01334
print(m2$cb_o, digits = 3)
#> PL OWN ATE EW CW
#> Black NA -0.03951 0.006062 -0.02537 -0.00185
#> pop_se NA 0.01203 0.017395 0.01026 0.02060
#> Hispanic NA -0.01246 -0.004473 -0.00759 0.00589
#> pop_se NA 0.00569 0.013110 0.00494 0.01252
#> Asian NA 0.00963 0.000209 0.00984 0.01578
#> pop_se NA 0.00488 0.024687 0.00481 0.02840
#> Other NA -0.02423 -0.012490 -0.02240 -0.00573
#> pop_se NA 0.00738 0.010968 0.00683 0.01326
We see statistically significant difference between the OWN and PL estimate (i.e. significant contamination bias) for all races, both in the full sample and in the overlap sample.
The package also computes “oracle” standard errors, in addition to
the usual standard errors reported above. These can be accessed in the
data frame est_f
(or est_o
for the overlap
sample results)
print(m1$est_f, digits = 3)
#> PL OWN ATE EW CW
#> Black -0.2574 -0.2482 -0.2655 -0.2550 -0.2604
#> pop_se 0.0281 0.0291 0.0298 0.0289 0.0292
#> oracle_se NA NA 0.0298 0.0288 0.0290
#> Hispanic -0.2931 -0.2829 -0.2992 -0.2862 -0.2944
#> pop_se 0.0260 0.0267 0.0299 0.0268 0.0279
#> oracle_se NA NA 0.0299 0.0268 0.0278
#> Asian -0.2621 -0.2609 -0.2599 -0.2611 -0.2694
#> pop_se 0.0343 0.0343 0.0418 0.0343 0.0475
#> oracle_se NA NA 0.0418 0.0344 0.0465
#> Other -0.1563 -0.1448 -0.1503 -0.1447 -0.1522
#> pop_se 0.0369 0.0370 0.0359 0.0368 0.0370
#> oracle_se NA NA 0.0359 0.0360 0.0366
These oracle standard errors (oracle_se
) don’t account
for estimation error in the propensity score, in contrast to the default
standard errors (pop_se
), see Methods section below.
Specifying the cluster
argument allows for computation
of clustered standard errors:
## cluster in interviewer ID
m1alt <- multe(r1, "race", cluster = factor(factor(fl$interviewer_ID_24)))
print(m1alt, digits = 3)
#> Estimates on full sample:
#> PL OWN ATE EW CW
#> Black -0.2574 -0.2482 -0.2655 -0.2550 -0.2604
#> SE 0.0412 0.0425 0.0410 0.0422 0.0420
#> Hispanic -0.2931 -0.2829 -0.2992 -0.2862 -0.2944
#> SE 0.0441 0.0454 0.0495 0.0457 0.0474
#> Asian -0.2621 -0.2609 -0.2599 -0.2611 -0.2694
#> SE 0.0521 0.0523 0.0619 0.0523 0.0675
#> Other -0.1563 -0.1448 -0.1503 -0.1447 -0.1522
#> SE 0.0404 0.0416 0.0410 0.0414 0.0428
#>
#> P-values for null hypothesis of no propensity score variation:
#> Wald test: 0, LM test: 0
#>
#> SD(estimated propensity score), maximum over treatment arms:
#> Full sample: 0.196
This section describes the implementation of the bias decomposition formula and the implementation of alternative estimators. Relative to Goldsmith-Pinkham, Hull, and Kolesár (2024), we generalize the setup to allow for sampling weights ωi2 (setting the sampling weights to one recovers unweighted formulas). We also explicitly deal with overlap issues.
We are interested in the effect of treatment Di ∈ {0, 1, …, K} on an outcome Yi. Let $X_{i}=\1{D_{i}=1,\dotsc, D_{i}=K}$ denote a vector of treatment indicators, let $X_{i0}=\1{D_{i}=0}$, and let Zi = (1, Wi′)′ denote a vector of controls, including an intercept. We focus on the case where the controls enter linearly, so that control functions take the form 𝒢 = {z′γ: γ ∈ ℝ1 + dim (Wi)}.
We assume that μk(Wi) := E[Yi(k) ∣ Wi] ∈ 𝒢, so that we may write μk(Wi) = Wi′αk for some vectors αk, k = 0, …, K. The average treatment effect (ATE) conditional on Wi is then given by τ(Wi) = Zi′(αk − α0), and αk correspond to the coefficients in the interacted regression with U̇i conditionally mean zero. The uninteracted partially linear (PL) estimator is given by estimating by weighted least squares (WLS), yielding β̂ = (∑iωi2ẊiẊi′)−1∑iωi2ẊiYi, where Ẋ is the sample residual from WLS regression of Xi onto Zi. By Proposition 1 in Goldsmith-Pinkham, Hull, and Kolesár (2024), the population analog of β̂, β, has the decomposition where Λi = E[X̃iX̃i′]−1E[X̃iXi ∣ Wi], and X̃i is the population analog of Ẋi, the population residual from regressing Xi onto Wi. Let α̂k denote the WLS estimates based on . By construction, the sample residuals from estimating and Zi are both orthogonal to Ẋi. As a result, we obtain the exact decomposition where Γ̂ is a matrix with columns γ̂k = α̂k − α̂0, Λ̂i = En[ẊiẊi′]−1ẊiXi′, and En[Ai] = ∑iωi2Ai/∑iωi2 denotes the weighted sample mean.
To compute this decomposition, we don’t need to explicitly compute Λ̂i. Instead, we use the identity where δ̂kk is a WLS estimator of the system of regressions
Note this decomposition and associated standard errors, in the next subsection, are purely regression-based, so they remain valid even if Xi is not a set of binary indicators. Likewise, misspecification of the interacted regression only affects the interpretation of the decomposition; if μk is not linear, the decomposition will not consistently estimate the contamination bias.
The own treatment weights in this decomposition sum to one, and the contamination weights sum to zero, since En[Λ̂i] = Ik, mimicking the population decomposition. If the propensity score doesn’t satisfy pk ∈ 𝒢, the implied estimate of Λ(w), may not be positive definite; in particular, the diagonal elements may not all be positive, in line with Proposition 1 in Goldsmith-Pinkham, Hull, and Kolesár (2024).
In addition to this decomposition, the package also computes the following alternative estimators:
cw_uniform=TRUE
in the multe
function
sets these probabilities to 1/K; setting the option to its
default, FALSE
, sets them to (En[Xi0], …, En[XiK]).To compute cluster-robust standard errors for an asymptotically
linear estimator with influence function ψi, we use the
formula Here Gi denotes
cluster membership, as specified by the multe
argument
cluster
, and G
the number of clusters. Specifying cluster=NULL
assumes
independent data, setting each observation to be in its own cluster
(Gi = i
and G = N), so the
reported standard errors are robust to heteroskedasticity, but not
clustering.
We now describe the form of the influence function for the estimators
above. For a generic WLS regression of A onto B, let $(Q_{1},Q_{2}) \left(\begin{smallmatrix}
R & S\\
0 & 0
\end{smallmatrix}\right)\Pi'$ denote the QR decomposition of
$\diag(\omega_{i})B$. If B has rank r, then R has dimension r × r, Q has dimension N × r, where r is the rank of the regressor
matrix, and Π is a permutation
matrix. The WLS estimator is then given by $b=\Pi\left(\begin{smallmatrix}
R^{-1}Q_{1}'\diag(\omega_{i})A\\
\mathtt{NA}\end{smallmatrix}\right)$.
Denoting the regression residual by ϵ̂i, the
influence function is thus given by See the internal function
multe:::reg_if
for implementation. The influence function
for the inner product of linear estimators a and b, is by the delta method given by
while for scalars s1, s2,
ψ(s1a + s2b) = s1ψ(a) + s2β(b).
We use to compute ψ(α̂k), as well as where ζ̂ik is the WLS residual based on , and $\ddot{X}_{ik}$ is the residual from regressing Xik onto Xi, −k and Zi. It then follows from and the influence function formulas above, that where X̂ik is the residual from regressing Xik onto Z in the subset with Di ∈ {0, k}, and Ûik the residual from regressing Yi onto Xik and Zi in this subsample.
When the treatment is binary and overlap holds, the formula for $\psi_{i}(\hbate_{k})$ is similar to that discussed on page 29 in Imbens and Wooldridge (2009), except we don’t assume that the regression error Vi in is conditionally mean zero, so that the standard error is robust to misspecification.
Derivations in the last section show that the influence function for the common weights estimator is given by $\hat{\psi}_{i}(\hbcw_{k})=\hat{\psi}_{i}(\hat{\alpha}^{\textnormal{CW}}_{k}-\hat{\alpha}^{\textnormal{CW}}_{k})$, where
with the formula for ai given in below, θ corresponds to the parameters in the multinomial logit model, πk(Wi; θ̂) to the fitted probabilities in this model, and $\hat{\alpha}^{\textnormal{CW}}_{k}$ is the estimate based on below.
The package also reports “oracle” standard errors, which interprets the alternative estimators as estimates of the contrasts with λ(Wi) = 1 for the unweighted ATE, $\lambda(W_{i})=\lcw(W_{i})$ for the common weights estimator and $\lambda(W_{i})=\frac{p_{k}(W_{i})p_{0}(W_{i})}{p_{k}(W_{i})+p_{0}(W_{i})}$ for the efficiently weighted ATE estimator. In contrast, the standard errors in the previous subsection set the estimands to be the population counterparts to these weighted averages, replacing the sums in the above display with population expectations. In addition, the oracle standard errors don’t account for estimation error in the propensity score p(Wi).
For the unweighted ATE, the oracle standard error is based on the influence function ψ̃i(β̂kATE) = Z̄′ψi(α̂k − α̂0). From the derivation in the last section, it follows that the oracle standard error for $\hbew_{k}$ is given by where $\hat{\dot{U}}_{i}$ is the interacted regression residual based on .
Finally, the oracle standard errors for $\hbcw_{k}$ are based on the influence function $\tilde{\psi}_{i}(\hbcw_{k})=\tilde{\psi}_{i}(\hat{\alpha}^{\text{CW}}_{k})-\tilde{\psi}_{i}(\hat{\alpha}^{\text{CW}}_{0})$, where
The package applies the above formulas to the full sample. In cases
with poor overlap, this may not yield well-defined estimates or bias
decomposition for all treatments. For components of the decomposition
and alternative estimators that are not identified, the package returns
NA
. In such cases, the package also returns results for a
trimmed “overlap sample”, where the decomposition and alternative
estimators are all identified. The overlap sample is constructed as
follows:
We now give the form of the Wald and LM tests for variation in the propensity score. First, we give a general derivation of these tests in a likelihood context when the Hessian may be reduced rank. We then specialize the formulas to the case where the likelihood corresponds to the that for the multinomial logit model.
Consider a log-likelihood ℓn(θ) for a p-dimensional parameter θ, with score function S that’s approximately normal with covariance matrix Ω, and Hessian H. We’re interested in testing the hypothesis that last r elements of θ are zero, H0: θ2 = 0. We assume that the submatrix H11 of the Hessian corresponding to the restricted model is full rank, but the full matrices Ω or H may not be invertible.
The score evaluated at the unrestricted estimator θ̂ satisfies ignoring in the notation that the Hessian evaluated needs to be evaluated at intermediate values. Rearranging, This yields the Wald statistic where A+ denotes a generalized inverse. By Lemma 9.7 in Newey and McFadden (1994), the statistic has an asymptotic χ2 distribution with degrees of freedom equal to the rank of the variance.
The score evaluated at the restricted estimator θ̄1 satisfies which implies θ̄1 − θ1 = −H11−1S1(θ1, 0), and hence Thus the statistic will again have a χ2 distribution.
To apply these formulas in the context of a multinomial logit model, we use the score and the Hessian
We first derive . Observe first that the common weights estimator is identical to the two-step GMM estimator that in the first step, fits a multinomial logit model with the normalization θ0 = 0. In the second step, we use the moment condition to obtain estimates α̂kCW, and set $\hbcw_k=\hat\alpha^{\text{CW}}_{k}-\hat\alpha^{\text{CW}}_{0}$.
Let By equation (6.6) in Newey and McFadden (1994), the influence function of this two-step estimator is given by where ψi(θ) is the influence function of the multinomial logit estimator θ̂, and Mk(θ) is the derivative of wrt θ.
Since $\partial \zeta_{k}(W_{i};\theta)/\partial \theta_{j}= Z_{i}\zeta_{k}(W_{i};\theta)[\pi_{j}(1-\pi_{j})\zeta_{k}(W_{i};\theta)-\1{k=j>0}]$, it follows that Since the multinomial logit log-likelihood is given by $\ell_{i}=\sum_{k=0}^{K}X_{k}\log(\pi_{k})=\sum_{k=0}^{K}X_{k}Z_{i}'\theta_{k} -\log(\sum_{k=0}^{K}e^{Z_{i}'\theta_{k}})$, the score and the Hessian are Since ψi(θ) = −H(θ)−1Si(θ), this yields with M̂k(θ) = (∑i(ζ − ek) ⊗ Zi ⋅ ζkXik(Yi − αλC, k)), and $\hat{H}({\theta})= \sum_{i}(\diag(\pi(W_{i}))-\pi(W_{i})\pi(W_{i})')\otimes Z_{i}Z_{i}'$. When πk = 1/(K + 1) this formula reduces to that in Theorem 1 in Li and Li (2019).
Next, we show . Note that it follows from Proposition 2 in Goldsmith-Pinkham, Hull, and Kolesár (2024) that the efficient influence function is given by where rk = rk(Wi) = E[Xik ∣ Wi, Xik + Xi0 = 1]. The result then follows since X̂ik is an estimator of Xik − rk(Wi).
Finally, we show . The derivative of the moment condition with respect to πk = pk (assuming correct specification of the propensity score) is given by where we write λ for $\lcw(W_{i})$. Since pk is a projection, by Proposition 4 in Newey (1994), the influence function for α̂kCW is given by Next, as noted in Abadie, Imbens, and Zheng (2014), we can view α̃kCW = ∑iλμk(Wi)/∑iλ as an estimator of αkCW based on the moment condition E[λ(μk(Wi) − αkCW)] = 0, which by standard arguments has influence function given by $\frac{\lambda}{E[\lambda]}(\mu_{k}(W_{i})-{\alpha}^{\text{CW}}_{k})$. Since α̂kCW − αkCW = (α̂kCW − αkCW) − (αkCW − α̃kCW), we subtract this influence function from the preceding display to obtain .