Description Usage Arguments Value Examples
This function predicts optimal treatment of new subjects for a cross-validated mpersonalized model.
1 2 3 |
object |
A fitted "mp_cv" object returned by "mpersonalized_cv" function |
newx |
Covariate matrix of new patients. If not supplied, by default the prediction
is for the original dataset in the "mp_cv" object. Prediction results will differ
based on whether |
weight |
A weight vector for the overall recommendation, only needed when |
overall_rec |
A logical value. If |
... |
not used |
A list object with two elements. Similar to the returned value of predict.mp
, but now it only predicts
for the optimal parameter penalty.
opt_treatment |
If |
benefit_score |
Benefit scores computed from g_1, …, g_K. Similar to structure of |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(123)
sim_dat = simulated_dataset(n = 200, problem = "meta-analysis")
Xlist = sim_dat$Xlist; Ylist = sim_dat$Ylist; Trtlist = sim_dat$Trtlist
# fit different rules with group lasso penalty
mp_cvmod_diff = mpersonalized_cv(problem = "meta-analysis",
Xlist = Xlist, Ylist = Ylist, Trtlist = Trtlist,
penalty = "GL", single_rule = FALSE)
newx = matrix(rnorm(100 * mp_cvmod_diff$number_covariates), nrow = 100)
# predict on newx
pred_new = predict(object = mp_cvmod_diff, newx = newx, overall_rec = TRUE)
# predict on old dataset
pred_old = predict(object = mp_cvmod_diff)
set.seed(NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.