View source: R/tidying_functions.R
standardize | R Documentation |
Take in a data frame containing circumplex scales, angle definitions for each scale, and normative data (from the package or custom) and return that same data frame with each specified circumplex scale transformed into standard scores (i.e., z-scores) based on comparison to the normative data.
standardize(
.data,
scales,
angles,
instrument,
sample = 1,
prefix = "",
suffix = "_z"
)
.data |
Required. A data frame containing at least circumplex scales. |
scales |
Required. The variable names or column numbers for the
variables in |
angles |
Required. A numeric vector containing the angular displacement
of each circumplex scale included in |
instrument |
Required. An instrument object from the package. To see
the available circumplex instruments, see |
sample |
Required. An integer corresponding to the normative sample
to use in standardizing the scale scores (default = 1). See |
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 |
A data frame that matches .data
except that new variables are
appended that contain standardized versions of scales
. These new
variables will have the same name as scales
but with a "_z" suffix.
Other tidying functions:
ipsatize()
,
score()
data("jz2017")
instrument("iipsc")
standardize(jz2017, PA:NO, octants(), instrument = iipsc, sample = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.