ctperson: Classical test theory person statistics

View source: R/ctperson.R

ctpersonR Documentation

Classical test theory person statistics

Description

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).

Usage

ctperson(x, administered = NULL)

Arguments

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 x. If NULL all items are considered administered.

Value

A data frame with person statistics.

Examples

# 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)


classicaltest documentation built on Oct. 28, 2024, 5:06 p.m.