Description Usage Arguments Details Value Examples
This function predicts optimal treatment of new subjects for a mpersonalized model. If different rules are used in the fitting procedure, an overall treatment recommendation based on all stuides/outcomes could be provided together with optimal treatments for each study/outcome.
1 2 3 |
object |
A fitted "mp" object returned by "mpersonalized" |
newx |
Covariate matrix of new patients. If not supplied, by default the prediction
is for the original dataset in the "mp" object. Notice: when |
weight |
A weight vector for the overall recommendation, only needed when |
overall_rec |
A logical value. If |
... |
not used |
This function predicts for each penalty parameter in the
penalty_parameter_sequence
of the "mp" object. The overall recommended treatment is
given as an weighted average of the recommended treatments from each study/outcome, and the weight
can be specified by user.
A list object of two elements. .
opt_treatment |
A list object with each element denoting the prediction based on a penalty parameter
configuration in |
benefit_score |
A list object of benefit scores computed from g_1, …, g_K. Similar structure as
|
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 SGL penalty for this meta-analysis problem
mp_mod_diff = mpersonalized(problem = "meta-analysis",
Xlist = Xlist, Ylist = Ylist, Trtlist = Trtlist,
penalty = "SGL", single_rule = FALSE)
newx = matrix(rnorm(100 * mp_mod_diff$number_covariates), nrow = 100)
# predict on newx
pred_new = predict(object = mp_mod_diff, newx = newx, overall_rec = TRUE)
# predict on old dataset
pred_old = predict(object = mp_mod_diff)
set.seed(NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.