powered by
Helper function to generate cross-validation folds that can be used by cv.SPQR.
cv.SPQR
createFolds.SPQR(Y, nfold, stratified = FALSE)
The response vector.
The number of cross-validation folds.
If TRUE, stratified folds based on quantiles of Y are generated.
TRUE
Y
A list of size nfold containing indices of the observations for each fold.
nfold
# NOT RUN { set.seed(919) n <- 1000 X <- rbinom(n, 1, 0.5) Y <- rnorm(n, X, 0.8) folds <- createFolds.SPQR(Y, nfold = 5) # }
Run the code above in your browser using DataLab