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()
Run the code above in your browser using DataLab