An R6Class that allows repeated crossfitting procedure for an AIPW object

Value

AIPW object

Details

See examples for illustration.

Constructor

Repeated$new(aipw_obj = NULL)

Constructor Arguments

ArgumentTypeDetails
aipw_objAIPW objectan AIPW object

Public Methods

MethodsDetailsLink
repfit()Fit the data to the AIPW object num_reps timesrepfit.Repeated
summary_median()Summary (median) of estimates from the repfit()summary_median.Repeated

Public Variables

VariableGenerated byReturn
repeated_estimatesrepfit()A data.frame of estiamtes form num_reps cross-fitting
repeated_resultssummary_median()A list of sumarised estimates
resultsummary_median()A data.frame of sumarised estimates

Public Variable Details

repeated_estimates

Estimates from num_reps cross-fitting.

result

Summarised estimates from ``repeated_estimates` using median methods.

References

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.

Examples

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()