calculateScale {eatGADS} | R Documentation |
Calculate a scale variable based on multiple items.
calculateScale(
GADSdat,
items,
scale,
maxNA = length(items),
reportDescr = FALSE
)
GADSdat |
A |
items |
A character vector with all item variable names. |
scale |
A character vector with the scale name. |
maxNA |
Maximum number of allowed |
reportDescr |
Should descriptive statistics be reported for the calculated scale. |
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
.
Returns a GADSdat
containing the newly computed variable.
##
items <- paste0("norms_", letters[1:6])
pisa_new <- calculateScale(pisa, items = items, scale = "norms")