| interval_robust | R Documentation |
Functions to compute robust statistics for interval-valued data.
int_trimmed_mean(x, var_name, trim = 0.1, method = "CM", ...)
int_winsorized_mean(x, var_name, trim = 0.1, method = "CM", ...)
int_trimmed_var(x, var_name, trim = 0.1, method = "CM", ...)
int_winsorized_var(x, var_name, trim = 0.1, method = "CM", ...)
x |
interval-valued data with symbolic_tbl class. |
var_name |
the variable name or the column location (multiple variables are allowed). |
trim |
the fraction (0 to 0.5) of observations to be trimmed from each end. |
method |
methods to calculate statistics: CM (default), VM, QM, SE, FV, EJD, GQ, SPT. |
... |
additional parameters |
These functions provide robust alternatives to standard statistics:
int_trimmed_mean: Mean after trimming extreme values
int_winsorized_mean: Mean after winsorizing extreme values
int_trimmed_var: Variance after trimming extreme values
int_winsorized_var: Variance after winsorizing extreme values
Trimming vs Winsorizing:
Trimming: Remove extreme values
Winsorizing: Replace extreme values with less extreme values
A numeric matrix
Han-Ming Wu
int_mean int_var int_trimmed_mean
data(mushroom.int)
# Trimmed mean (10% from each end)
int_trimmed_mean(mushroom.int, var_name = "Pileus.Cap.Width", trim = 0.1)
# Winsorized mean
int_winsorized_mean(mushroom.int, var_name = 2:3, trim = 0.05, method = "CM")
# Trimmed variance
int_trimmed_var(mushroom.int, var_name = c("Stipe.Length"), trim = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.