R/utils.R
predict_density.Rd
Helper function to predict from a super learner fit on the hazard scale to obtain a prediction on the density scale
predict_density( sl_fit_conditional, sl_fit_marginal, how_predict, all_mediator_values, a_val, validC, M1, M2, valid_n, stratify )
sl_fit_conditional | A fitted SuperLearner object for the M1 | M2, C, A regression |
---|---|
sl_fit_marginal | A fitted SuperLearner object for the M2 | C, A regression |
how_predict | Needed to figure out how to predict from model. Possible choices are "SuperLearner", "single_algo", and "glm" |
all_mediator_values | data.frame of all observed mediator values |
a_val | Relevant treatment level |
validC | Confounders in the validation set |
M1 | All M1 values |
M2 | All M2 values |
valid_n | Number of obs in validation set |
stratify | Were sl_fit's stratified? |