R/make_scales.R
make_scales.Rd
This function creates multiple scales, returns descriptives and supports reverse-coding of items.
make_scales(
data,
items,
reversed = FALSE,
two_items_reliability = c("spearman_brown", "cronbachs_alpha", "r"),
print_desc = FALSE,
...
)
A dataframe
A named list of characters vectors. Names are the scale names, each vector contains the items for that scale (variables in data)
How should items be reverse-coded. Can be FALSE (no reverse-coding), TRUE (automatic reverse-coding of items negatively correlated with remainder), or a named list of characters vectors. Names are the scale names, each vector contains the items to be reverse-coded for that scale. If TRUE, the result must be checked carefully!
How should the reliability of two-item scales be reported? "spearman_brown" is the recommended default, but "cronbachs_alpha" and Pearson's "r" are also supported.
Logical. Should descriptives for scales be printed?
Arguments passed on to make_scale
print_hist
Logical. Should histograms for items and resulting scale be printed?
A list of two dataframes: scale values (scores
) and
descriptive statistics for each scale (descriptives
)