Description Usage Arguments Details Value References Examples
View source: R/mpersonalized.R
This function solves the personalized medicine problem by extending the contrast classificaiton framework (Zhang, 2012). By adding proper penalty to the original classification loss, variable selection could be implemented and estimation efficiency could be improved. Computation algorithm differs based on the penalty function employed, but mainly through ADMM algorithm, glmnet package and SGL package. This function is also flexible enough to let user choose whether different classification rules or a single rule should be estimated for multiple studies/outcomes.
1 2 3 4 5 6 7 8 9 10 11 12 13 | mpersonalized(problem = c("meta-analysis", "multiple outcomes"), X, Trt,
P = NULL, Xlist, Ylist, Trtlist, Plist = replicate(length(Xlist),
NULL, simplify = FALSE), typelist = replicate(length(Xlist),
"continuous", simplify = FALSE), penalty = c("none", "lasso", "GL",
"SGL", "fused", "SGL+SL", "lasso+fused", "GL+fused", "SGL+fused"),
lambda1 = NULL, lambda2 = NULL, tau0 = NULL,
single_rule_lambda = NULL, num_lambda1 = ifelse(!is.null(lambda1),
length(lambda1), 10), num_lambda2 = ifelse(!is.null(lambda2),
length(lambda2), 10), num_tau0 = ifelse(!is.null(tau0), length(tau0),
11), min_tau = 0.01,
num_single_rule_lambda = ifelse(!is.null(single_rule_lambda),
length(single_rule_lambda), 50), alpha = NULL, single_rule = FALSE,
admm_control = NULL, contrast_builder_control = NULL)
|
problem |
A character string specifiy whether user want to solve "meta-analysis" or
"multiple outcomes" problem. For |
X |
Covariate matrix that should be supplied when |
Trt |
Treatment vector that should be supplied when |
P |
Propensity score vector when |
Xlist |
A list object that should be supplied when |
Ylist |
When |
Trtlist |
A list object that should be supplied when |
Plist |
A list object that should be supplied when |
typelist |
A list object with kth element denoting the type of outcome corresponding
to the kth element in |
penalty |
For different rules, the penalty could be "none", "lasso", "GL", "SGL", "fused",
"lasso+fused", "GL+fused", "SGL+fused", or "SGL+SL". For single rule, the penalty could be "none" or "lasso".
User should always input |
lambda1 |
λ_1 in the framework of different rules. If not supplied, a default sequence will be computed. |
lambda2 |
λ_2 in the framework of different rules. If not supplied, a default sequence will be computed. |
tau0 |
Parameter τ_0 for the |
single_rule_lambda |
λ_{single} in the framework of single rule. |
num_lambda1 |
If |
num_lambda2 |
If |
num_tau0 |
If |
min_tau |
If |
num_single_rule_lambda |
If |
alpha |
α in the framework of different rules. If not supplied, a default value
will be used depending on |
single_rule |
A logical value, whether the single rule framework is used. Deafult is |
admm_control |
A list of parameters which user can specify to control the admm algorithm.
In |
contrast_builder_control |
A list of parameters which user can specify to control estimation of
contrast function. In |
Assume the total number of studies/outcomes is K and we denote the contrast estimator for the kth study/outcome as \hat{C}_k and the corresponding recommendation rule as g_k.
If we want different rules for each study/outcome, this function solves meta-analysis/multiple outcomes problems for personalized medicine based on the framework
\min_{g_1,…,g_K} \frac{1}{2}∑_{k=1}^K ∑_{i=1}^{n_k}\frac{|\hat{C}_k(X_{i})|}{∑_{i=1}^{n_k}|\hat{C}_k(X_{i})|}\bigl [1\{\hat{C}_k(X_{i})>0\}-g_k(X_{i})\bigr]^2 + h(g_1,…,g_K)
Here the regularization function h is of the form of a sum of sparse group lasso and fused lasso penalty
h = (1-α)λ_1√{q} ∑_{j=1}^p \|\boldsymbol{β_j}\|_2+α λ_1 ∑_{j=1}^p \|\boldsymbol{β_j}\|_1+ λ_2 ∑_{j=1}^p ∑_{1≤ a < b ≤ K}|β_{ja}-β_{jb}|
where \boldsymbol{β_j}=(β_{j1},…,β_{jK})
By setting λ_1, λ_2, α differently, different penalties can be obtained.
If λ_1, λ_2 \ne 0 and α \ne 0 or 1, the penalty is "SGL+fused".
If λ_1, λ_2 \ne 0 and α = 0, the penalty is "GL+fused".
If λ_1, λ_2 \ne 0 and α = 1, the penalty is "lasso+fused".
If λ_1 = 0, λ_2 \ne 0, the penalty is "fused".
If λ_1 \ne0, λ_2 = 0 and α \ne 0 or 1, the penalty is "SGL".
If λ_1 \ne0, λ_2 = 0 and α = 0, the penalty is "GL".
If λ_1 \ne0, λ_2 = 0 and α = 1, the penalty is "lasso".
If λ_1, λ_2 = 0, there is no penalty.
If τ_0 is very large for penalty = "SGL+SL"
, all coefficients across all studies will be equal.
If τ_0 = 0 for penalty = "SGL+SL"
, an error will be returned. However, if τ_0 is close to 0,
more heterogeneity across studies will be preferred
On the other hand, if we would like to fit a single rule for all studies/outcomes, we let g_1 = …= g_K and solve the following problem instead
\min_{g} \frac{1}{2}∑_{k=1}^K ∑_{i=1}^{n_k}\frac{|\hat{C}_k(X_{i})|}{∑_{i=1}^{n_k}|\hat{C}_k(X_{i})|}\bigl [1\{\hat{C}_k(X_{i})>0\}-g(X_{i})\bigr]^2 + h(g_1,…,g_K) + λ_{single} \|β\|_1
Depending on the value of λ_{single}
If λ_{single} \ne 0, the penalty is "lasso".
If λ_{single} = 0, there is no penalty.
An S3 object of class "mp", which contains the information of the fitted model. It could be supplied to some other functions in mperosnalized package for further analysis or prediction.
penalty_parameter_sequence |
A matrix object with each row denoting a configuration of the penalty parameters. |
interceptlist |
A list object with each element denoting a vector of intercepts. The kth element
corresponds to the kth row in |
betalist |
A list object with each element denoting a coefficient matrix. The kth element
corresponds to the kth row in |
number_covariates |
Number of candidate covariates considered. |
number_studies_or_outcomes |
Number of studies if |
Zhang, B. and Tsiatis, A. A. and Davidian, M. and Zhang, M. and Laber, E.(2012) Estimating optimal treatment regimes from a classification perspective, Stat, 1(1):103-114.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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)
# fir a single rule with lasso penalty
mp_mod_single = mpersonalized(problem = "meta-analysis",
Xlist = Xlist, Ylist = Ylist, Trtlist = Trtlist,
penalty = "lasso", single_rule = TRUE)
set.seed(NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.