Skip to contents

Overview

drlate estimates the local average treatment effect (LATE) and the local average treatment effect on the treated (LATT) from observational data with a binary instrument, a continuous/binary/count treatment, and a continuous/binary/count outcome. It is an R port of the Stata drlate command and implements the doubly robust estimators of Słoczyński, Uysal, and Wooldridge (2022, arXiv:2208.01300).

The causal estimand is identified as a ratio: an intent-to-treat (ITT) effect of the instrument on the outcome (the numerator) divided by the effect of the instrument on the treatment, i.e. the first-stage compliance probability (the denominator). All four estimators target this ratio but differ in how the nuisance models are combined:

  • IPWRA (default) – inverse-probability-weighted regression adjustment. The outcome and treatment regressions are fitted with instrument-propensity weights. Doubly robust: consistent if either the instrument propensity score or the outcome/treatment regressions are correctly specified.
  • AIPW – augmented inverse probability weighting. Regressions are fitted unweighted and an IPW augmentation term is added. Also doubly robust.
  • IPW – inverse probability weighting, no outcome/treatment regression (do not supply covariates in those equations).
  • RA – regression adjustment, no instrument propensity score (do not supply covariates in the instrument equation).

For IPW and AIPW the moment conditions may be normalized (normalize = TRUE, the default) or not (normalize = FALSE). For IPWRA and RA the option has no effect. With an inverse-probability-tilting (ps = "ipt") instrument propensity score the weights are normalized by construction.

Standard errors are computed jointly for the instrument propensity score, the outcome regression, the treatment regression, and the causal estimand, by stacking their moment conditions and forming the sandwich variance – the exact analogue of the Stata implementation’s one-step GMM. Cluster-robust and nonparametric bootstrap variances are also available.

The SIPP example data

The Stata help file works the SIPP wage data used in the paper. The numbers below were validated against the original Stata drlate to roughly 1e-8; the chunks reproduce the help-file examples on a locally prepared copy of that data when it is available, and otherwise display the calls together with the Stata-matching estimates.

library(drlate)

sipp_path <- "~/projects/claude/drlate_port/data/sipp_prepped.rds"
have_sipp <- file.exists(sipp_path)
if (have_sipp) {
  d <- as.data.frame(readRDS(sipp_path))
  str(d[, c("lwage", "kwage", "health", "nvstat", "rsncode", "age_5")])
}

The outcome is the log wage lwage (or the wage level kwage for a Poisson outcome, or the binary health for a logit outcome); the treatment is nvstat; the binary instrument is rsncode; and the single covariate is age_5.

LATE, default settings (IPWRA)

IPWRA with a logit instrument propensity score, a logit treatment model, and a linear outcome model. This is Example 1 in the help file (Stata reference cell 1).

fit <- drlate(lwage ~ age_5, nvstat ~ age_5, rsncode ~ age_5, data = d)
fit

The LATE estimate is 0.2179, matching the Stata value 0.21790295 (numerator 0.02110918, denominator 0.09687424).

LATE with an IPT instrument propensity score

Same models, but the instrument propensity score is estimated by inverse probability tilting (Stata reference cell 4).

drlate(lwage ~ age_5, nvstat ~ age_5, rsncode ~ age_5, data = d, ps = "ipt")

Stata LATE: 0.21760460 (numerator 0.02098586, denominator 0.09644035).

LATT with an IPT instrument propensity score

The local average treatment effect on the treated (Stata reference cell 13).

drlate(lwage ~ age_5, nvstat ~ age_5, rsncode ~ age_5, data = d,
       estimand = "latt", ps = "ipt")

Stata LATT: 0.28257842 (numerator 0.02634202, denominator 0.09322021).

LATE with IPW (no covariates in outcome/treatment)

The pure IPW estimator fits no outcome or treatment regression, so those equations carry no covariates (Stata reference cell 46).

drlate(lwage ~ 1, nvstat ~ 1, rsncode ~ age_5, data = d, method = "ipw")

Stata LATE: 0.23416649 (numerator 0.02230956, denominator 0.09527223).

LATE with AIPW, unnormalized

AIPW with unnormalized moment conditions (Stata reference cell 17).

drlate(lwage ~ age_5, nvstat ~ age_5, rsncode ~ age_5, data = d,
       method = "aipw", normalize = FALSE)

Stata LATE: 0.21813480 (numerator 0.02124149, denominator 0.09737781).

LATE with regression adjustment (RA)

RA fits no instrument propensity score, so the instrument equation carries no covariates (Stata reference cell 76).

drlate(lwage ~ age_5, nvstat ~ age_5, rsncode ~ 1, data = d, method = "ra")

Stata LATE: 0.21437710 (numerator 0.02111288, denominator 0.09848479).

Cluster-robust standard errors

Cluster-robust inference leaves the point estimates unchanged and inflates the standard errors (Stata reference cell 82, using a synthetic 50-group cluster id; the same one-step GMM convention as Stata, with no finite-sample multiplier).

d$clid <- 1 + (seq_len(nrow(d)) %% 50)
fit_cl <- drlate(lwage ~ age_5, nvstat ~ age_5, rsncode ~ age_5, data = d,
                 method = "ipwra", vce = "cluster", cluster = "clid")
fit_cl

The clustered LATE standard error is 0.2337, matching the Stata value sqrt(0.05463059) = 0.23373, larger than the robust 0.20753.

Bootstrap standard errors

A nonparametric bootstrap is available via vce = "bootstrap". We use a small number of resamples here for speed and fix a seed for reproducibility; the point estimate is identical to the analytic fit.

fit_bs <- drlate(lwage ~ age_5, nvstat ~ age_5, rsncode ~ age_5, data = d,
                 vce = "bootstrap", boot_reps = 200, boot_seed = 1)
fit_bs

The bootstrap standard error for LATE is in the same range as the analytic robust standard error (0.2075); they need not coincide exactly because they estimate the sampling variance by different routes.

References

Słoczyński, T., Uysal, S. D., and Wooldridge, J. M. (2022). Doubly Robust Estimation of Local Average Treatment Effects Using Inverse Probability Weighted Regression Adjustment. arXiv:2208.01300. https://doi.org/10.48550/arXiv.2208.01300