flowchart LR S(Super Learner) --> l(Logistic regression) S --> g(LASSO) S --> m(Multivariate Adaptive Regression Splines MARS) style S fill:#90EE90;
We show an example using a super learner using 3 candidate learners.
If you want to know more about Super Learner, look at other tutorials.
flowchart LR S(Super Learner) --> l(Logistic regression) S --> g(LASSO) S --> m(Multivariate Adaptive Regression Splines MARS) style S fill:#90EE90;
The super learning approach is fundamentally different from the pure ML or LASSO approach discussed earlier. Here all of the candidate learners are using exposure
as their outcome while running the model.
<- names(out3$autoselected_covariate_df[,-1])
proxy.list length(proxy.list)
#> [1] 100
<- paste0(investigator.specified.covariates, collapse = "+")
covform <- paste0(proxy.list, collapse = "+")
proxyform <- paste0(c(covform, proxyform), collapse = "+")
rhsformula <- as.formula(paste0("exposure", "~", rhsformula)) ps.formula
We work with all proxies
require(WeightIt)
<- weightit(ps.formula,
W.out data = hdps.data,
estimand = "ATE",
method = "super",
SL.library = c("SL.glm",
"SL.glmnet",
"SL.earth"))
#> Loading required namespace: glmnet
#> Loading required namespace: earth
Propensity score model fit based on super learning algorithm to be able to calculate the inverse probability weights.
summary(W.out$ps)
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.006352 0.250715 0.430072 0.448121 0.628521 0.982149
<- as.formula(paste0("outcome", "~", "exposure"))
out.formula <- glm(out.formula,
fit data = hdps.data,
weights = W.out$weights,
family= binomial(link = "logit"))
<- summary(fit)$coef["exposure",
fit.summary c("Estimate",
"Std. Error",
"Pr(>|z|)")]
<- confint(fit, level = 0.95)["exposure", ]
fit.ci <- c(fit.summary, fit.ci)
fit.summary_with_ci.sl round(fit.summary_with_ci.sl,2)
#> Estimate Std. Error Pr(>|z|) 2.5 % 97.5 %
#> 0.47 0.04 0.00 0.39 0.54
Summary of results (log-OR).