I have an SPLUS function for computing C.I.'s for any quantile, based
on the same ideas as is Luc Wouter's function. Luc's function gives an
approximately symmetric 95% CI for the median. Besides giving C.I.'s for
other
quantiles and for a specified range of coverage probabilities, I allow the
user to
compute many different confidence intervals, perhaps with only slightly
different
coverage probabilities, different lengths, symmetric or not, and so on. You
can
then look at them all and pick the one you prefer; the function can sort them
or
subset them in various ways to help you do so.
If anyone would like a copy of this function, please drop me an email. The
code,
including that for three local support functions, is too long to send to the
whole
list.
Here are a couple of examples:
# A CI for the median
> ci.quantile(x = 1:6, p = 0.5, level.range = c(0.945, 1))
Lower Upper Length Level
[1,] 1 6 5 0.96875
attr(, "percentile"):
50%
3.5
# Various CIs for the median
> ci.quantile(x = 1:6, p = 0.5, level.range = c(0, 1))
Lower Upper Length Level
[1,] 1 6 5 0.968750
[2,] 1 5 4 0.875000
[3,] 2 6 4 0.875000
[4,] 2 5 3 0.781250
[5,] 1 4 3 0.640625
[6,] 3 6 3 0.640625
[7,] 2 4 2 0.546875
[8,] 3 5 2 0.546875
[9,] 1 3 2 0.328125
[10,] 3 4 1 0.312500
[11,] 2 3 1 0.234375
attr(, "percentile"):
50%
3.5
# Various CIs for the upper quartile
> ci.quantile(x = 1:6, p = 0.75, level.range = c(0,1))
Lower Upper Length Level
[1,] 1 6 5 0.8217773
[2,] 2 6 4 0.8173828
[3,] 3 6 3 0.7844238
[4,] 4 6 2 0.6525879
[5,] 1 5 4 0.4658203
[6,] 2 5 3 0.4614258
[7,] 3 5 2 0.4284668
[8,] 4 5 1 0.2966309
[9,] 1 4 3 0.1691895
[10,] 2 4 2 0.1647949
[11,] 3 4 1 0.1318359
attr(, "percentile"):
75%
4.75
# Various CIs for the lower quartile
> ci.quantile(x = 1:6, p = 0.25, level.range = c(0, 1))
Lower Upper Length Level
[1,] 1 6 5 0.8217773
[2,] 1 5 4 0.8173828
[3,] 1 4 3 0.7844238
[4,] 1 3 2 0.6525879
[5,] 1 2 1 0.3559570
attr(, "percentile"):
25%
2.25
Cheers,
Scott
=========================================
Scott.Chasalow@users.pv.wau.nl
Wageningen Agricultural University
Laboratory of Plant Breeding
P.O. Box 386
6700 AJ Wageningen
THE NETHERLANDS
http://www.spg.wau.nl/pv/staff/Chasal_S.htm
==========================================
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news