rob_scale {robnptests}R Documentation

Robust scale estimators based on median absolute deviation

Description

rob_scale calculates an estimator for the within-sample dispersion based on two samples.

Usage

rob_scale(
  x,
  y,
  type = c("S1", "S2", "S3", "S4"),
  na.rm = FALSE,
  check.for.zero = FALSE
)

Arguments

x

a (non-empty) numeric vector of data values.

y

a (non-empty) numeric vector of data values.

type

character that specifies the estimator for the variance, can be "S1", "S2", "S3" and "S4"; see details for description of the scale estimators.

na.rm

a logical value indicating whether NA values in x and y should be stripped before the computation proceeds. The default is na.rm = FALSE.

check.for.zero

logical value indicating a warning should be triggered if the scale estimate is zero. The default is FALSE.

Details

For definitions of the scale estimators, see Fried and Dehling (2011).

If check.for.zero = TRUE, an error is thrown when the scale estimate is zero. This argument is only included because the function is used in rob_perm_statistic to compute values of robust test statistics where the scale estimate is used for standardization. A scale estimate of zero leads to a non-existing test statistic, so that the corresponding test cannot be performed.

Value

An estimate of the pooled variance of the two samples.

References

Fried R, Dehling H (2011). “Robust nonparametric tests for the two-sample location problem.” Statistical Methods & Applications, 20(4), 409–422. doi:10.1007/s10260-011-0164-1.


[Package robnptests version 1.1.0 Index]