elastic {ER} | R Documentation |
Elastic-net modeling of ER objects.
Description
Elastic-net modeling of ER objects.
Usage
elastic(er, ...)
## S3 method for class 'ER'
elastic(
er,
effect,
alpha = 0.5,
newdata = NULL,
validation,
segments = NULL,
measure = measure,
family = family,
...
)
Arguments
er |
Object of class |
... |
Additional arguments for |
effect |
The effect to be used as response. |
alpha |
The elasticnet mixing parameter. |
newdata |
Optional new data matrix for prediction. |
validation |
Optional validation parameters. |
segments |
number of segments or list of segments (optional) |
measure |
Type of performance summary, default = 'class' (see |
family |
Type of model response, default = 'multinomial'. |
See Also
Examples
## Multiple Sclerosis data
data(MS, package = "ER")
er <- ER(proteins ~ MS * cluster, data = MS)
elasticMod <- elastic(er, 'MS', validation = "CV")
sum(elasticMod$classes == MS$MS)
plot(elasticMod) # Model fit
plot(elasticMod$glmnet.fit) # Coefficient trajectories
# Select all proteins with non-zeros coefficients
coefs <- coef(elasticMod,s='lambda.min',exact=TRUE)
(selected <- rownames(coefs[[1]])[unique(unlist(lapply(coefs,
function(x)which(as.vector(x) != 0))))][-1])
## Diabetes data
data(Diabetes, package = "ER")
er.Dia <- ER(transcriptome ~ surgery * T2D, data = Diabetes)
elasticMod <- elastic(er.Dia, 'T2D', validation = "LOO")
[Package ER version 1.1.1 Index]