Description Usage Arguments Note Examples
View source: R/01hdnommodels.R
Automatic fused lasso model selection for highdimensional Cox models, evaluated by crossvalidated likelihood.
1 2 3 
x 
Data matrix. 
y 
Response matrix made by 
nfolds 
Fold numbers of crossvalidation. 
lambda1 
Vector of lambda1 candidates.
Default is 
lambda2 
Vector of lambda2 candidates.
Default is 
maxiter 
The maximum number of iterations allowed.
Default is 
epsilon 
The convergence criterion.
Default is 
seed 
A random seed for crossvalidation fold division. 
trace 
Output the crossvalidation parameter tuning
progress or not. Default is 
parallel 
Logical. Enable parallel parameter tuning or not,
default is FALSE. To enable parallel tuning, load the

... 
other parameters to 
The crossvalidation procedure used in this function is the
approximated crossvalidation provided by the penalized
package. Be careful dealing with the results since they might be more
optimistic than a traditional CV procedure. This crossvalidation
method is more suitable for datasets with larger number of observations,
and a higher number of crossvalidation folds.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  library("survival")
library("rms")
# Load imputed SMART data; only use the first 120 samples
data("smart")
x = as.matrix(smart[, c(1, 2)])[1:120, ]
time = smart$TEVENT[1:120]
event = smart$EVENT[1:120]
y = Surv(time, event)
# Fit Cox model with fused lasso penalty
fit = hdcox.flasso(x, y,
lambda1 = c(1, 10), lambda2 = c(0.01),
nfolds = 3, seed = 11)
# Prepare data for hdnom.nomogram
x.df = as.data.frame(x)
dd = datadist(x.df)
options(datadist = "dd")
# Generate hdnom.nomogram objects and plot nomogram
nom = hdnom.nomogram(
fit$flasso_model, model.type = "flasso",
x, time, event, x.df, pred.at = 365 * 2,
funlabel = "2Year Overall Survival Probability")
plot(nom)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.