z_scale {tidycomm} | R Documentation |
Z-standardize numeric, continuous variables
Description
This function z-standardizes the specified numeric columns or all numeric columns if none are specified. A z-standardized scale centers at a mean of 0.0 and has a standard deviation of 1.0, making it comparable to other z-standardized distributions.
Usage
z_scale(data, ..., name = NULL, overwrite = FALSE)
Arguments
data |
|
... |
Numeric variables to be z-standardized. If none are provided, all numeric columns will be z-standardized. |
name |
Optional name for the new z-standardized variable when a single variable is provided. By default, the name will be the original variable name suffixed with |
overwrite |
Logical. If |
Value
A tdcmm model with the z-standardized variable(s).
See Also
Other scaling:
categorize_scale()
,
center_scale()
,
dummify_scale()
,
minmax_scale()
,
recode_cat_scale()
,
reverse_scale()
,
setna_scale()
Examples
WoJ %>% z_scale(autonomy_emphasis)
WoJ %>% z_scale(autonomy_emphasis, name = "my_zstdized_variable")
WoJ %>%
z_scale(autonomy_emphasis) %>%
tab_frequencies(autonomy_emphasis, autonomy_emphasis_z)