View source: R/remap.distance.R
| remap.distance | R Documentation |
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.
remap.distance(data, message = TRUE)
data |
the response data to remap as a data.frame or matrix |
message |
logical; print message information pertaining to which items were remapped? |
Phil Chalmers rphilip.chalmers@gmail.com
Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v048.i06")}
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.