Study. A city transit agency posts an average wait of 8 minutes at Route 9 stops. Riders say waits are longer. The agency records the wait (in minutes) of 36 randomly selected Route 9 riders. It also surveys a separate random sample of 150 Route 9 riders about how they pay: nationally, 40% of transit riders pay by phone app.
Research Question A: On average, do Route 9 riders wait longer than the posted 8 minutes? (one-sample t-test) Research Question B: Does the share of Route 9 riders who pay by app differ from the national 40%? (one-proportion z-test)
For each test, explain why the sample is large enough for the test to be used. Show the numbers you check, and say why the z-test check uses 0.40 rather than the sample proportion.
# Research Question A: wait times (minutes), 36 randomly selected Route 9 riders
> t.test(wait, mu = 8, alternative = "greater")
One Sample t-test
data: wait
t = 2.2, df = 35, p-value = 0.01725
alternative hypothesis: true mean is greater than 8
95 percent confidence interval:
8.255214 Inf
sample estimates:
mean of x
9.1
# Research Question B: 150 randomly selected Route 9 riders, 54 pay by phone app
> phat <- 54 / 150
> phat
[1] 0.36
> z <- (phat - 0.4) / sqrt(0.4 * 0.6 / 150)
> z
[1] -1
> 2 * pnorm(-abs(z))
[1] 0.3173105