Section 5 Box 3a & 3b: Get predictions under both treatments, \(A = 0\) and \(A = 1\)

\(Q^0(A=1,L)\) predictions:

ObsData.noYA1 <- ObsData.noY
ObsData.noYA1$A <- 1
ObsData$Pred.initialQ0.Y1 <- SuperLearner(Y=ObsData$Y.bounded, 
                       X=ObsData.noY, 
                       cvControl = list(V = 3),
                       SL.library=c("SL.glm", "tmle.SL.dbarts2", "SL.glmnet"),
                       method="method.CC_nloglik", 
                       family="gaussian",
                       newX = ObsData.noYA1)$SL.predict
summary(ObsData$Pred.initialQ0.Y1)
##        V1         
##  Min.   :0.00100  
##  1st Qu.:0.04331  
##  Median :0.05550  
##  Mean   :0.05414  
##  3rd Qu.:0.06580  
##  Max.   :0.11085

\(Q^0(A=0,L)\) predictions:

ObsData.noYA0 <- ObsData.noY
ObsData.noYA0$A <- 0
ObsData$Pred.initialQ0.Y0 <- SuperLearner(Y=ObsData$Y.bounded, 
                       X=ObsData.noY, 
                       cvControl = list(V = 3),
                       SL.library=c("SL.glm", "tmle.SL.dbarts2", "SL.glmnet"),
                       method="method.CC_nloglik", 
                       family="gaussian",
                       newX = ObsData.noYA0)$SL.predict
summary(ObsData$Pred.initialQ0.Y0)
##        V1         
##  Min.   :0.00100  
##  1st Qu.:0.03665  
##  Median :0.04840  
##  Mean   :0.04709  
##  3rd Qu.:0.05815  
##  Max.   :0.10932