cCV: Generate phenotype vectors for cross validation

Description Usage Arguments Value See Also Examples

View source: R/ctools.R

Description

This function takes a phenotype vector and generates folds * reps masked vectors for cross validation. Every vector has as many additional missing values as length(y) / folds.

Usage

1
cCV(y,folds=5,reps=1,matrix=FALSE,seed=NULL)

Arguments

y

vector of phenotypes - may already contain missing values

folds

integer, number of folds

reps

integer, number of replications

matrix

boolean, if TRUE function returns a matrix rather than a list

seed

numeric scalar, seed for sample

Value

List (matrix) with as many items (columns) as folds * reps

See Also

clmm, get_pred, get_cor

Examples

1
2
3
4
5
6
7
## Not run: 
# generate random data
rand_data(500,5000)

y_CV <- cCV(y,folds=5,reps=20)

## End(Not run)

Example output

Loading required package: Matrix
Loading required package: pedigreemm
Loading required package: lme4

cpgen documentation built on May 2, 2019, 8:15 a.m.