prep_data_cv | R Documentation |
This function turns data prepared for hbam()
into a list of K versions, where each version includes a different vector identifying holdout-data.
prep_data_cv(data, K = 10, seed = 1)
data |
A list of data produced by |
K |
An integer above 2, specifying the number of folds to use in the analysis. Defaults to 10. |
seed |
An integer passed on to |
A list of K data objects where each version includes a different vector identifying holdout-data.
# Loading and re-coding ANES 1980 data:
data(LC1980)
LC1980[LC1980 == 0 | LC1980 == 8 | LC1980 == 9] <- NA
self <- LC1980[, 1]
stimuli <- LC1980[, -1]
dat <- prep_data(self, stimuli)
# Prepare data for cross-validation:
dat_cv <- prep_data_cv(dat, K = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.