Learn R Programming

mirt (version 0.1-19)

key2binary: Convert response patterns to binary data

Description

The key2binary function will convert response pattern data to a dichotomous format, given a response key.

Usage

key2binary(fulldata, key)

Arguments

fulldata
an object of class data.frame, matrix, or table with the response patterns
key
a vector consisting of the 'correct' response to the items. Each value corresponds to each column in fulldata

Value

  • Returns a numeric matrix with all the response patterns in dichotomous format.

Examples

Run this code
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)

Run the code above in your browser using DataLab