summary(W.out$ps)
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.01795 0.22327 0.39066 0.42094 0.59780 0.99230
SL.library = c("SL.glm", "SL.glmnet","SL.earth")
proxy.list <- names(out2[-1])
# out3$autoselected_covariate_df[,-1] for hybrid
# out2 is from step2$recurrence_data
ObsData.noYA <- hdps.data[,c(investigator.specified.covariates,
proxy.list)]16 TMLE
16.1 Obtain OR with superlearner
We use the same propensity score model that was fitted based on super learning algorithm.
tmle.fit <- tmle::tmle(Y = hdps.data$outcome,
A = hdps.data$exposure,
W = ObsData.noYA,
family = "binomial",
V.Q = 3,
V.g = 3,
Q.SL.library = SL.library,
g1W = W.out$ps)If you want to know more about TMLE, look at other tutorials.
estOR.tmle <- tmle.fit$estimates$OR
estOR.tmle
#> $psi
#> [1] 1.43478
#>
#> $log.psi
#> [1] 0.3610113
#>
#> $CI
#> [1] 1.234739 1.667229
#>
#> $pvalue
#> [1] 2.448685e-06
#>
#> $var.log.psi
#> [1] 0.005869015
#>
#> $bs.var.log.psi
#> [1] NA
#>
#> $bs.CI.twosided
#> [1] NA NA
#>
#> $bs.CI.onesided.lower
#> [1] -Inf NA
#>
#> $bs.CI.onesided.upper
#> [1] NA InfSummary of results (OR).
16.2 Obtain OR without superlearner
summary(W.out0$ps)
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.01333 0.21054 0.38992 0.42094 0.61259 0.99414
SL.library = c("SL.glm")
proxy.list <- names(out2[-1])
# out3$autoselected_covariate_df[,-1] for hybrid
# out2 is from step2$recurrence_data
ObsData.noYA <- hdps.data[,c(investigator.specified.covariates,
proxy.list)]We use the same propensity score model that was fitted based on hdPS variables via logistic regression (no other learners).
tmle.fit0 <- tmle::tmle(Y = hdps.data$outcome,
A = hdps.data$exposure,
W = ObsData.noYA,
family = "binomial",
V.Q = 3,
V.g = 3,
Q.SL.library = SL.library,
g1W = W.out$ps)estOR.tmle0 <- tmle.fit0$estimates$OR
estOR.tmle0
#> $psi
#> [1] 1.414274
#>
#> $log.psi
#> [1] 0.346616
#>
#> $CI
#> [1] 1.216181 1.644632
#>
#> $pvalue
#> [1] 6.731435e-06
#>
#> $var.log.psi
#> [1] 0.005927678
#>
#> $bs.var.log.psi
#> [1] NA
#>
#> $bs.CI.twosided
#> [1] NA NA
#>
#> $bs.CI.onesided.lower
#> [1] -Inf NA
#>
#> $bs.CI.onesided.upper
#> [1] NA InfSummary of results (OR).
#> Warning: `geom_errorbarh()` was deprecated in ggplot2 4.0.0.
#> ℹ Please use the `orientation` argument of `geom_errorbar()` instead.
#> `height` was translated to `width`.
