View source: R/difficulty_index.R
difficultyindex | R Documentation |
Difficulty index, and corrected difficulty index, for binary variables and two level factors.
difficultyindex(x, success = NULL, noptions = NULL)
x |
a vector that records if the answers are correct or wrong. It can also be a vector of scores with 0 being the lowest score. |
success |
the (only) value taken as correct answer. In the case of scores, this value is always taken as the maximum, regardless of the value supplied for this parameter. |
noptions |
is the number of options in each question. It is used to calculate the corrected difficulty index. It must be integer and at least 2. If it is not an integer it will be rounded. When it is not provided, the uncorrected difficulty index is calculated. |
Computes the difficulty index for binary variables, discrete numeric variable, or two level factor. For binary variables, 1 is taken as correct. For factor type variables, the last level is taken as correct. If the variable is discrete, they are considered to represent scores starting at 0. It can also be applied to any numeric or factor variable taking into account that any value that differs from the given as success will be considered as failure. This includes NA values.
Difficulty index or corrected difficulty index.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.