Calculate a scale variable based on multiple items.
Usage
calculateScale(
GADSdat,
items,
scale,
maxNA = length(items),
reportDescr = FALSE
)
Details
Descriptive statistics (including Cronbach's alpha, credit to the psy
package) are calculated and printed to the console.
The new scale variable is automatically inserted right after the last item in the original GADSdat
.
Examples
##
items <- paste0("norms_", letters[1:6])
pisa_new <- calculateScale(pisa, items = items, scale = "norms")