esti_mean_treat {HOIFCar} | R Documentation |
Estimate treatment effect and the corresponding variance estimation on the treatment arm using different covariate adjustment methods.
Description
Implements a unified framework for comparing covariate adjustment method for completely randomized experiments under randomization-based framework.
Usage
esti_mean_treat(X, Y, A, H = NULL)
Arguments
X |
The n by p covariates matrix. |
Y |
Vector of n dimensional observed response. |
A |
Vector of n dimensional treatment assignment. |
H |
The n by n hat projection matrix corresponding to X. |
Value
A list with two named vectors:
- point_est
Point estimates for all estimators:
unadj
: Unadjusted estimatordb
: Debiased estimator (Lu et al., 2023)adj2c
: HOIF-inspired debiased estimator (Zhao et al., 2024), the same asdb
adj2
: HOIF-motivated adjusted estimator (Zhao et al., 2024)adj3
: Bias-free adjusted estimator based onadj2
lin
: Covariate-adjusted estimator (Lin, 2013)lin_db
: Debiased estimator with population leverage scores (Lei, 2020)
- var_est
Variance estimates corresponding to each estimator:
unadj
: Variance estimate for unadjusted estimatordb
: Variance estimate for debiased estimator (Lu et al., 2023)adj2c
: Variance foradj2c
, using formulas given in (Lu et al., 2023)adj2c_v2
: Conservative variance foradj2c
(Zhao et al., 2024)adj2
: Variance foradj2
, with formulas motivated by (Lu et al., 2023)adj2_v2
: Conservative variance foradj2
(Zhao et al., 2024)adj3
: Variance foradj3
, with formulas motivated by (Lu et al., 2023)adj3_v2
: Conservative variance foradj3
(Zhao et al., 2024)lin
: HC3-type variance for Lin's (2013) estimatorlin_db
: HC3-type variance for Lei's (2020) estimator
References
Lin, W. (2013). Agnostic notes on regression adjustments to experimental data: Reexamining Freedman's critique. The Annals of Statistics, Vol. 7(1), 295–318, doi:10.1214/12-AOAS583.
Lei, L. and Ding, P. (2020) Regression adjustment in completely randomized experiments with a diverging number of covariates. Biometrika, Vol. 108(4), 815–828, doi:10.1093/biomet/asaa103.
Lu, X., Yang, F. and Wang, Y. (2023) Debiased regression adjustment in completely randomized experiments with moderately high-dimensional covariates. arXiv preprint, arXiv:2309.02073, doi:10.48550/arXiv.2309.02073.
Zhao, S., Wang, X., Liu, L. and Zhang, X. (2024) Covariate Adjustment in Randomized Experiments Motivated by Higher-Order Influence Functions. arXiv preprint, arXiv:2411.08491, doi:10.48550/arXiv.2411.08491.
Examples
set.seed(100)
n <- 500
p <- n * 0.3
beta <- runif(p, -1 / sqrt(p), 1 / sqrt(p))
X <- mvtnorm::rmvt(n, sigma = diag(1, p), df = 3)
Y1 <- as.numeric(X %*% beta)
Y0 <- rep(0, n)
pi1 <- 2/3
n1 <- ceiling(n * pi1)
ind <- sample(n, size = n1)
A <- rep(0, n)
A[ind] <- 1
Y <- Y1 * A + Y0 * (1 - A)
Xc_svd <- svd(X)
H <- Xc_svd$u %*% t(Xc_svd$u)
result_ls <- esti_mean_treat(X, Y, A, H)
point_est <- result_ls$point_est
var_est <- result_ls$var_est
print(paste0('True mean treat:', round(mean(Y1), digits = 3), '.'))
print('Absolute bias:')
print(abs(point_est - mean(Y1)))
print('Estimate variance:')
print(var_est)