Message-ID: <51492311.2030300@bitwrit.com.au>
Date: 2013-03-20T02:46:41Z
From: Jim Lemon
Subject: Cumulative Frequency Graph
In-Reply-To: <CA+jRDxArqsbjLMfYh+w1cXOhK68hvmOhbA92f9jzMBR2qpGFjg@mail.gmail.com>
On 03/19/2013 11:34 PM, Shane Carey wrote:
> Hi,
>
> I am trying to create a Cumulative Frequency graph and I am using the
> following example:
> http://www.r-tutor.com/elementary-statistics/quantitative-data/cumulative-frequency-graph
>
> When I plot this data, how do I put in "real values" on the x-axis, rather
> than the values that
> are used for the breaks
>
Hi Shane,
The values in the plot you use as an example are "real" in the sense
that they are equal to the time values. If you want different intervals,
then it makes sense to add a separate axis. For example:
data(faithful)
duration = faithful$eruptions
breaks = seq(1.5, 5.5, by=0.5)
duration.cut = cut(duration, breaks, right=FALSE)
duration.freq = table(duration.cut)
cumfreq0 = c(0, cumsum(duration.freq))
plot(breaks,cumfreq0,
main="Old Faithful Eruptions",
xlab="Duration minutes",
ylab="Cumulative eruptions",xaxt="n",type="b")
axis(1,at=2:5)
gives more or less the plot illustrated.
Jim