[R] plot empirical pdf

Adelchi Azzalini azzalini at stat.unipd.it
Tue Aug 26 08:59:10 CEST 2003


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
http://azzalini.stat.unipd.it/
(please, no ms-word/ms-excel/alike attachments)




More information about the R-help mailing list