Icvlasoel: Inner and Outer Cross Validations for Lasso Elastic Net...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Icvlasoel.R

Description

The function does cross validation for Lasso, Elastic net and Ridge regressions models based on fixed or top selected metabolites from CVLasoelacox with classifier validated on a independent sample for the survial analysis and classification. The survival analysis is based on the selected metabolites in the presence or absene of prognostic factors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Icvlasoel(
  Survival,
  Censor,
  Prognostic = NULL,
  Mdata,
  Fold = 3,
  Ncv = 50,
  Nicv = 100,
  Alpha = 0.1,
  TopK,
  Weights = FALSE
)

Arguments

Survival

A vector of survival time with length equals to number of subjects

Censor

A vector of censoring indicator

Prognostic

A dataframe containing possible prognostic(s) factor and/or treatment effect to be used in the model.

Mdata

A large or small metabolic profile matrix. A matrix with metabolic profiles where the number of rows should be equal to the number of metabolites and number of columns should be equal to number of patients.

Fold

number of folds to be used for the cross validation. Its value ranges between 3 and the numbe rof subjects in the dataset

Ncv

Number of validations to be carried out. The default is 25.

Nicv

Number of validations to be carried out for the inner loop. The default is 5.

Alpha

The mixing parameter for glmnet (see glmnet). The range is 0<= Alpha <= 1. The Default is 1

TopK

Top list of metabolites. Usually this can be mostly selected metabolites by function CVLasoelacox.

Weights

A logical flag indicating if a fixed or non-fixed weights should be used during the classifier evaluations. Default is FALSE.

Details

The function does cross validation for Lasso, Elastic net and Ridge regressions models based on fixed or top selected metabolites from CVLasoelacox with classifier validated on a independent sample for the survial analysis and classification. The survival analysis is based on the selected metabolites in the presence or absene of prognostic factors. The classifier is built on the weights obtain from the inner cross validations results and it is tested on out-of-bag data. These weights can be fixed or can be updated at each outer iteration. If weights are not fixed then patients are classified using majority votes. Otherwise, weights obtained from the inner cross validations are summarized by mean weights and used in the classifier. Inner cross validations are performed by calling to function CVLasoelacox. Hazard ratio for low risk group is estimated using out-of-bag data.

Value

A object of class fcv is returned with the following values

Runtime

A vector of runtime for each iteration measured in seconds.

Fold

Number of folds used.

Ncv

Number of outer cross validations used.

Nicv

Number of inner cross validations used.

TopK

The Top metabolites used

HRInner

A 3-way array in which first, second, and third dimensions correspond to Nicv, 1, and Ncv respectively. This contains estimated HR for low risk group on the out of bag data.

HRTest

A matrix of survival information for the test dataset based on the out of bag data. It has three columns representing the estimated HR, the 95% lower confidence interval and the 95% upper confidence interval.

Weight

A matrix with columns equals number of TopK metabolites and rows Ncv. Note that Weights are estimated as colMeans of coefficients matrix return from the inner cross validations.

Author(s)

Olajumoke Evangelina Owokotomo, olajumoke.owokotomo@uhasselt.be

Ziv Shkedy

See Also

CVLasoelacox, EstimateHR, glmnet, Lasoelacox

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## FIRSTLY SIMULATING A METABOLIC SURVIVAL DATA
Data = MSData(nPatients = 100, nMet = 150, Prop = 0.5)

## USING THE FUNCTION
Results = Icvlasoel(Data$Survival, Data$Censor, Data$Prognostic,
t(Data$Mdata), Fold = 3,Ncv = 5, Nicv = 7, Alpha = 1,
TopK = colnames(Data$Mdata[,80:100]), Weights = FALSE)

## NUMBER OF Outer CV
Results@Ncv
## NUMBER OF Inner CV
Results@Nicv

## HR of low risk group for the Inner CV
Results@HRInner

## HR of low risk group for the out of bag dataset
Results@HRTest

## The weight for the analysis
Results@Weight

MetabolicSurv documentation built on June 11, 2021, 9:06 a.m.