[R] Two ecdf with log-scales

Johannes Radinger JRadinger at gmx.at
Wed May 2 12:14:50 CEST 2012


Hi,

i want to plot empirical cumulative density functions for two variables in
one plot. For better visualizing the differences in the two cumulative curves I'd like to log-scale the axis.

So far I found 3 possible functions to plot ecdf:

1) ecdf() from the package 'stats'. I don't know how to successfully set the log.scales? Combining two plots is not a problem:

plot(ecdf(x1))
lines(ecdf(x2),col.h="red")

2) gx.ecdf() from package 'rgr'. It is easily possible to plot log-scales, but I don't know how to plot two densities?

gx.ecdf(x1,log=TRUE,ifqs = TRUE)

3) Ecdf() from package 'Hmisc'. No log-option directly available and here I also don't know how to 'stack' two plots...

Ecdf(x1,what="F")


Probably there are many more solutions (e.g. ggplot etc.)...
...Has anyone faced a similar task and found a simple solution? Any suggestions are welcome!

Best regards,

Johannes


-- 

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a



More information about the R-help mailing list