Tutorials › Econometrics (Graduate) › Variance Estimation for Inverse-Probability-Weighted Effects

Matching and Weighting Methods · Tutorial 646 of 952

Variance Estimation for Inverse-Probability-Weighted Effects

Learn to estimate uncertainty for inverse-probability-weighted effects while accounting for the fact that propensity scores are fitted from the data.

Advanced 12 min read

What You'll Learn

  • State the assumptions supporting inference for inverse-probability-weighted effects.
  • Derive the influence function when propensity-score parameters are estimated.
  • Connect the influence-function variance estimate to a sandwich estimator.
  • Calculate standard errors from weighted contributions and nuisance-parameter adjustments.
  • Recognize why treating estimated propensity scores as fixed can give incorrect uncertainty estimates.

Why Variance Estimation Must Account for Estimated Weights

Inverse-probability weighting makes a treatment-effect estimate depend on both the observed outcomes and the propensity scores used to weight them. When those scores are fitted from the same data, the resulting estimate has uncertainty from both sources. A variance calculation that treats the fitted scores as known generally omits one part of that uncertainty.

This tutorial develops the adjustment for the average treatment effect (ATE). The same estimating-equation approach applies to other inverse-probability-weighted effects and to normalized weighted estimators, but their estimating equations and derivatives must match the estimator actually used. The aim is not to claim that estimating scores must always increase the standard error: the adjustment can increase or decrease it, depending on how the propensity-score fit responds to the data.

Setup and assumptions: Let observations \(O_i=(Y_i,A_i,X_i)\), \(i=1,\ldots,n\), be independent and identically distributed, where \(A_i\) is binary treatment, \(Y_i\) is the observed outcome, and \(X_i\) is a vector of pretreatment covariates. For a causal interpretation, assume consistency, conditional exchangeability \((Y(1),Y(0))\perp A\mid X\), and positivity \(0<P(A=1\mid X)<1\) on the target population. Assume the propensity-score model \(e(X;\beta)=P(A=1\mid X)\) is correctly specified, its parameter is estimated regularly, and the weighted contributions have finite second moments. Trimming, if used, defines the target population as described in the earlier material on trimming; inference here is for that specified target.

Under these identification assumptions, the ATE is \(\psi=E[Y(1)-Y(0)]\). With \(e_i(\beta)=e(X_i;\beta)\), the inverse-probability-weighted estimator considered here is

$$ \hat\psi_{\mathrm{IPW}} = \frac{1}{n}\sum_{i=1}^n \left\{ \frac{A_iY_i}{e_i(\hat\beta)} - \frac{(1-A_i)Y_i}{1-e_i(\hat\beta)} \right\}. $$

This is the unnormalized, or Horvitz–Thompson, form of the IPW estimator. Define its individual contribution at a generic value of \(\beta\) as \(m_i(\beta)\), the expression inside braces. If the true propensity scores were known, the influence function would be \(m_i-\psi\). Estimating \(\beta\) changes that influence function.

From a Fitted Propensity Score to an Influence Function

Suppose \(\hat\beta\) solves a propensity-score estimating equation \(n^{-1}\sum_i s_i(\hat\beta)=0\), where \(s_i\) is the score contribution. For a logistic model, for example, \(e_i(\beta)=\{1+\exp(-X_i^\mathsf{T}\beta)\}^{-1}\) and \(s_i(\beta)=X_i\{A_i-e_i(\beta)\}\). Define the expected information matrix \(I=E[e_i(1-e_i)X_iX_i^\mathsf{T}]\). Under the stated regularity conditions, the first-order influence function for \(\hat\beta\) is \(I^{-1}s_i\).

Let \(G=E[\partial m_i(\beta)/\partial\beta]\), evaluated at the true parameter. A first-order expansion of the weighted estimate around the true propensity parameter gives the influence function

$$ \phi_i = m_i(\beta)-\psi + G^\mathsf{T}I^{-1}s_i(\beta). $$

The second term is the correction for estimating the propensity-score parameter. In a fitted analysis, its empirical counterpart uses the average derivative \(\hat G\), the fitted information matrix \(\hat I\), and fitted score contributions \(s_i(\hat\beta)\). The estimated influence values are then

$$ \hat\phi_i = m_i(\hat\beta)-\hat\psi_{\mathrm{IPW}} + \hat G^\mathsf{T}\hat I^{-1}s_i(\hat\beta). $$
Variance estimator: The plug-in sandwich estimate of the variance of \(\hat\psi_{\mathrm{IPW}}\) is \(n^{-2}\sum_i\hat\phi_i^2\), and its standard error is the square root of that estimate. Equivalently, center the estimated influence values and use \(n^{-2}\sum_i(\hat\phi_i-\bar{\hat\phi})^2\). Centering is a useful safeguard against small numerical discrepancies; it does not replace the propensity-score correction.

