Does R do cumulative frequency distribution plots? -- Tommy E. Cathey, Senior Scientific Application Consultant High Performance Computing & Scientific Visualization SAIC, Supporting the EPA Research Triangle Park, NC 919-541-1500 EMail: cathey.tommy at epa.gov My e-mail does not reflect the opinion of SAIC or the EPA. Federal Contact - John B. Smith 919-541-1087 - smith.johnb at epa.gov
It depends on what you mean by that. Consider the following: > x <- rnorm(100) > plot(x, pnorm(x)) This plot is a cdf of pseudo-normal data. I've seen many people make these things, and I've never understoon what they see in these plots that they can't see better in a normal probability plot: > qqnorm(x, datax=T) What can you see in the first type plot that is not so easily seen in the second? Spencer Graves Tommy E. Cathey wrote:> Does R do cumulative frequency distribution plots? > > -- > Tommy E. Cathey, Senior Scientific Application Consultant > High Performance Computing & Scientific Visualization > SAIC, Supporting the EPA > Research Triangle Park, NC > 919-541-1500 EMail: cathey.tommy at epa.gov > My e-mail does not reflect the opinion of SAIC or the EPA. > > Federal Contact - John B. Smith > 919-541-1087 - smith.johnb at epa.gov > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
You can also take a look at "ecdf" in the "stepfun" package. Hope this helps, Matt -----Original Message----- From: Spencer Graves [mailto:spencer.graves at pdf.com] Sent: Tuesday, June 24, 2003 2:39 PM To: Tommy E. Cathey Cc: r-help at r-project.org Subject: Re: [R] cumulative frequency distribution plot It depends on what you mean by that. Consider the following: > x <- rnorm(100) > plot(x, pnorm(x)) This plot is a cdf of pseudo-normal data. I've seen many people make these things, and I've never understoon what they see in these plots that they can't see better in a normal probability plot: > qqnorm(x, datax=T) What can you see in the first type plot that is not so easily seen in the second? Spencer Graves Tommy E. Cathey wrote:> Does R do cumulative frequency distribution plots? > > -- > Tommy E. Cathey, Senior Scientific Application Consultant > High Performance Computing & Scientific Visualization > SAIC, Supporting the EPA > Research Triangle Park, NC > 919-541-1500 EMail: cathey.tommy at epa.gov > My e-mail does not reflect the opinion of SAIC or the EPA. > > Federal Contact - John B. Smith > 919-541-1087 - smith.johnb at epa.gov > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, cont... {{dropped}}
On Tuesday 24 June 2003 20:19, Tommy E. Cathey wrote:> Does R do cumulative frequency distribution plots?I am not sure you what you mean by that; if it is "empirical cumulative distribution function", then try this: 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) regards, Adelchi Azzalini -- Adelchi Azzalini <azzalini at stat.unipd.it> Dipart.Scienze Statistiche, Universit? di Padova, Italia http://azzalini.stat.unipd.it/
To plot a cumulative distribution of, say a behaviorial reaction time vector, I wrote the following function: cumhist = function(x) { Z = hist( x , plot=F ) plot(1:length(Z$counts),cumsum(Z$counts)/length(x)*100,type="b",axes=F, ylab="%",xlab="") axis(1,at=1:length(Z$counts),labels=round(1/Z$mids,digits=0)) axis(2) } x must be a vector of the data.