Learn R Programming

WRS2 (version 0.3-1)

yuen: Robust t-tests to compare independent means.

Description

The function yuen performs Yuen's test for trimmed means, yuenbt is a bootstrap version of it. The pb2gen function performs a t-test based on various robust estimators.

Usage

yuen(formula, data, tr = 0.2)
yuenbt(formula, data, tr = 0.2, nboot = 599, side = FALSE)
pb2gen(formula, data, est = "mom", nboot = 599)

Arguments

formula
an object of class formula.
data
an optional data frame for the input data.
tr
trim level for the mean.
nboot
number of bootstrap samples.
side
if TRUE the confidence intervals are forced to be symmetric.
est
Estimate to be used for the group comparisons: either "onestep" for one-step M-estimator of location using Huber's Psi, "mom" for the modified one-step (MOM) estimator of location based on Huber's Psi, or "median", <

Value

  • Returns an object of class "yuen" containing:
  • testvalue of the test statistic (F-statistic)
  • p.valuep-value
  • conf.intconfidence interval
  • callfunction call

Details

In order to get a p-value for yuenbt, side needs to be set to TRUE.

References

Wilcox, R. (2012). Introduction to Robust Estimation and Hypothesis Testing (3rd ed.). Elsevier.

See Also

t1way,t1waybt

Examples

Run this code
## Yuen's test
yuen(Anxiety ~ Group, data = spider)

## Bootstrap version of Yuen's test (symmetric CIs)
yuenbt(Anxiety ~ Group, data = spider, side = TRUE)

## Using an M-estimator
pb2gen(Anxiety ~ Group, data = spider, est = "mom")
pb2gen(Anxiety ~ Group, data = spider, est = "mean")
pb2gen(Anxiety ~ Group, data = spider, est = "median")

Run the code above in your browser using DataLab