Hui Jeong(Hailyee) Ha

Human Mobility, Transportation & Spatial Data Science

All Geocomputation lectures

Lecture 5 · Statistical testing

Does the 30-minute promise hold up?

We’ll use 28 deliveries to check an app’s claim that it delivers in 30 minutes on average.

From the lecture slides

Delivery times, the t statistic and the p-value · Slide 25
Delivery times, the t statistic and the p-value · Slide 25
Comparing two delivery apps · Slide 39
Comparing two delivery apps · Slide 39

A delivery app says it takes 30 minutes on average. We looked at 28 deliveries and got 33.52 minutes. Is that enough evidence to question the claim? Let’s work it out together and practise explaining the result without starting with the p-value.

The claim is 30 minutes. What did we find?

We used a one-sample t-test on 28 deliveries. Our estimated mean was 33.52 minutes and the 95% confidence interval ran from 30.86 to 36.18 minutes. The two-sided p-value was about 0.011. When you explain it, start with how many minutes longer the estimate was and give the interval.

The same people give us pairs

To compare two delivery apps, we used two independent samples. For the AI tutorial, the same students did a task before and after. Each person gives us one change. We also tried a rank-based comparison for commute times and used screen time to ask whether the two groups had different patterns of screen time.

In R

Use the class objects a and b for the independent delivery samples. The ai table has one row per student.

t.test(a, mu = 30)
t.test(a, b)
t.test(ai$after, ai$before, paired = TRUE)

Read a difference in minutes. In the paired comparison, negative means the task took less time after the tutorial.

Key takeaways

  • Check who or what gave you each observation. That tells you how to compare.
  • Say how big the difference is and give the confidence interval.