Learn R Programming

circumplex (version 2.0.1)

score: Score circumplex scales from item responses

Description

Calculate mean scores on circumplex scales from item responses by using the scoring instructions stored in an instrument object from the package.

Usage

score(
  data,
  items,
  instrument,
  na.rm = TRUE,
  prefix = "",
  suffix = "",
  append = TRUE
)

Value

A data frame that matches .data except that new variables are appended that contain mean scores on each variable included in key.

Arguments

data

Required. A data frame or matrix containing at least circumplex scales.

items

Required. The variable names or column numbers for the variables in .data that contain all the circumplex items from a single circumplex measure, in ascending order from item 1 to item N.

instrument

Required. An instrument object from the package. To see the available circumplex instruments, use instruments().

na.rm

Optional. A logical that determines if missing values should be omitted from the calculation of scores (default = TRUE). When set to TRUE, scales with missing data are essentially calculated with mean imputation.

prefix

Optional. A string to include at the beginning of the newly calculated scale variables' names, before Abbrev from key and suffix (default = "").

suffix

Optional. A string to include at the end of the newly calculated scale variables' names, after Abbrev from key and prefix (default = "").

append

Optional. A logical that determines whether the calculated score variables will be appended to data or returned on their own (default = TRUE).

See Also

Other tidying functions: ipsatize(), norm_standardize(), self_standardize()

Examples

Run this code
data("raw_iipsc")
score(raw_iipsc, items = 1:32, instrument = iipsc, prefix = "IIPSC_")

Run the code above in your browser using DataLab