Learn R Programming

dexter (version 0.8.5)

keys_to_rules: Derive scoring rules from keys

Description

For multiple choice items that will be scored as 0/1, derive the scoring rules from the keys to the correct responses

Usage

keys_to_rules(keys, include_NA_rule = FALSE)

Arguments

keys

A data frame containing columns item_id, nOptions, and key (the spelling is important). See details.

include_NA_rule

whether to add an option 'NA' (which is scored 0) to each item

Value

A data frame that can be used as input to start_new_project

Details

This function might be useful in setting up the scoring rules when all items are multiple-choice and scored as 0/1. (Hint: Because the order in which the scoring rules is not important, one can use the function to generate rules for many MC items and then append per hand the rules for a few complex items.)

The input data frame must contain the exact name of each item, the number of options, and the key. If the keys are all integers, it will be assumed that responses are coded as 1 through nOptions. If they are all uppercase letters, it is assumed that responses are coded as A,B,C,... All other cases result in an error.