score_rt: Score the Risk Taking - 18 item scale (RT-18)

View source: R/score_rt.R

score_rtR Documentation

Score the Risk Taking – 18 item scale (RT-18)

Description

Score the Risk Taking – 18 item scale (RT-18)

Usage

score_rt(
  df,
  item_prefix = "RT",
  max_impute = 0.2,
  drop_items = FALSE,
  input_codes = c(1, 2),
  min_value = 0,
  max_value = 1
)

Arguments

df

a data.frame containing the 18 RT items to be scored

item_prefix

a character prefix of the items names in df to be scored. Default: "RT"

max_impute

the proportion of missingness [0..1) or number [1..n] of missing values per scale. Below this threshold, the person subscale mean will be imputed for missing items.

drop_items

whether to remove the item-level data from the df. Default: FALSE

input_codes

the original T/F coding scheme of the input dataframe. These are converted to the specified min and max value.

min_value

the minimum value for the item anchors. Default: 0

max_value

the highest value for the item anchors. Default: 1

Details

Adds three columns, RT_riskbehavior, RT_riskassessment, and RT_total, to df containing the different subscales, respectively.

Note: the default RT scoring uses the mean of the items for the scales.

Note: the code assumes that pasting together the item_prefix and the numbers 1:18 will yield the 18 items from the test.

Author(s)

Michael Hallquist


PennStateDEPENdLab/dependlab documentation built on April 10, 2024, 5:15 p.m.