zscore_winsorized: Normalize a numeric vector to z-scores with the values...

View source: R/zscore_winsorized.R

zscore_winsorizedR Documentation

Normalize a numeric vector to z-scores with the values winsorized (capped at a maximum absolute value)

Description

This function normalizes a numeric vector to z-scores (mean of 0 and standard deviation of 1), with values beyond a specified threshold winsorized (capped at a maximum absolute value). It ignores NA values in the calculation of mean and standard deviation, but returns NAs in the output vector.

Usage

zscore_winsorized(x, threshold = 3)

Arguments

x

numeric vector to be normalized

threshold

the maximum absolute value to which the vector will be winsorized


mjdufort/miscHelpers documentation built on Feb. 4, 2024, 7:44 p.m.