<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Yuen's trimmed mean test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for yuen.t.test"><tr><td>yuen.t.test</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>
Yuen's trimmed mean test
</h2>

<h3>Description</h3>

<p>Yuen's test for one, two or paired samples.
</p>


<h3>Usage</h3>

<pre>
yuen.t.test(x, ...)

## Default S3 method:
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 class 'formula'
yuen.t.test(formula, data, subset, na.action, ...)

## S3 method for class 'paired'
yuen.t.test(x, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>

<p>first sample or object of class paired.
</p>
</td></tr>
<tr valign="top"><td><code>y</code></td>
<td>

<p>second sample.
</p>
</td></tr>
<tr valign="top"><td><code>tr</code></td>
<td>

<p>percentage of trimming.
</p>
</td></tr>
<tr valign="top"><td><code>alternative</code></td>
<td>

<p>alternative hypothesis.
</p>
</td></tr>
<tr valign="top"><td><code>mu</code></td>
<td>

<p>a number indicating the true value of the trimmed mean (or difference in trimmed means if you are performing a two sample test).</p>
</td></tr>
<tr valign="top"><td><code>paired</code></td>
<td>

<p>a logical indicating whether you want a paired yuen's test.
</p>
</td></tr>
<tr valign="top"><td><code>conf.level</code></td>
<td>

<p>confidence level.
</p>
</td></tr>
<tr valign="top"><td><code>formula</code></td>
<td>

<p>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.
</p>
</td></tr>
<tr valign="top"><td><code>data</code></td>
<td>

<p>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).
</p>
</td></tr>
<tr valign="top"><td><code>subset</code></td>
<td>

<p>an optional vector specifying a subset of observations to be used.
</p>
</td></tr>
<tr valign="top"><td><code>na.action</code></td>
<td>

<p>a function which indicates what should happen when the data contain NAs. Defaults to getOption(&quot;na.action&quot;).
</p>
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>

<p>further arguments to be passed to or from methods.
</p>
</td></tr>
</table>


<h3>Value</h3>

<p>A list with class &quot;htest&quot; containing the following components: 
</p>
<table summary="R valueblock">
<tr valign="top"><td><code>statistic</code></td>
<td>
<p>the value of the t-statistic.</p>
</td></tr> 
<tr valign="top"><td><code>parameter</code></td>
<td>
<p>the degrees of freedom for the t-statistic.</p>
</td></tr> 
<tr valign="top"><td><code>p.value</code></td>
<td>
<p>the p-value for the test.</p>
</td></tr> 
<tr valign="top"><td><code>conf.int</code></td>
<td>
<p>a confidence interval for the trimmed mean appropriate to the specified alternative hypothesis.</p>
</td></tr> 
<tr valign="top"><td><code>estimate</code></td>
<td>
<p>the estimated trimmed mean or difference in trimmed means depending on whether it was a one-sample test or a two-sample test.
</p>
</td></tr> 
<tr valign="top"><td><code>null.value</code></td>
<td>
<p>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.</p>
</td></tr> 
<tr valign="top"><td><code>alternative</code></td>
<td>
<p>a character string describing the alternative hypothesis.</p>
</td></tr>
<tr valign="top"><td><code>method</code></td>
<td>
<p>a character string indicating what type of test was performed.</p>
</td></tr> 
<tr valign="top"><td><code>data.name</code></td>
<td>
<p>a character string giving the name(s) of the data.</p>
</td></tr>
</table>


<h3>Author(s)</h3>

<p>Stephane CHAMPELY, but some part are mere copy of the code of Wilcox (WRS)</p>


<h3>References</h3>


<ul>
<li><p> Wilcox, R.R. (2005). Introduction to robust estimation and hypothesis testing. Academic Press.
</p>
</li>
<li><p> Yuen, K.K. (1974) The two-sample trimmed t for unequal population variances. Biometrika, 61, 165-170.
</p>
</li></ul>



<h3>See Also</h3>

<p>t.test</p>


<h3>Examples</h3>

<pre>
z&lt;-rnorm(20)
x&lt;-rnorm(20)+z
y&lt;-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&lt;-paired(x,y)
yuen.t.test(p)
</pre>


</body></html>
