mult.choice | R Documentation |
It converts multiple choice items to a matrix of binary responses.
mult.choice(data, correct)
data |
a |
correct |
a vector of length |
a matrix of 0/1 values indicating wrong/correct answers.
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
dat <- data.frame(It1 = sample(4, 100, TRUE), It2 = sample(4, 100, TRUE), It3 = sample(5, 100, TRUE), It4 = sample(5, 100, TRUE), It5 = sample(4, 100, TRUE), It6 = sample(5, 100, TRUE)) dat[] <- lapply(dat, function (x) { x[sample(100, 4)] <- NA; x }) crct <- c(3, 2, 5, 3, 4, 5) #################### mult.choice(dat, crct)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.