Abstract
Conduct inference on the sample average treatment effect for a matched (observational) dataset with a continuous treatment. Equipped with calipered non-bipartite matching, bias-corrected sample average treatment effect estimation, and covariate-adjusted variance estimation. Matching, estimation, and inference methods are described in Frazier, Heng and Zhou (2024) doi:10.48550/arXiv.2409.11701.
Introduction
In causal inference, randomized controlled trials (RCTs) remain the gold standard. However, researchers frequently encounter observational data where treatment assignment is non-random. To approximate the conditions of an RCT, matching techniques are employed to pair similar individuals and isolate the effect of varying treatment levels.
While matching for binary treatments (treated vs. control) is well-established, continuous treatments—such as drug dosage or exposure duration—present unique challenges. Without a clear control group, identifying comparable units across a spectrum of treatment values is mathematically complex. Furthermore, standard estimators often suffer from bias when matches are imperfect, and traditional variance estimates can be unreliable. The nbpInference R package addresses these issues by implementing a robust framework for estimating the Sample Average Treatment Effect (SATE) in continuous treatment settings.
Methodology
The nbpInference package facilitates a three-stage pipeline based on the research of Frazier, Heng, and Zhou (2024).
1. Calipered Non-Bipartite Matching
Unlike bipartite matching, which partitions units into two distinct pools, non-bipartite matching evaluates the entire dataset to identify optimal pairs. The package utilizes a "caliper" mechanism to ensure match quality, preventing the algorithm from pairing units whose treatment assignment probabilities are excessively divergent.
2. The P-Matrix and Density Estimation
A critical component of the workflow is the make.pmatrix function, which estimates conditional treatment assignment densities. This matrix represents the probability that one unit in a pair receives a higher treatment dose than the other, given their shared characteristics. This model-based approach ensures the matching process is "causally aware."
3. Bias-Corrected Neyman Estimation
Residual differences between matched pairs can skew results even with high-quality matching. The bias.corrected.neyman function adjusts the SATE estimate to account for these discrepancies, providing a more accurate reflection of the true treatment effect.
4. Covariate-Adjusted Variance
To prevent overestimating statistical significance, the package includes covAdj.variance. This conservative estimator accounts for the covariates used during matching, ensuring that confidence intervals are robust.
Simulation and Benchmarking
The package includes built-in data generation functions, generate.data.dose and generate.data.dose2, which simulate datasets with varying numbers of covariates. These tools allow users to benchmark the package's performance against known ground truths, replicating the simulation studies presented in the original 2024 paper.
Key Insights and Results
The core innovation of nbpInference lies in its ability to handle continuous treatments through pairwise comparisons of "more treated" vs. "less treated" units. Key results from the underlying methodology include:
- Reduced Bias: The bias-corrected estimator significantly outperforms traditional Neyman estimators when covariates are strongly correlated with both treatment and outcome.
- Improved Coverage: Covariate-adjusted variance leads to confidence intervals that more reliably contain the true treatment effect compared to methods that ignore the matching architecture.
Limitations
Despite its strengths, the package has limitations. Non-bipartite matching is computationally intensive, potentially limiting its application to massive datasets without specialized hardware. Additionally, the quality of inference is dependent on the accuracy of the make.pmatrix function; model misspecification in treatment assignment probabilities can reduce the effectiveness of subsequent bias correction.
Conclusion
nbpInference provides a comprehensive toolkit for researchers working with continuous treatments in observational studies. By integrating advanced matching, bias correction, and variance estimation, it offers a path toward more reliable causal insights from complex real-world data.
Summary updated