View source: R/crossvalidate.R
crossvalidate | R Documentation |
Cross-validate a measurement model obtained from STUART.
crossvalidate(
selection,
old.data,
new.data,
max.invariance = "strict",
filename = NULL
)
selection |
An object of class |
old.data |
A |
new.data |
A |
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 |
filename |
The stem of the filenames used to save inputs, outputs, and data files when |
Returns a list containing the data.frame
comparison
and an object containing the model results of the four different invariance assumptions.
comparison |
A |
models |
A list of the four model results either of class |
Martin Schultze
holdout
, mmas
, bruteforce
# Split data into two halves
data(fairplayer)
half1 <- fairplayer[1:72,]
half2 <- fairplayer[73:143,]
# Simple example from bruteforce
fs <- list(ra = names(fairplayer)[53:57])
sel <- bruteforce(half1, fs, 3,
cores = 1) # number of cores set to 1
# Validation
crossvalidate(sel, half1, half2)
# Using the 'holdout' function for data split
data(fairplayer)
split <- holdout(fairplayer, seed = 55635)
# Simple example from bruteforce
fs <- list(ra = names(fairplayer)[53:57])
sel <- bruteforce(split, fs, 3,
cores = 1) # number of cores set to 1
# Validation
crossvalidate(sel, split)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.