Statistics 2

In-Class Exercise 5

Yu-You Liou

Shih Chien University

2026-09-16

Question 1

t Test for Dependent Samples

Ten employees took a typing test before and after a training course. The scores are words per minute.

before <- c(42, 38, 51, 45, 40, 47, 36, 49, 43, 41)
after  <- c(48, 41, 55, 52, 44, 50, 42, 53, 47, 46)

Test the claim that the course improves typing speed at \alpha=0.05.

  1. Compute the differences D=\text{after}-\text{before}, then \bar{D} and s_D.
  2. Compute t=\bar{D}/(s_D/\sqrt{n}) in R.
  3. Find the critical value with qt() and d.f.=n-1, then state the decision.

Question 2

Testing the Difference Between Two Proportions

In a satisfaction survey, 96 of 150 customers at Store A and 120 of 200 customers at Store B said they were satisfied. Test the claim that the two proportions are different at \alpha=0.05.

  1. Compute \hat{p}_1, \hat{p}_2, and the pooled estimate \bar{p}=(X_1+X_2)/(n_1+n_2).
  2. Compute z=(\hat{p}_1-\hat{p}_2)/\sqrt{\bar{p}\bar{q}(1/n_1+1/n_2)} in R.
  3. Find the critical values with qnorm() and state the decision.

Question 3

F Test for Two Variances

A sample of 16 machines from Line 1 has a variance of 27.5, and a sample of 21 machines from Line 2 has a variance of 12.4. Test the claim that the two variances differ at \alpha=0.05.

  1. Place the larger variance in the numerator and compute F=s_1^2/s_2^2.
  2. Find the critical value with qf() using d.f.N=n_1-1 and d.f.D=n_2-1. For a two-tailed test at \alpha=0.05, use the area 0.975.
  3. State the decision and explain in one sentence why the larger variance always goes in the numerator.