score_swls: Score the Satisfaction with Life Scale (Diener, Emmons,...

View source: R/score_swls.R

score_swlsR Documentation

Score the Satisfaction with Life Scale (Diener, Emmons, Larsen, & Griffin, 1985)

Description

Score the Satisfaction with Life Scale (Diener, Emmons, Larsen, & Griffin, 1985)

Usage

score_swls(
  df,
  item_prefix = "SWLS",
  max_impute = 0.2,
  drop_items = FALSE,
  min_value = 1,
  max_value = 7
)

Arguments

df

a data.frame containing the 5 SWLS items to be scored

item_prefix

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

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

min_value

the minimum value for the item anchors. Default: 1

max_value

the highest value for the item anchors. Default: 7

Details

Adds one column, SWLS_total, to df containing the SWLS scale items.

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

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

See: http://labs.psychology.illinois.edu/~ediener/SWLS.html

Author(s)

Michael Hallquist


PennStateDEPENdLab/dependlab documentation built on Sept. 26, 2024, 8:40 p.m.