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

getSplitMethod

Input for data splitting algorithms


Description

Parse hyperparameters for data splitting algorithm

Usage

getSplitMethod(split.method, B, N, M, seed)

Arguments

split.method

A character string specifying the algorithm for data splitting:

  • "loob" leave one out bootstrap

  • "bootcv" bootstrap cross validation

  • "cv5" 5-fold cross validation

  • "loocv" leave one out cross validation aka N-1 fold cross validation

  • "632plus" Efron's .632+ bootstrap

B

Number of repetitions of bootstrap or k-fold cross-validation

N

Sample size

M

Subsample size. Default is N (no subsampling).

seed

Integer passed to set.seed. If not given or NA no seed is set.

Value

A list with the following elements:

  • split.methodName: the print name of the algorithm

  • split.method: the internal name of the algorithm

  • index: the index for data splitting. For bootstrap splitting this is a matrix with B columns and M rows identifying the in-bag subjects. For k-fold cross-validation this is a matrix with B columns identifying the membership to the k groups.

  • k: the k of k-fold cross-validation

  • N: the sample size

  • M: the subsample size

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

See Also

Score

Examples

# 3-fold crossvalidation
getSplitMethod("cv3",B=4,N=37)

# bootstrap with replacement
getSplitMethod("loob",B=4,N=37)

# bootstrap without replacement
getSplitMethod("loob",B=4,N=37,M=20)

riskRegression

Risk Regression Models and Prediction Scores for Survival Analysis with Competing Risks

v2020.12.08
GPL (>= 2)
Authors
Thomas Alexander Gerds [aut, cre], Paul Blanche [ctb], Rikke Mortensen [ctb], Marvin Wright [ctb], Nikolaj Tollenaar [ctb], John Muschelli [ctb], Ulla Brasch Mogensen [ctb], Brice Ozenne [aut] (<https://orcid.org/0000-0001-9694-2956>)
Initial release

We don't support your browser anymore

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