An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090122/499e90ac/attachment-0001.pl>
quantile question
4 messages · Greg Snow, Dimitris Rizopoulos, ANJAN PURKAYASTHA
Read the help page for the quantile function (the whole page, there is a lot of good detail in there), the 2nd reference on the page should also be a helpful read.
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 ANJAN PURKAYASTHA > Sent: Thursday, January 22, 2009 9:52 AM > To: r-help at r-project.org > Subject: [R] quantile question > > Hi, > A simple quantile question: > I need to calculate the 95% and 5% quantiles (aka percentiles) for the > following data: > 67.12 > 64.51 > 62.06 > 55.45 > 51.41 > 43.78 > 10.74 > 10.14 > > if I use the formula: 95% quantile point= 95 (8+1)/100, I get the > 8.55th > point as the 95% quantile. Which does not make too much sense as I have > only > 8 data points. > The other option is to use (95*8)/100 = 7.6th data point (which can be > found > by interpolation between the 7th and 8th data points). > Reportedly, the second formula is not too accurate. However in my case > the > first formula does not make much sense. > > Any advice? > > TIA, > Anjan > > -- > ============================= > anjan purkayastha, phd > bioinformatics analyst > whitehead institute for biomedical research > nine cambridge center > cambridge, ma 02142 > > purkayas [at] wi [dot] mit [dot] edu > 703.740.6939 > > [[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.
have a look at the online help file of ?quantile(); check also: x <- c(67.12, 64.51, 62.06, 55.45, 51.41, 43.78, 10.74, 10.14) sapply(1:9, function (i) quantile(x, c(0.05, 0.95), type = i)) I hope it helps. Best, Dimitris
ANJAN PURKAYASTHA wrote:
Hi, A simple quantile question: I need to calculate the 95% and 5% quantiles (aka percentiles) for the following data: 67.12 64.51 62.06 55.45 51.41 43.78 10.74 10.14 if I use the formula: 95% quantile point= 95 (8+1)/100, I get the 8.55th point as the 95% quantile. Which does not make too much sense as I have only 8 data points. The other option is to use (95*8)/100 = 7.6th data point (which can be found by interpolation between the 7th and 8th data points). Reportedly, the second formula is not too accurate. However in my case the first formula does not make much sense. Any advice? TIA, Anjan
Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090122/ae64f21e/attachment-0001.pl>