Holooly Plus Logo

Question 9.11: Consider the pizza delivery data described in Chap. A.4. We ......

Consider the pizza delivery data described in Chap. A.4. We distinguish between pizzas delivered on time (i.e. in less than 30 min) and not delivered on time (i.e. in more than 30 min). The contingency table for delivery time and operator looks as follows:

(a) Calculate and interpret the odds ratio and its 95% confidence interval.
(b) Reproduce the results from (a) using R.

Operator Total
Laura Melissa
<30 min 163 151 314
≥30 min 475 477 952
Total 638 628 1266
Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

(a) The odds ratio is

OR = \frac{163 · 477}{475 · 151} ≈ 1.08.

This means the chances that a pizza arrives in time are about 1.08 times higher for Laura compared with Melissa. To calculate the 95 % confidence interval, we need \hat{\theta }_{0} =\ln \left(1.08\right) \approx 0.077, z_{{1-\alpha }/{2}}\approx 1.96, and

\hat{\sigma }_{\hat{\theta }_{0}} =\left(\frac{1}{163}+\frac{1}{475} +\frac{1}{151} +\frac{1}{477} \right)^{\frac{1}{2} }= 0.13.

The interval for the log odds ratio is

[ln(1.08) ± 1.96 · 0.13] ≈ [−0.18; 0.33] .

Exponentiating the interval gives us the 95 % confidence interval for the odds ratio which is [0.84; 1.39]. This indicates that the odds of Laura’s pizzas arriving earlier than Melissa’s are not much different from one. While the point estimate tells us that Laura’s pizzas are delivered 1.08 times faster, the confidence interval tells us that there is uncertainty around this estimate in the sense that it could also be smaller than 1 and Melissa may not necessarily work more slowly than Laura.

(b) We can reproduce the results in R by attaching the pizza data, creating a categorical delivery time variable (using cut) and then applying the oddsratio command from the library epitools onto the contingency table:

attach(pizza)
timecat <- cut(time, breaks=c(-1,30,150))
library(epitools)
oddsratio(table(timecat,operator), method=’wald’)

Related Answered Questions

Question: 9.5

Verified Answer:

(a) The point estimate of μ is \bar{x}[/la...