Learn R Programming

WRS2 (version 0.4-0)

yuen: Independent samples t-tests on robust location measures.

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) 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.
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", "mean".

Value

Returns objects of classes "yuen" or "pb2" containing:
test
value of the test statistic (t-statistic)
p.value
p-value
conf.int
confidence interval
df
degress of freedom
diff
trimmed mean difference
call
function call

References

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

Yuen, K. K. (1974). The two sample trimmed t for unequal population variances. Biometrika, 61, 165-170.

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)

## 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