kfold | R Documentation |
k-Folds crossvalidation for item selection using any approach implemented in STUART.
kfold(
type,
k = 5,
max.invariance = "strict",
seed = NULL,
seeded.search = TRUE,
...,
remove.details = TRUE
)
type |
A |
k |
The number of folds. |
max.invariance |
The maximum measurement invariance level which will be tested. Currently there are four options: 'configural', 'weak', 'strong', and 'strict' (the default). All levels below |
seed |
The random seed. |
seeded.search |
A |
... |
Arguments passed to the item-selection procedure called with |
remove.details |
A |
The function splits the provided data into k subsets using holdout
and runs the item-selection procedure requested via type
on the training datasets. Validation is performed using crossvalidate
to check for invariance of the measurement models between the training and validation data up to the invariance level provided via max.invariance
. The final item selection is based on the highest value on the objective function in the multiple-group SEM imposing max.invariance
between the training and validation data.
Returns an object of the class stuartKfold
for which specific summary
and print
methods are available. The results are a list.
call |
The called function. |
subtests |
A list containing the names of the selected items and their respective subtests. |
solution |
A list of matrices with the choices made in the global-best solution. |
final |
The results of the estimation of the solution leading to best objective value when cross-validated. |
frequencies |
A list of matrices showing the relative frequencies with which an item was selected across the k-folds. |
full |
A list of the results returned by the k runs of |
crossvalidations |
A list of data.frames showing the fit and model comparisons of all invariance levels up to |
data |
A |
Martin Schultze
holdout
crossvalidate
# k-Folding for a simple bruteforce selection
data(fairplayer)
fs <- list(ra = names(fairplayer)[53:57])
sel <- kfold('bruteforce', k = 2,
data = fairplayer, factor.structure = fs,
capacity = 3, seed = 55635,
cores = 1)
summary(sel)
### longitudinal example with mmas ----
data(fairplayer)
fs <- list(si1 = names(fairplayer)[83:92],
si2 = names(fairplayer)[93:102],
si3 = names(fairplayer)[103:112])
repe <- list(si = c('si1', 'si2', 'si3'))
sel_mmas <- kfold('mmas', k = 3,
data = fairplayer, factor.structure = fs,
repeated.measures = repe, long.invariance = 'strong',
capacity = 3, seed = 55635, pbest = .5,
cores = 1)
summary(sel_mmas)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.