Yuen t-Test For Trimmed Means
Performs one and two sample Yuen t-tests for trimmed means on vectors of data.
YuenTTest(x, ...) ## Default S3 method: YuenTTest(x, y = NULL, alternative = c("two.sided", "less", "greater"), mu = 0, paired = FALSE, conf.level = 0.95, trim = 0.2, ... ) ## S3 method for class 'formula' YuenTTest(formula, data, subset, na.action, ...)
x |
numeric vector of data values. Non-finite (e.g. infinite or missing) values will be omitted. |
y |
an optional numeric vector of data values: as with x non-finite values will be omitted. |
alternative |
is a character string, one of |
paired |
a logical indicating whether you want a paired z-test. |
mu |
a number specifying the hypothesized mean of the population. |
conf.level |
confidence level for the interval computation. |
trim |
the fraction (0 to 0.5) of observations to be trimmed from each end of x before the mean is computed. Values of trim outside that range are taken as the nearest endpoint. |
formula |
a formula of the form |
data |
an optional matrix or data frame (or similar: see |
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 |
... |
further arguments to be passed to or from methods. |
An object of class htest
containing the following components:
statistic |
the value of the t-statistic. |
parameter |
the degrees of freedom for the t-statistic and the trim percentage used. |
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. |
Andri Signorell <andri@signorell.net>, based on R-Core code of t.test
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.
x <- rnorm(25, 100, 5) YuenTTest(x, mu=99) # the classic interface with(sleep, YuenTTest(extra[group == 1], extra[group == 2])) # the formula interface YuenTTest(extra ~ group, data = sleep) # Stahel (2002), pp. 186, 196 d.tyres <- data.frame(A=c(44.5,55,52.5,50.2,45.3,46.1,52.1,50.5,50.6,49.2), B=c(44.9,54.8,55.6,55.2,55.6,47.7,53,49.1,52.3,50.7)) with(d.tyres, YuenTTest(A, B, paired=TRUE)) d.oxen <- data.frame(ext=c(2.7,2.7,1.1,3.0,1.9,3.0,3.8,3.8,0.3,1.9,1.9), int=c(6.5,5.4,8.1,3.5,0.5,3.8,6.8,4.9,9.5,6.2,4.1)) with(d.oxen, YuenTTest(int, ext, paired=FALSE))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.