[R] median test
Frank E Harrell Jr
f.harrell at Vanderbilt.Edu
Fri May 28 18:53:00 CEST 2010
There are different views about whether someone doing statistical
analysis should first take a certain number of statistics course. I
think for your issue some background information would certainly help.
You have not correctly interpreted the paper. The main point is that
for most cases likely to be seen in practice, the median test is
tantamount to discarding about 1/3 of your animals. The Wilcoxon test
is a good choice for a huge variety of situations. Even if the data are
Gaussian it has efficiency 3/pi whereas the median test has efficiency
2/pi in that case.
On 05/28/2010 08:58 AM, linda Porz wrote:
> I can't have different data these data came from mice that have lived under
> certain condition in the lab! I have just read the mentioned publication
> "Should the median test be retired from general use?" It says in the
> conclusion "If one felt that the data could not come from a Cauchy or slash
> distribution, the Wilcoxon should be used."! What is this? Is there is any
> test in R for a Cauchy or slash distribution? Can I used the unpaired
> Wilcoxon, or I have a Cauchy distributed data?
> Many thanks,
> 2010/5/27 Joshua Wiley<jwiley.psych at gmail.com>
>> Hello Linda,
>> The "problem" is actually the median of your data. What the function
>> median.test() does first is combine both groups. Look at this:
>> median(c(group1, group2))
>> the median is 1, but the lowest value of the groups is also 1. So
>> when the function does the logical check z< m where z = c(group1,
>> group2) and m is the median, there are no values that are less than
>> the median value. Therefore there is only 1 level, and the fisher
>> test fails.
>> You would either need different data or adjust the function to be:
>> fisher.test(z<= m, g)$p.value
>> that way it's less than or equal to the median.
>> Hope that helps,
>> On Thu, May 27, 2010 at 7:24 AM, linda Porz<linda.porz at gmail.com> wrote:
>>> Hi all,
>>> I have found the following function online
>>> g<- rep(1:2, c(length(y1),length(y2)))
>>> I have the following data
>>>> group1<- c(2, 2, 2, 1, 4, 3, 1, 1)
>>>> group2<- c(3, 1, 3, 1, 4, 1, 1, 1, 7, 1, 1, 1, 1, 1, 2)
>>>  1
>>> Error in fisher.test(z< m, g) : 'x' and 'y' must have at least 2 levels
>>> I am very thankful in advance for any suggestion and help.
>>> [[alternative HTML version deleted]]
>>> R-help at r-project.org mailing list
>>> PLEASE do read the posting guide
>>> and provide commented, minimal, self-contained, reproducible code.
>> Joshua Wiley
>> Senior in Psychology
>> University of California, Riverside
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Frank E Harrell Jr Professor and Chairman School of Medicine
Department of Biostatistics Vanderbilt University
More information about the R-help