Re: [R] Simple 95% confidence interval for a median

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Thu, 12 May 2011 10:33:36 -0600

Contrary to the commonly held assumption, the Wilcoxin test does not deal with medians in general.

There are some specific cases/assumptions where the test/interval would apply to the median, if I remember correctly the assumptions include that the population distribution is symmetric and the only alternatives considered are shifts of the distribution (both assumptions that go contrary to what I would believe in most situations where I would want to use the Wilcoxin test).

If you want an actual confidence interval on the true meadian, then you either need to make some assumptions about the distribution that the data comes from, or use a tool like the bootstrap.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
801.408.8111



> -----Original Message-----
> From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-
> project.org] On Behalf Of Georgina Imberger
> Sent: Thursday, May 12, 2011 7:36 AM
> To: r-help_at_r-project.org
> Subject: [R] Simple 95% confidence interval for a median
>
> Hi!
>
> I have a data set of 86 values that are non-normally distributed
> (counts).
>
> The median value is 10. I want to get an estimate of the 95%
> confidence
> interval for this median value.
>
> I tried to use a one-sample Wiolcoxin test:
>
> wilcox.test(Comps,mu=10,conf.int=TRUE)
>
> and got the following output:
>
> Wilcoxon signed rank test with continuity correction
>
> data: Comps
> V = 2111, p-value = 0.05846
> alternative hypothesis: true location is not equal to 10
> 95 percent confidence interval:
> 10.00000 17.49993
> sample estimates:
> (pseudo)median
> 12.50006
>
> I wonder if someone would mind helping me out?
>
> What am I doing wrong?
> What is the '(psuedo)median'?
> Can I get R to estimate the confidence around the actual median of 10?
>
> With thanks,
> Georgie
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Thu 12 May 2011 - 16:36:08 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 12 May 2011 - 18:00:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive