17 TMLE
17.1 Obtain OR with superlearner
summary(W.out$ps)
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.006352 0.250715 0.430072 0.448121 0.628521 0.982149
= c("SL.glm", "SL.glmnet","SL.earth")
SL.library <- names(out3$autoselected_covariate_df[,-1])
proxy.list <- hdps.data[,c(investigator.specified.covariates,
ObsData.noYA proxy.list)]
We use the same propensity score model that was fitted based on super learning algorithm.
<- tmle::tmle(Y = hdps.data$outcome,
tmle.fit A = hdps.data$exposure,
W = ObsData.noYA,
family = "binomial",
V = 3,
Q.SL.library = SL.library,
g1W = W.out$ps)
If you want to know more about TMLE, look at other tutorials.
<- tmle.fit$estimates$OR
estOR.tmle
estOR.tmle#> $psi
#> [1] 1.565526
#>
#> $CI
#> [1] 1.407437 1.741373
#>
#> $pvalue
#> [1] 1.548568e-16
#>
#> $log.psi
#> [1] 0.4482221
#>
#> $var.log.psi
#> [1] 0.002949814
Summary of results (OR).
17.2 Obtain OR without superlearner
summary(W.out0$ps)
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.0000003 0.2445201 0.4308397 0.4481213 0.6321148 0.9975438
= c("SL.glm")
SL.library <- names(out3$autoselected_covariate_df[,-1])
proxy.list <- hdps.data[,c(investigator.specified.covariates,
ObsData.noYA proxy.list)]
We use the same propensity score model that was fitted based on hdPS variables via logistic regression (no other learners).
<- tmle::tmle(Y = hdps.data$outcome,
tmle.fit0 A = hdps.data$exposure,
W = ObsData.noYA,
family = "binomial",
V = 3,
Q.SL.library = SL.library,
g1W = W.out$ps)
<- tmle.fit0$estimates$OR
estOR.tmle0
estOR.tmle0#> $psi
#> [1] 1.549417
#>
#> $CI
#> [1] 1.390011 1.727104
#>
#> $pvalue
#> [1] 2.675267e-15
#>
#> $log.psi
#> [1] 0.4378789
#>
#> $var.log.psi
#> [1] 0.003068198
Summary of results (OR).