View source: R/scaleEstimators.R
win_var | R Documentation |
win_var
calculates the winsorized variance of a sample.
win_var(x, gamma = 0, na.rm = FALSE)
x |
a (non-empty) numeric vector of data values. |
gamma |
a numeric value in [0, 0.5] specifying the fraction of observations to be replaced at each end of the sample before calculating the mean. The default value is 0.2. |
na.rm |
a logical value indicating whether NA values in |
A named list containing the following items:
var |
winsorized variance. |
h |
degrees of freedom used for tests based on trimmed means and the winsorized variance. |
# Generate random sample set.seed(108) x <- rnorm(10) # Compute 20% winsorized variance win_var(x, gamma = 0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.