scoreResponses: Function to score a vector of responses

Description Usage Arguments Value Author(s) Examples

Description

Returns a vector of scores, given a vector of responses to a specific item, a vector with the correct response(s) ("key") and the item id.

Usage

1
scoreResponses(responses, key, item_id)

Arguments

responses

A numeric vector with the responses to an item

key

A numeric vector with the correct response to the item. If the response format is Multiple Choice, this will be a single integer value. If the response format is Free (such as some items in Athena), this will be two values representing the lower and the upper bounds of the range of acceptable responses.

item_id

A character vector with the item id

Value

A numeric score vector with 1 for correct responses, 0 for incorrect responses and NA for missing values

Author(s)

Morgan Strom

Examples

1
2
3
4
5
6
7
8
9
responses <- c(1, 0, 1.05, 0.99, 2)

#Multiple choice with 2 as the correct answer
key <- 2
scoreResponses(responses, key, "test_item")

#Free response with lower bound 1 and upper bound 1.1
key <- c(1, 1.1)
scoreResponses(responses, key, "test_item")

talentlens/talentlens documentation built on May 31, 2019, 2:52 a.m.