Cumulative Frequency Graph
A cumulative frequency graph or ogive of a quantitative variable is a curve graphically showing the cumulative frequency distribution.
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.
Find the cumulative frequency graph of the eruption durations in faithful.
We first find the frequency distribution of the eruption durations as follows. Check the previous tutorial on Frequency Distribution for details.
> 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, add a starting zero element, and plot the graph.
> plot(breaks, cumfreq0, # plot the data
+ main="Old Faithful Eruptions", # main title
+ xlab="Duration minutes", # x−axis label
+ ylab="Cumulative eruptions") # y−axis label
> lines(breaks, cumfreq0) # join the points
The cumulative frequency graph of the eruption durations is:
Find the cumulative frequency graph of the eruption waiting periods in faithful.