[R] Cumulative distribution estimation

Murray Jorgensen maj at waikato.ac.nz
Fri Jul 28 12:19:49 CEST 2000


Thomas,

thanks for this. And to Ben Bolker and Brian Ripley for similar comments.

Murray

At 03:05 AM 28-07-00 , Thomas Lumley wrote:
>On Thu, 27 Jul 2000, Murray Jorgensen wrote:
>
>> Apologies for bothering the list for something that I could probably have
>> worked out myself had I brought my V&R in to work!
>> 
>> I have been asked how to construct useable cdf's and quantile functions
>> from density() output. If I were using Minitab I'd begin by making partial
>> sums of the density values and normalizing to a maximum of 1, but I don't
>> know the R analogue to the Minitab PARSUMS command.
>
>Cumulative sums are done with the cumsum() function (apropos("sum") might
>have been one way to find out, or help.search("cumulative"))
>
>If d is a density object then at least approximately what you want is
>   cumsum(d$y*c(0,diff(d$x)))
>(there may be an off-by-one error).
>
>In reasonably large samples I don't think this improves on the empirical
>CDF, though.
>
>	-thomas
>
>Thomas Lumley
>Assistant Professor, Biostatistics
>University of Washington, Seattle
> 
Dr Murray Jorgensen       http://www.stats.waikato.ac.nz/Staff/maj.html 
Department of Statistics, University of Waikato, Hamilton, New Zealand 
*Applications Editor, Australian and New Zealand Journal of Statistics* 
maj at waikato.ac.nz Phone +64-7 838 4773 home phone 856 6705 Fax 838 4155

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list