Description Usage Arguments Value Author(s) References Examples
The key2binary
function will convert response pattern data to a
dichotomous format, given a response key.
1 | key2binary(fulldata, key)
|
fulldata |
an object of class |
key |
a vector or matrix consisting of the 'correct' response to the items. Each
value/row corresponds to each column in |
Returns a numeric matrix with all the response patterns in dichotomous format
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. doi: 10.18637/jss.v048.i06
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | data(SAT12)
head(SAT12)
key <- c(1,4,5,2,3,1,2,1,3,1,2,4,2,1,5,3,4,4,1,4,3,3,4,1,3,5,1,3,1,5,4,5)
dicho.SAT12 <- key2binary(SAT12, key)
head(dicho.SAT12)
# multiple scoring keys
key2 <- cbind(c(1,4,5,2,3,1,2,1,3,1,2,4,2,1,5,3,4,4,1,4,3,3,4,1,3,5,1,3,1,5,4,5),
c(2,3,NA,1,rep(NA, 28)))
dicho.SAT12 <- key2binary(SAT12, key2)
# keys from raw character responses
resp <- as.data.frame(matrix(c(
"B","B","D","D","E",
"B","A","D","D","E",
"B","A","D","C","E",
"D","D","D","C","E",
"B","C","A","D","A"), ncol=5, byrow=TRUE))
key <- c("B", "D", "D", "C", "E")
d01 <- key2binary(resp, key)
head(d01)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.