Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tam_downcode

Downcoding an Item Response Dataset


Description

Recodes item categories in a data frame such that each item has values 0,1,…,K_i.

Usage

tam_downcode(dat)

Arguments

dat

Data frame containing item responses

Value

List with following entries

dat

Recoded dataset

rec

Recoding table

Examples

#############################################################################
# EXAMPLE 1: Downcoding in a toy example
#############################################################################

#-- simulate some toy data
set.seed(989)
# values to be sampled
vals <- c(NA, 0:6)
# number of persons and items
N <- 10; I <- 5
dat <- as.data.frame(matrix(NA, nrow=N, ncol=I))
colnames(dat) <- paste0("I",1:I)
for (ii in 1L:I){
    dat[,ii] <- sample(vals, size=N, replace=TRUE)
}

#-- apply downcoding
res <- TAM::tam_downcode(dat)
dat <- res$dat   # extract downcoded dataset
rec <- res$rec   # extract recoded table

TAM

Test Analysis Modules

v3.6-45
GPL (>= 2)
Authors
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>), Thomas Kiefer [aut], Margaret Wu [aut]
Initial release
2021-04-22 14:35:52

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.