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

remap.distance

Remap item categories to have integer distances of 1


Description

The mirt package's estimation setup requires that all item responses have spaces equal to 1 (e.g., a Likert scale scored from 1 through 5). In the event that categories are missing the categories must be re-coded. This function is automatically called by the package estimation functions (e.g., mirt), however for convince this function has been extracted for users to better understand the remapping consequences.

Usage

remap.distance(data, message = TRUE)

Arguments

data

the response data to remap as a data.frame or matrix

message

logical; print message information pertaining to which items were remapped?

Author(s)

References

Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. doi: 10.18637/jss.v048.i06

Examples

# category 2 for item 1 missing
dat <- Science
dat[,1] <- ifelse(Science[,1] == 2, 1, Science[,1])
apply(dat, 2, table)

# mirt() automatically remaps categories
mod <- mirt(dat, 1)
coef(mod, simplify=TRUE)

# this is the transformed data used by mirt()
remap_dat <- remap.distance(dat)
apply(remap_dat, 2, table)

mirt

Multidimensional Item Response Theory

v1.33.2
GPL (>= 3)
Authors
Phil Chalmers [aut, cre] (<https://orcid.org/0000-0001-5332-2810>), Joshua Pritikin [ctb], Alexander Robitzsch [ctb], Mateusz Zoltak [ctb], KwonHyun Kim [ctb], Carl F. Falk [ctb], Adam Meade [ctb], Lennart Schneider [ctb], David King [ctb], Chen-Wei Liu [ctb], Ogreden Oguzhan [ctb]
Initial release

We don't support your browser anymore

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