Description Usage Arguments Value Examples
*k*-Fold Cross-Validation
1 2 | crossValidation(responseData, modelTypes, folds = 10, replications = 1,
indicator = TRUE, ..., seed = NULL, type = "person")
|
responseData |
The initial, full sample data as a matrix of item responses. |
modelTypes |
A character vector specifying the model types to be compared. Uses the 'TAM' package format, so must be one of the following: "1PL", "2PL", "PCM", "PCM2", "RSM", "GPCM", and "2PL.groups". |
folds |
An integer value indicating the number of cross-validation folds to split the data into during the cross-validation process. If specified as 'folds=nrow(responseData)' (or some other way equivalently), results in the leave-one-out cross-validation procedure (a.k.a., when *k*=*n*, *k*-fold CV == *n*-fold CV == LOOCV). |
replications |
The number of replications of the *k*-fold CV procedure to perform, with data being split into the *k*-fold groups randomly each time. |
indicator |
A logical value that controls the progress printing. |
... |
Further arguments to be passed to the 'tam' function. |
seed |
Either a positive integer setting the random seed, or 'NULL'. |
type |
A character vector specifying whether the validation treats the "person" or the "item" as the unit of observation. Default is "person". |
An object of class "cvIRT" with the following values:
seed |
The random seed that produced the results. |
trainData |
A list of each replications' training data. |
testData |
A list of each replications' testing data. |
testLik |
A matrix of the loglikelihood values estimated on the testing data for each model within each holdout replication. |
nModelParams |
A matrix of the number model parameters estimated on the training data within each holdout replication. |
AIC |
A matrix of the AIC value for each holdout replication, as well as the mean value across each replication. |
AICc |
A matrix of the AICc value for each holdout replication, as well as the mean value across each replication. |
BIC |
A matrix of the BIC value for each holdout replication, as well as the mean value across each replication. |
-2 log-Likelihood Ratio Test |
A list of the log-likelihood ratio test statistics, degrees of freedom, and p-values for each model comparison and each replication, as well as the test using the mean test statistics and degrees of freedom. If only one model is used, returns 'NULL'. |
warnings |
A character vector of any warnings incurred while the method runs. |
time |
A vector of the start and end times of the function. |
1 | #None.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.