Statistics 1

In-Class Exercise 4

Yu-You Liou

Shih Chien University

2026-09-16

Data for Questions 1 to 3

The following are the numbers of customers served on six consecutive days at two branches of a coffee shop.

branchA <- c(52, 48, 55, 51, 49, 53)
branchB <- c(31, 70, 45, 62, 38, 62)

Question 1

Measures of Variation

For each branch, compute the range, the variance with var(), and the standard deviation with sd().

The two branches have the same mean. Which branch is more consistent from day to day? Explain in one sentence.

Question 2

Coefficient of Variation

The coefficient of variation is

CVar=\frac{s}{\bar{X}}\cdot 100\%

Compute CVar for both branches in R.

Branch A is measured in customers per day and its manager also reports daily revenue in NT dollars. Explain in one sentence why CVar is useful when two variables are measured in different units.

Question 3

Five-Number Summary and Outliers

For branchB:

  1. Report the five-number summary with fivenum().
  2. Compute the interquartile range with quantile().
  3. Check whether any value falls below Q_1-1.5\,IQR or above Q_3+1.5\,IQR.
  4. Draw a boxplot with ggplot() and geom_boxplot().