Learn R Programming

survJamda (version 1.1.4)

groups.cv: Split a data set for cross-validation

Description

Define the folds of cross-validation.

Usage

groups.cv(n, ngroup, censor)

Arguments

n
Sample size of a data set.
ngroup
Number of folds of cross-validation.
censor
Vector of censoring status. In the censoring status vector, 1 = event occurred, 0 = censored.

Value

The folds of cross-validation.

Warning

This function is not called by the user directly.

Details

The function avoids allocating only censored patients to the testing set. At least one patient having experienced an event is needed for the applicability of the Cox proportional hazard model.