coda_glmnet_longitudinal {coda4microbiome} | R Documentation |
coda_glmnet_longitudinal
Description
Microbial signatures in longitudinal studies. Identification of a set of microbial taxa whose joint dynamics is associated with the phenotype of interest. The algorithm performs variable selection through penalized regression over the summary of the log-ratio trajectories (AUC). The result is expressed as the (weighted) balance between two groups of taxa.
Usage
coda_glmnet_longitudinal(
x,
y,
x_time,
subject_id,
ini_time,
end_time,
covar = NULL,
lambda = "lambda.1se",
nvar = NULL,
alpha = 0.9,
nfolds = 10,
showPlots = TRUE,
coef_threshold = 0
)
Arguments
x |
abundance matrix or data frame in long format (several rows per individual) |
y |
outcome (binary); data type: numeric, character or factor vector |
x_time |
observation times |
subject_id |
subject id |
ini_time |
initial time to be analyzed |
end_time |
end time to be analyzed |
covar |
data frame with covariates (default = NULL) |
lambda |
penalization parameter (default = "lambda.1se") |
nvar |
number of variables to use in the glmnet.fit function (default = NULL) |
alpha |
elastic net parameter (default = 0.9) |
nfolds |
number of folds (default = 10) |
showPlots |
if TRUE, shows the plots (default = FALSE) |
coef_threshold |
coefficient threshold, minimum absolute value of the coefficient for a variable to be included in the model (default =0) |
Value
in case of binary outcome: list with "taxa.num","taxa.name","log-contrast coefficients","predictions","apparent AUC","mean cv-AUC","sd cv-AUC","predictions plot","signature plot","trajectories plot"
Author(s)
M. Calle - T. Susin
Examples
data(ecam_filtered, package = "coda4microbiome") # load the data
ecam_results<-coda_glmnet_longitudinal (x=x_ecam[,(1:4)],y= metadata$diet,
x_time= metadata$day_of_life, subject_id = metadata$studyid, ini_time=0,
end_time=60,lambda="lambda.min",nfolds=4, showPlots=FALSE)
ecam_results$taxa.num