maqteavg implements model averaging for treatment-effect estimation with multiple user-specified covariate sets. It is designed for the paper Model Averaging in Semiparametric Estimation of Quantile Treatment Effects.
The package supports:
- Quantile treatment effects (QTE) and quantile treatment effects on the treated (QTT).
- Average treatment effects (ATE) and average treatment effects on the treated (ATT), following the same covariate-selection and model-averaging logic as Lu (2015).
- Two averaging schemas for QTE/QTT and ATE/ATT:
schema = "target": average the model-specific treatment-effect estimators.schema = "ps": average model-specific propensity scores and then plug the averaged propensity score into the treatment-effect estimator.
- Four weighting rules:
method = "maqte": AMSE-based model averaging.method = "smooth": smoothed averaging based on diagonal criteria.method = "single": single-best specification based on the smallest diagonal criterion.method = "equal": equal-weighted averaging.
- Unconfoundedness signature plots for QTE/QTT diagnostics.
- Finite-grid Wald tests for candidate covariate sets.
The default call estimates QTE with the AMSE-based target-estimator averaging rule (estimand = "QTE", schema = "target", method = "maqte").
# Once on GitHub:
# install.packages("remotes")
# remotes::install_github("LI-Lu-SoB/maqteavg")quadprog is suggested for quadratic programming. If it is not installed, the package uses an internal projected-gradient fallback.
library(maqteavg)
# Toy data from the simulation design. The true QTE is one at all quantiles.
dat <- maqte_toy_data(n = 800, seed = 1, kappa = 5)
sets <- list(
Set1 = c("x0"),
Set2 = c("x0", "x1"),
Set3 = c("x0", "x2"),
Set4 = c("x3", "x5"),
Set5 = c("x4", "x5"),
Union = c("x0", "x1", "x2", "x3", "x4", "x5")
)
# QTE model averaging. Returns all eight combinations:
# target/ps schemas x maqte/smooth/single/equal rules.
fit <- ma_effects(
data = dat,
outcome = "y",
treatment = "d",
covariate_sets = sets,
estimand = "QTE",
taus = c(0.25, 0.50, 0.75),
method = "all",
schema = "both",
criterion = "local",
valid_sets = c("Set1", "Set2", "Set3")
)
print(fit)
table_ma_effects(fit)
# ATE/ATT can be estimated with the same interface.
fit_ate <- ma_ate(dat, "y", "d", sets, estimand = "ATE",
method = "all", schema = "both")candidate_sets <- sets[1:5]
union_set <- sets$Union
sig <- signature_plot(
data = dat,
outcome = "y",
treatment = "d",
candidate_sets = candidate_sets,
union_set = union_set,
pct_grid = seq(0.25, 0.75, by = 0.05),
tau_grid = seq(0.10, 0.90, by = 0.05),
plot = TRUE
)
wald <- signature_wald_test(sig, pct = 0.50, component = "both")
table_wald(wald)
cat(diagnostic_guidance(wald))The signature plot is a visual diagnostic. It shows whether candidate covariate sets behave similarly to the union-set benchmark over covariate percentiles. The Wald test is a formal finite-grid joint diagnostic at a chosen evaluation point. Rejection should be interpreted relative to the union benchmark and the auxiliary rank-invariance condition: it indicates that the candidate set and the union benchmark cannot both satisfy the diagnostic restrictions.
When all candidate covariate sets are viewed as valid, target-estimator averaging primarily reduces the leading variance term of the treatment-effect estimator. When some candidate covariate sets may be mildly misspecified, the local criterion incorporates a bias-variance trade-off. In applications, a useful workflow is to construct economically meaningful candidate covariate sets, inspect the signature plots and Wald tests, and then report model-specific and model-averaged estimates under the valid and/or locally invalid frameworks.
Lu, X. (2015). A covariate selection criterion for estimation of treatment effects. Journal of Business & Economic Statistics, 33(4), 506-522.
Firpo, S., Galvao, A. F., Hounyo, U., & Lu, L. (2025). Model Averaging in Semiparametric Estimation of Quantile Treatment Effects. Available at SSRN 6050500.