Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

elastic

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

...

Additional arguments for pls::cvsegments.

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 glmnet)

family

Type of model response, default = 'multinomial'.

See Also

ER, pls and confints.

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")

ER

Effect + Residual Modelling

v1.1.0
GPL
Authors
Kristian Hovde Liland [aut, cre], Ellen Færgestad Mosleth [ctb]
Initial release
2021-03-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.