PairedData (version 1.1.1)

yuen.t.test: Yuen's trimmed mean test

Description

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

Usage

yuen.t.test(x, ...)

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

# S3 method for formula yuen.t.test(formula, data, subset, na.action, ...)

# S3 method for paired yuen.t.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:

statistic

the value of the t-statistic.

parameter

the degrees of freedom for the t-statistic.

p.value

the p-value for the test.

conf.int

a confidence interval for the trimmed mean appropriate to the specified alternative hypothesis.

estimate

the estimated trimmed mean or difference in trimmed means depending on whether it was a one-sample test or a two-sample test.

null.value

the 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.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating what type of test was performed.

data.name

a 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
# NOT RUN {
z<-rnorm(20)
x<-rnorm(20)+z
y<-rnorm(20)+z+1

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

# one-sample test
yuen.t.test(y,mu=1,tr=0.25)

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

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

Run the code above in your browser using DataLab