ctperson | R Documentation |
Calculates persons statistics given a data frame (or matrix) of corrected data. Including sum scores, number of administered items, number of answered items, proportion of correct items (for dichotomous data), and mean score by item (for polytomous data).
ctperson(x, administered = NULL)
x |
a data frame or matrix of corrected data (only containing 1s, 0s, and NAs). |
administered |
a logical matrix indicating which items where administered.
The dimensions should be the same as |
A data frame with person statistics.
# Data preparation
## Corrected data
corr <- correct(x = dichodata, key = dichokey, navalue = NA)
## Random administered matrix
set.seed(1919)
admin <- sample(x = 0:1, size = nrow(corr)*ncol(corr), replace = TRUE, prob = c(.05,.95))
admin <- matrix(data = as.logical(admin),nrow = nrow(corr))
head(admin)
# Person statistics with all items administered
ex1 <- ctperson(x = corr)
head(ex1)
# Person statistics with NOT all items administered
ex2 <- ctperson(x = corr, administered = admin)
head(ex2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.