trim.test | R Documentation |
A robust heteroscedastic procedure using trimmed means.
trim.test(Y, X, tr = 0.2)
Y |
A vector of responses. A quantitative vector |
X |
A vector of factor levels. |
tr |
The degree of trimming. A value from 0-0.5. |
The method utilized here is based on the simple idea of replacing means with trimmed means and standard error estimates, based on all the data, with the standard error of the trimmed mean (Wilcox 2005). The method has the additional benefit of being resistant to heteroscedasticity due to the use of the Welch method for calculating degrees of freedom. With no trimming the degrees of freedom reduce to those of the one way Welch procedure in oneway.test
.
Returns a dataframe with numerator and denominator degrees of freedom, a test statistic, and a p-value based on the F-distribution.
code based on Wilcox (2005)
Ken Aho
Wilcox, R. R. (2005) Introduction to Robust Estimation and Hypothesis Testing, Second Edition. Elsevier, Burlington, MA.
oneway.test
rye<-c(50,49.8,52.3,44.5,62.3,74.8,72.5,80.2,47.6,39.5,47.7,50.7)
nutrient<-factor(c(rep(1,4),rep(2,4),rep(3,4)))
trim.test(rye,nutrient,tr=.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.