powered by
This function will compute group-mean-centered scores, and then z-scored the group-mean-centered scores with respect to the grand mean.
z_scored_group_mean(data, cols, group, keep_original = TRUE)
return a dataframe with the columns z-scored (replace existing columns)
A data.frame or a data.frame extension (e.g. a tibble).
Columns that need to be centered. See `dplyr::dplyr_tidy_select` for available options.
the grouping variable. If you need to pass multiple group variables, try to use quos(). Passing multiple group variables is not tested.
default is `FALSE`. Set to `TRUE` to keep original columns
z_scored_group_mean(iris, dplyr::ends_with("Petal.Width"), "Species")
Run the code above in your browser using DataLab