getCVids | R Documentation |
This function creates a string of integers which will be used for pointing to the right subsets of data for cross validation of regression objects
getCVids(data, folds, block = NULL, seed = NULL)
data |
data used in regression model |
folds |
integer number of validation data sets |
block |
column in data indicating the blocking structure for cross-validation (if |
seed |
integer number used to set the seed of the fold generation. By default this is set to |
The function returns a random sequence of 1:folds of the same length as observations in data. The seed used for generation is stored in the attributes (s.eed
).
LAS Scott-Hayward, University of St Andrews
# load data
data(ns.data.re)
CVids<-getCVids(ns.data.re, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.