View source: R/tidying_functions.R
self_standardize | R Documentation |
Take in a data frame containing circumplex scales (or items) and return that same data frame with each specified variable transformed into standard scores (i.e., z-scores) based on observed means and SDs.
self_standardize(
data,
scales,
na.rm = TRUE,
prefix = "",
suffix = "_z",
append = TRUE
)
data |
Required. A data frame or matrix containing at least circumplex scales. |
scales |
Required. A character vector containing the column names, or a numeric vector containing the column indexes, for the variables (scale scores) to be standardized. |
na.rm |
Optional. A logical that determines whether to remove missing values from scales when calculating the means and SDs used for standardization (default = TRUE). |
prefix |
Optional. A string to include at the beginning of the newly
calculated scale variables' names, before the scale name and |
suffix |
Optional. A string to include at the end of the newly
calculated scale variables' names, after the scale name and |
append |
Optional. A logical that determines whether the calculated
standardized scores should be added as columns to |
A data frame that contains the self-standardized versions of
scales
.
Other tidying functions:
ipsatize()
,
norm_standardize()
,
score()
self_standardize(aw2009, scales = 1:8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.