Derivation Through Estimating Equations

The correction follows directly from a joint expansion. Stack the effect and propensity-score equations: the first equation sets the sample average of \(m_i(\beta)-\psi\) to zero, and the second sets the average score to zero. For a logistic propensity model, the expected derivative of the score with respect to \(\beta\) is \(-I\). The expected derivative of the first equation with respect to \(\beta\) is \(G^\mathsf{T}\). Thus the Jacobian of the stacked equations has the block form below.

$$ J= \begin{pmatrix} -1 & G^\mathsf{T}\\ 0 & -I \end{pmatrix}. $$

For one observation, the stacked equation contribution is \((m_i-\psi,\ s_i^\mathsf{T})^\mathsf{T}\). Solving the linearized second equation gives the parameter influence function \(I^{-1}s_i\). Substituting it into the first linearized equation gives

$$ -(\hat\psi-\psi)+ \frac{1}{n}\sum_{i=1}^n(m_i-\psi) + G^\mathsf{T}(\hat\beta-\beta) \ \doteq\ 0, \qquad \phi_i=m_i-\psi+G^\mathsf{T}I^{-1}s_i. $$

Here \(\doteq\) denotes equality to first order, with terms that are negligible at the \(\sqrt n\) scale omitted. This is also the sandwich calculation: the covariance of the stacked equation contributions is placed between the inverse Jacobian and its transpose. Extracting the effect component yields \(E[\phi_i^2]/n\), estimated by the empirical influence-value variance divided by \(n\).

Worked Example: An IPW Estimate With Known Propensity Scores

Consider six hypothetical observations with the treatment, outcome in outcome points, and propensity score shown below. To isolate the weighted-contribution calculation, suppose these propensity scores are known rather than estimated.

Unit\(A_i\)\(Y_i\)\(e_i\)\(m_i=A_iY_i/e_i-(1-A_i)Y_i/(1-e_i)\)
11100.5020.000
2180.4020.000
3160.6010.000
4040.50-8.000
5050.50-10.000
6030.30-4.286

For example, unit 6 contributes \(-3/(1-0.30)=-4.2857\). The total of the six contributions is \(20+20+10-8-10-4.2857=27.7143\), so

$$ \hat\psi_{\mathrm{IPW}}=\frac{27.7143}{6}=4.619. $$

With known propensity scores, the influence-value estimates are the contributions minus their mean. They are approximately \(15.381,\ 15.381,\ 5.381,\ -12.619,\ -14.619,\ -8.905\). Their squared values sum to approximately \(954.354\). Therefore,

$$ \widehat{\mathrm{Var}}(\hat\psi_{\mathrm{IPW}}) = \frac{954.354}{6^2} = 26.510, \qquad SE(\hat\psi_{\mathrm{IPW}})=\sqrt{26.510}=5.149 \quad\text{outcome points}. $$

This large standard error reflects the variability of these weighted contributions, including the contribution from a control unit with propensity score 0.30. The calculation illustrates the variance formula; with only six observations, a large-sample normal approximation should not be treated as precise.

Worked Example: Applying the Estimated-Score Correction

Suppose a hypothetical four-observation fitted analysis has centered raw effect contributions \(q_i=m_i(\hat\beta)-\hat\psi=(-3,-1,1,3)\), and the estimated propensity-score adjustment for each observation is \((0.4,0.2,-0.2,-0.4)\) outcome points. The raw deviations sum to zero, as do the adjustments. Adding each correction gives the estimated influence values:

$$ \hat\phi=(-3+0.4,\ -1+0.2,\ 1-0.2,\ 3-0.4) =(-2.6,\ -0.8,\ 0.8,\ 2.6). $$

Their sum is zero, and their squared values sum to \(6.76+0.64+0.64+6.76=14.80\). Thus the plug-in sandwich variance and standard error are

$$ \widehat{\mathrm{Var}}(\hat\psi) = \frac{14.80}{4^2} = 0.9250, \qquad SE(\hat\psi)=\sqrt{0.9250}=0.9618 \quad\text{outcome points}. $$

The propensity-score adjustment is added to the raw effect contribution. In this example it changes the first value from \(-3\) to \(-2.6\), not to \(-2\). Both the raw values and the corrections happen to sum to zero, so the corrected influence values are centered as well.

Worked Example: A Scalar Sandwich Adjustment

