mpersonalized: A General Framework to Solve Personalized Medicine in the...

Description Usage Arguments Details Value References Examples

View source: R/mpersonalized.R

Description

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.

Usage

 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)

Arguments

problem

A character string specifiy whether user want to solve "meta-analysis" or "multiple outcomes" problem. For problem = "meta-analysis", user should also supply Xlist, Ylist, Trtlist. For problem = "multiple outcomes", user should supply X, Ylist, Trt.

X

Covariate matrix that should be supplied when problem = "multiple outcomes" with rows indicating subjects and columns indicating covariates.

Trt

Treatment vector that should be supplied when problem = "multiple outcomes", which should be coded as 0 or 1.

P

Propensity score vector when problem = "multiple outcomes". If not supplied, then study is treated as randomzied trial and the propensity score is estimated as the proportion of 1's in Trt for every subject.

Xlist

A list object that should be supplied when problem = "meta-analysis", with kth element denoting the covariate matrix of study k.

Ylist

When problem = "meta-analysis", Ylist should be a list object with kth element denoting the response vector of study k. When problem = "multiple outcomes", Ylist should be a list object with kth element denoting the kth outcome.

Trtlist

A list object that should be supplied when problem = "meta-analysis", with kth element denoting the treatment vector of study k (coded as 0 or 1).

Plist

A list object that should be supplied when problem = "meta-analysis", with kthe element denoting the propensity score vector of study k. If not supplied, then each study is treated as randomized trial and the corresponding propensity score is estimated as the proportion of 1's in the kth element of Trtlist for all subjects.

typelist

A list object with kth element denoting the type of outcome corresponding to the kth element in Ylist. Each element could be "continuous" or "binary".

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 penalty and then supply correponding penalty parameters sequence if needed. Default option is "none".

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 "SGL+SL" penalty in the framework of different rules. If not supplied, a default sequence will be computed.

single_rule_lambda

λ_{single} in the framework of single rule.

num_lambda1

If lambda1 is not specified by user, the user can still specify the length of the lambda1 sequence. The default length is 10.

num_lambda2

If lambda2 is not specified by user, the user can still specify the length of the lambda2 sequence. The default length is 10.

num_tau0

If tau0 is not specified by user, the user can still specify the length of the tau0 sequence. The default length is 11.

min_tau

If tau0 is not specified by user, min_tau specifies the minimum value for τ_0. The largest value for τ_0 will be 1 / min_tau.

num_single_rule_lambda

If single_rule_lambda is not specified, user could still specify the length of the single_rule_lambda sequence. The default length is 50.

alpha

α in the framework of different rules. If not supplied, a default value will be used depending on penalty.

single_rule

A logical value, whether the single rule framework is used. Deafult is FALSE.

admm_control

A list of parameters which user can specify to control the admm algorithm. In admm_control, the following parameters can be supplied: abs.tol, absolute tolerance; rel.tol, relative tolerance; maxit, maximum number of iterations; rho, Lagrangian parameter.

contrast_builder_control

A list of parameters which user can specify to control estimation of contrast function. In contrast_builder_control, the following parameters could be supplied: eff_aug, a logical value whether efficiency augmentation should be implemented; response_model, a character string specify what outcome model to use if eff_aug = TRUE, response_model could be "lasso" or "linear"; contrast_builder_folds, the number of folds used in cross validation when response_model = "lasso".

Details

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.

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}

Value

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 penalty_parameter_sequence.

betalist

A list object with each element denoting a coefficient matrix. The kth element corresponds to the kth row in penalty_parameter_sequence.

number_covariates

Number of candidate covariates considered.

number_studies_or_outcomes

Number of studies if problem = "meta-analysis" or number of outcomes if problem = "multiple outcomes".

References

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.

Examples

 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)

chenshengkuang/MetaPersonalized documentation built on May 28, 2019, 7:16 p.m.