An R6Class that allows repeated crossfitting procedure for an AIPW object
AIPW
object
See examples for illustration.
Repeated$new(aipw_obj = NULL)
Methods | Details | Link |
repfit() | Fit the data to the AIPW object num_reps times | repfit.Repeated |
summary_median() | Summary (median) of estimates from the repfit() | summary_median.Repeated |
Variable | Generated by | Return |
repeated_estimates | repfit() | A data.frame of estiamtes form num_reps cross-fitting |
repeated_results | summary_median() | A list of sumarised estimates |
result | summary_median() | A data.frame of sumarised estimates |
Zhong Y, Kennedy EH, Bodnar LM, Naimi AI (2021). AIPW: An R Package for Augmented Inverse Probability Weighted Estimation of Average Causal Effects. American Journal of Epidemiology.
Robins JM, Rotnitzky A (1995). Semiparametric efficiency in multivariate regression models with missing data. Journal of the American Statistical Association.
Chernozhukov V, Chetverikov V, Demirer M, et al (2018). Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal.
Kennedy EH, Sjolander A, Small DS (2015). Semiparametric causal inference in matched cohort studies. Biometrika.
library(SuperLearner)
library(ggplot2)
#create an object
aipw_sl <- AIPW$new(Y=rbinom(100,1,0.5), A=rbinom(100,1,0.5),
W.Q=rbinom(100,1,0.5), W.g=rbinom(100,1,0.5),
Q.SL.library="SL.mean",g.SL.library="SL.mean",
k_split=2,verbose=FALSE)
#create a repeated crossfitting object from the previous step
repeated_aipw_sl <- Repeated$new(aipw_sl)
#fit repetitively (stratified = TRUE will use stratified_fit() method in AIPW class)
repeated_aipw_sl$repfit(num_reps = 3, stratified = FALSE)
#summarise the results
repeated_aipw_sl$summary_median()