ctitem {classicaltest}R Documentation

Classical test theory item statistics

Description

Calculates several item statistics, including: item means, frequencies, proportions, and correlations between item responses and the total score.

Usage

ctitem(
  x,
  key,
  navalue = NA,
  wt = NULL,
  itemcategories = NULL,
  administered = NULL,
  itemscores = NULL
)

Arguments

x

a data frame or matrix.

key

a vector or a list indicating the keys to score the data. If answers can only be right or wrong use a vector. If partial credits are allowed, use a list where the first element contains the keys for full credits, and next elements contain progressively the partial credit information. If a test has a combination of full credit and partial credit items, leave the full credit items as NAs in the keys for partial credit.

navalue

a single value indicating the score of NAs.

wt

a vector with total weights. Default is NULL.

itemcategories

a vector indicating all the possible categories for all items. If NULL, possible categories will be derived from data.

administered

a logical matrix indicating which items were administered. The dimensions should be the same as x. If NULL all items are considered administered.

itemscores

a numeric vector indicating all the possible scores for all items. If NULL, possible scores will be derived from data.

Value

A list.

Examples


# Data preparation
## Random weights creation
set.seed(1919)
wt <- sample(x = 1:4, size = nrow(dichodata), replace = TRUE)

# Item analysis for multiple choice items
ctitem(x = dichodata, key = dichokey, itemcategories = c('A','B','C','D'), wt = wt)



[Package classicaltest version 0.7.5 Index]