View source: R/classicaltest.R
classicaltest | R Documentation |
Calculates several item and person statistics following
ctitem()
, and ctperson()
.
classicaltest(
x,
key = NULL,
categories = NULL,
wt = NULL,
listwise = FALSE,
recScore = TRUE,
administered = NULL
)
x |
a data frame or matrix. For multiple choice items, columns can be numeric or strings and keys should be provided. For polytomous items, all columns should be numeric. |
key |
a vector indicating the keys to score the data. If |
categories |
a vector indicating all possible categories.
If |
wt |
a numeric vector of total weights. Default is |
listwise |
only consider complete data (remove rows with NAs).
Defaulft is |
recScore |
a logical value indicating if the total score for
should be calculated based only on valid values. Thus,
if |
administered |
a logical matrix indicating which items where administered.
The dimensions should be the same as |
A list with item and person statistics.
data(dichodata)
data(polydata)
data(dichokey)
# Data preparation
## Random weights creation
set.seed(1919)
wt <- sample(x = 1:4, size = nrow(dichodata), replace = TRUE)
# Item and person analysis for multiple choice items
classicaltest(x = dichodata, key = dichokey, categories = c('A','B','C','D'), wt = wt)
# Item and person analysis for polytomous items
classicaltest(x = polydata, key = NULL, wt = wt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.