On 06/02/2011 02:18 AM, teriri wrote:
I have generated a plot of two empirical CDFs (attachment 1). As a
result, they are stepwise when plotted.
 ...
But what I need instead are smooth curves, similar to ones that are
generated from a theoretical cdf (attachment 2).

To obtain a smooth curve, you would need to estimate the density, which, from a statistical standpoint, is a vastly different problem. Once you have a density, however, you could integrate it to obtain the cdf:

x <- rnorm(10)
fit <- density(x)
plot(fit$x[-1],diff(fit$x)*cumsum(fit$y)[-1],type="l")
## For comparison:
plot(ecdf(x),add=TRUE,do.points=FALSE,verticals=TRUE)

Please be aware, however, that density estimation is a complicated topic with an extensive literature.

--
Patrick Breheny
Assistant Professor
Department of Biostatistics
Department of Statistics
University of Kentucky

______________________________________________
R-help@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.

Reply via email to