grridgeCV {GRridge} | R Documentation

## Returns the cross-validated predictions

### Description

Returns the cross-validated predictions for a `grridge` logistic, linear or Cox regression.

### Usage

    grridgeCV(grr, highdimdata, response, outerfold = length(response),
               fixedfolds = TRUE, recalibrate=FALSE)

### Arguments

`grr` | List. Output of GRridge function.
`highdimdata` | Matrix or numerical data frame. Contains the primary data of the study. Columns are samples, rows are variables (features).
`response` | Factor, numeric, binary or survival. Response values. The number of response values should equal `ncol(highdimdata)`.
`outerfold` | Integer. Fold used for cross-validation loop.
`fixedfolds` | Boolean. Use fixed folds for cross-validation?
`recalibrate` | Boolean. Should the prediction model be recalibrated on the test samples? Only implemented for logistic and linear regression with only penalized covariates.

### Details

This convenience function returns cross-validated predictions from `grridge`, including those from ordinary (logistic) ridge regression. It can be used to compute ROC-curves. About `recalibrate`: this option allows to compare recalibrated models, but only if the test sample size is large enough. See `predict.grridge`

### Value

For linear and logistic regression: A matrix containing the predictions. The first column contains the sample indices, the second the prediction by ordinary ridge, the third the predictions by group-regularized ridge, the fourth (optional) the predictions by group-regularized ridge plus selection. Finally, it may contain predictions by lasso and/or a regression model with unpenalized covariates only. For Cox regression: a list with three components. First, a matrix with the linear predictions, in the same format as above. Second, a list of survival probability matrices (one for each prediction model), the rows of which indicate the individuals and the columns indicate the observed times. Third, a vector with the observed times.

### Author(s)

Mark A. van de Wiel

### References

Mark van de Wiel, Tonje Lien, Wina Verlaat, Wessel van Wieringen, Saskia Wilting. (2016). Better prediction by use of co-data: adaptive group-regularized ridge regression. Statistics in Medicine, 35(3), 368-81.

### See Also

For logistic regression: ROC-curves: `roc`. AUC: `auc`. GRridge: `link{grridge}`.

### Examples

    # load data objects
    data(dataFarkas)

    # In this example, we provide one partition only
    # see "CreatePartition" for examples in creating multiple partitions
    firstPartition <- CreatePartition(CpGannFarkas)

    # the optimum lambda2 is provided in this example
    # worth to try:
    # grFarkas <- grridge(datcenFarkas,respFarkas,firstPartition,monotone=FALSE)
    # grFarkas$optl
    # grFarkas <- grridge(datcenFarkas,respFarkas, optl=5.680087, firstPartition,monotone=FALSE)

    ###
    # grFarkasCV <- grridgeCV(grFarkas,datcenFarkas,respFarkas,outerfold=10)

[Package GRridge version 1.4.0 Index]