Two things:

(1) type="l" won't work; plot.ecdf() calls plot.stepfun() and it doesn't have a ``type'' argument.

(2) Giving plot two separate objects to plot makes no sense at all.

(3) If you've got ***frequency*** data then ecdf() is probably not the right thing to do
    in the first place.

(4) I can't count.

To get the ***plots** you want, do something like:

        plot(ecdf(x.pre),do.points=FALSE,col="red",xlim=range(x.pre,x.obs))
        plot(ecdf(x.obs),do.points=FALSE,col="blue",add=TRUE)

But as I said if x.obs and x.pre are counts, rather than the raw data, this does not appear to make any sense. You are getting the ecdf-s of the counts rather than of the raw data which is a toadally different story. And toadally
misleading.  Re-think.

        cheers,

                Rolf Turner

On 7/09/2009, at 1:52 PM, Roslina Zakaria wrote:

Hi r-users,

I would like to compare the cdf between historical and predicted. My x.obs and x.pre are the frequency data in classes of 0-300.
I tried:

plot(ecdf(x.obs),ecdf(x.pre),type="l",col="red")

and it gives me:

Error in plot.stepfun(x, ..., ylab = ylab, verticals = verticals, pch = pch) :
  argument 4 matches multiple formal arguments

Thank you so much for any help given.

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
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