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

sco

Score a multiple choice test


Description

Given a key, score a multiple choice test, i.e. recode the original choices to right (1) or wrong (0). Missing responses are treated as wrong.

Usage

sco(choices, key, na.false = FALSE)

Arguments

choices

The original responses to the items in the test: persons as rows, items as columns. May contain NA.

key

A vector containing the key (correct answers) to the items in choices. If not given, the function will check if all data are either 0, 1, or NA: if yes, NA are recoded as 0, else an error message is returned.

na.false

Recode non-responses to false responses?

Value

A matrix of responses scored 0=wrong 1=correct, and possibly NA

Author(s)

Ivailo Partchev

Examples

res <- sco(Unscored, key=c(2,3,1,1,4,1,2,1,2,3,3,4,3,4,2,2,4,3))

irtoys

A Collection of Functions Related to Item Response Theory (IRT)

v0.2.1
GPL (>= 2)
Authors
Ivailo Partchev [aut, cre], Gunter Maris [aut], Tamaki Hattori [ctb]
Initial release
2017-12-15

We don't support your browser anymore

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