Yuen's test for one, two or paired samples.
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, ...)
first sample or object of class paired.
second sample.
percentage of trimming.
alternative hypothesis.
a number indicating the true value of the trimmed mean (or difference in trimmed means if you are performing a two sample test).
a logical indicating whether you want a paired yuen's test.
confidence level.
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.
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).
an optional vector specifying a subset of observations to be used.
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.
A list with class "htest" containing the following components:
the value of the t-statistic.
the degrees of freedom for the t-statistic.
the p-value for the test.
a confidence interval for the trimmed mean appropriate to the specified alternative hypothesis.
the estimated trimmed mean or difference in trimmed means depending on whether it was a one-sample test or a two-sample test.
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.
a character string describing the alternative hypothesis.
a character string indicating what type of test was performed.
a character string giving the name(s) of the data.
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.
t.test
# 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