Consider another hypothetical fitted analysis, with outcome measured in points and one propensity-score parameter. Suppose the four centered raw contributions \(q_i=m_i(\hat\beta)-\hat\psi\) and fitted score contributions \(s_i\) are as shown. The fitted analysis also gives \(\hat G=0.4\) points per parameter unit and \(\hat I=2\).

UnitRaw contribution \(q_i\)Score contribution \(s_i\)Correction \((\hat G/\hat I)s_i\)Corrected value \(\hat\phi_i\)
1-2.0-1.0-0.2-2.2
2-1.0-0.5-0.1-1.1
31.00.50.11.1
42.01.00.22.2

The score contributions sum to zero, as expected for a fitted score equation, and the raw effect contributions also sum to zero. The correction multiplier is \(\hat G/\hat I=0.4/2=0.2\). For unit 1, for example, \(-2+0.2(-1)=-2.2\). The corrected values sum to zero and have squared sum \(4.84+1.21+1.21+4.84=12.10\). Consequently,

$$ \widehat{\mathrm{Var}}(\hat\psi) = \frac{12.10}{4^2} = 0.75625, \qquad SE(\hat\psi)=\sqrt{0.75625}=0.8696 \quad\text{outcome points}. $$

The correction here lowers the variance relative to the raw centered contributions, whose squared sum is \(10\), only after considering all corrected values: the corrected sum of squares is \(12.10\), so in fact this adjustment increases the estimated variance from \(10/16=0.625\) to \(0.75625\). The direction is determined by the alignment of score and effect contributions, not by a rule that estimating the propensity score always increases or always decreases uncertainty.

Normalized Estimators and the Estimator Actually Used

The variance calculation must correspond to the point estimator. For example, a Hájek-normalized weighted mean is a ratio, not the unnormalized weighted mean used above. For a generic ratio \(\hat\mu=\bar U/\bar V\), with \(E[V]\ne0\), its first-order contribution when \(U\) and \(V\) are known functions of the observation is \((U_i-\mu V_i)/E[V]\). This follows by expanding the ratio around \(E[U]/E[V]\). If either \(U\) or \(V\) also depends on \(\hat\beta\), its derivative with respect to \(\beta\) contributes to the nuisance-parameter adjustment as well.

In practice, one can stack the estimating equations for the exact normalized effect and propensity-score model, calculate their Jacobian and empirical equation contributions, and form the sandwich variance. Alternatively, derive the corresponding influence function by expansion and estimate its second moment. Using the unnormalized ATE influence function for a normalized estimator, or using the wrong target population after trimming, does not give valid inference for the estimator and target actually reported.

Common Pitfalls and Interpretation

  • Holding fitted scores fixed. Treating \(\hat\beta\) as known leaves out \(G^\mathsf{T}I^{-1}s_i\). Use the fitted-score correction, unless propensity scores truly were fixed externally and the variance target explicitly conditions on them.
  • Using the wrong derivative or sign. The correction follows from the derivative of the weighted contribution and the influence function of the fitted parameter. Check the estimating-equation convention: for logistic maximum likelihood, the expected score derivative is \(-I\), which yields \(\mathrm{IF}_{\hat\beta}=I^{-1}s_i\).
  • Assuming the adjustment must inflate uncertainty. The corrected values can be more or less variable than the raw values. Their cross-product with the correction determines the direction.
  • Confusing a standard error with a causal assumption. A sandwich standard error quantifies sampling uncertainty under the model and regularity conditions; it does not establish exchangeability, positivity, correct specification, or causal identification.

Under the stated conditions, the estimator is asymptotically normal, so a large-sample interval can be formed as \(\hat\psi\pm z_{1-\alpha/2}SE(\hat\psi)\). Its interpretation is repeated-sampling coverage for the specified target under the assumed model, not a probability statement that the fixed causal effect lies in this particular interval. Very small propensity scores can also produce unstable contributions and unreliable normal approximations; overlap diagnostics and the target-population decision remain substantively important.

Key takeaway: For IPW effects with estimated propensity scores, the influence function contains both the weighted outcome contribution and the effect of estimating the propensity parameters. Estimate the variance from the corrected influence values, using the equation system corresponding to the estimator and target population.

Check Your Understanding

Answer these questions using the estimator and assumptions developed above.

  1. What component is omitted if a variance calculation treats fitted propensity scores as known?
  2. For a logistic propensity model, what is the influence function for the fitted parameter in terms of \(I\) and its score contribution?
  3. Why should the influence values be centered, and what should you check if their sum is not close to zero?
  4. In the four-unit correction example, verify the first corrected value and the sum of the four squared corrected values.
  5. Why does a Hájek-normalized estimator require a variance calculation based on a ratio rather than the unnormalized ATE formula?
Clinical Biostats