In-Class Exercise 2
Shih Chien University
2026-09-16
The following are the daily commuting times (in minutes) reported by 24 students.
Grouped Frequency Distribution
Construct a grouped frequency distribution for commute using 5 classes.
max() and min(), then determine the class width.cut() together with table() to obtain the frequency of each class.cumsum().Histogram
Draw a histogram of commute with ggplot() and geom_histogram() using 5 bins. Give the graph a title and label both axes with labs().
Describe the shape of the distribution in one sentence.
Ogive
Draw the ogive (cumulative frequency graph) of commute.
Plot the cumulative frequency from Question 1 against the upper class boundaries with geom_line() and geom_point().
From the graph, estimate how many students commute less than 35 minutes.
Elementary Statistics: A Step by Step Approach