Hi, are there any function to plot the empirical probability distribution function? I just don't want to reinvent the wheel... Best wishes, Ott -- Ott Toomet PhD Student Dept. of Economics ?rhus University Building 322 Universitetsparken 8000 ?rhus C Denmark otoomet (a) econ au dk ph: (+45) 89 42 20 27 ------------------------------------------- (o_ (*_ (O_ (o< -! //\ //\ //\ //\ V_/_ V_/_ V_/_ V_/_ standard drunken shocked noisy penguin penguin penguin penguin
On Tuesday 26 August 2003 08:47, Ott Toomet wrote:> Hi, > > are there any function to plot the empirical probability distribution > function? I just don't want to reinvent the wheel... >try this, regards, Adelchi -- n <- 10 x <- rnorm(n) plot(c(min(x)-1,sort(x), max(x+1)), c(0:n,n)/n, type="s", xlab="data", ylab="ecdf") rug(x) -- Adelchi Azzalini <azzalini at stat.unipd.it> Dipart.Scienze Statistiche, Universit? di Padova, Italia azzalini.stat.unipd.it (please, no ms-word/ms-excel/alike attachments)
Ott Toomet wrote:> Hi, > > are there any function to plot the empirical probability distribution > function? I just don't want to reinvent the wheel... > > Best wishes, > > Ott >See package "stepfun". Uwe Ligges
>>>>> "Ott" == Ott Toomet <otoomet at econ.dk> >>>>> on Tue, 26 Aug 2003 08:47:28 +0200 writes:Ott> Hi, are there any function to plot the empirical Ott> probability distribution function? I just don't want Ott> to reinvent the wheel... As Uwe has already said, the standard "stepfun" package does this -- and more. The idea of that mini-package was to introduce a class "stepfun" for (1D) step functions, and a class "ecdf" which extends "stepfun" -- at the same time demonstrating how R functions can be used to return other R functions (with an own environment where all information is stored). For many, it can be quite instructive to study example(stepfun) and example(ecdf) and the R source behind it. Martin