Cumulative Frequency Graph
A cumulative frequency graph or ogive of a quantitative variable is a curve graphically showing the cumulative frequency distribution.
Example
In the data set faithful, a point in the cumulative frequency graph of the eruptions variable shows the total number of eruptions whose durations are less than or equal to a given level.
Problem
Find the cumulative frequency graph of the eruption durations in faithful.
Solution
We first find the frequency distribution of the eruption durations as follows. Further details can be found in the Frequency Distribution tutorial.
> breaks = seq(1.5, 5.5, by=0.5)
> duration.cut = cut(duration, breaks, right=FALSE)
> duration.freq = table(duration.cut)
We then compute its cumulative frequency with cumsum, and plot it along with the starting zero element.
> plot(breaks, cumfreq0, # plot the data
+ main="Old Faithful Eruptions", # main title
+ xlab="Duration minutes", # x-axis label
+ ylab="Cumumlative Eruptions") # y-axis label
> lines(breaks, cumfreq0) # join the points
Answer
The cumulative frequency graph of the eruption durations is:
Exercise
Find the cumulative frequency graph of the eruption waiting periods in faithful.