Skip to contents

These functions count the number of correct responses. countcorrect() counts the correct responses regardless of errors, countcorrect2() subtracts the number of errors from number of correct responses, sumweighted() counts the correct responses by giving a weight for different responses, sumscore() adds up the score for each response.

Usage

countcorrect(data, .by = NULL, .input = NULL, .extra = NULL)

countcorrect2(data, .by = NULL, .input = NULL, .extra = NULL)

sumweighted(data, .by = NULL, .input = NULL, .extra = NULL)

sumscore(data, .by = NULL, .input = NULL, .extra = NULL)

Arguments

data

Raw data of class data.frame.

.by

The column name(s) in data used to be grouped by. If set to NULL (default), all data will be treated as from one subject and there will be no grouping columns in the value returned.

.input, .extra

Each is a list() containing all the input variable names and special values for certain variables. See more in the details section.

Value

An object with the same class as data contains following values:

nc

Count of correct responses. For countcorrect().

nc_cor

Corrected count of correct responses (subtracting number of errors). For countcorrect2().

nc_weighted

Count of weighted correct responses. For sumweighted().

nc_score

Sum of scores. For sumscore().