Learn R Programming

PairedData (version 0.9.1)

yuen.test: Yuen's trimmed mean test

Description

Yuen's test for one, two or paired samples.

Usage

yuen.test(x, ...)

## S3 method for class 'default':
yuen.test(x, y = NULL, tr = 0.2, alternative = c("two.sided", "less", "greater"),
mu = 0, paired = FALSE, conf.level = 0.95, ...)

## S3 method for class 'formula':
yuen.test(formula, data, subset, na.action, ...)

## S3 method for class 'paired':
yuen.test(x, ...)

Arguments

x
first sample or object of class paired.
y
second sample.
tr
percentage of trimming.
alternative
alternative hypothesis.
mu
a number indicating the true value of the trimmed mean (or difference in trimmed means if you are performing a two sample test).
paired
a logical indicating whether you want a paired yuen's test.
conf.level
confidence level.
formula
a formula of the form y ~ f where y is a numeric variable giving the data values and f a factor with TWO levels giving the corresponding groups.
data
an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).
subset
an optional vector specifying a subset of observations to be used.
na.action
a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").
...
further arguments to be passed to or from methods.

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the t-statistic.
  • parameterthe degrees of freedom for the t-statistic.
  • p.valuethe p-value for the test.
  • conf.inta confidence interval for the trimmed mean appropriate to the specified alternative hypothesis.
  • estimatethe estimated trimmed mean or difference in trimmed means depending on whether it was a one-sample test or a two-sample test.
  • null.valuethe specified hypothesized value of the trimmed mean or trimmed mean difference depending on whether it was a one-sample test or a two-sample test.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string indicating what type of test was performed.
  • data.namea character string giving the name(s) of the data.

References

  • Wilcox, R.R. (2005). Introduction to robust estimation and hypothesis testing. Academic Press.
  • Yuen K.K. (1974) The two-sample trimmed t for unequal population variances. Biometrika, 61, 165-170.

See Also

t.test

Examples

Run this code
z<-rnorm(20)
x<-rnorm(20)+z
y<-rnorm(20)+z+1

# two-sample test
yuen.test(x,y)

# one-sample test
yuen.test(x)

# paired-sample tests
yuen.test(x,y,paired=TRUE)

p<-paired(x,y)
yuen.test(p)

Run the code above in your browser using DataLab