11. Single Mean

Math 115 - Examples for Topic 11

Author

Yurk

These worked examples demonstrate inference for a single mean using the t-distribution (model-based approach).


Example 1: Hypothesis Test for a Single Mean

Scenario: A popular food delivery app claims that orders in your city are delivered in an average of 30 minutes. A consumer advocacy group suspects the actual average delivery time is longer. They randomly sample 45 deliveries and record the delivery time for each.

Sample results:

n \(\bar{x}\) s
45 33.8 min 8.2 min

Research question: Is there evidence that the average delivery time is longer than 30 minutes?

Task: Conduct a hypothesis test at the α = 0.05 level using the t-distribution.

Step 1: Identify the parameter and calculate the sample statistic

Let μ = the true mean delivery time for all orders in this city.

Sample mean: \(\bar{x} = 33.8\) minutes

Step 2: State the hypotheses

Since the consumer group suspects delivery times are longer than claimed, this is a one-sided test:

  • \(H_0: \mu = 30\) (delivery time is 30 minutes as claimed)
  • \(H_A: \mu > 30\) (delivery time is longer than claimed)

Step 3: Check conditions for using t-distribution

Independence:

  • Random sample of deliveries ✓

Normality:

  • n = 45 ≥ 30 ✓
  • We would need to check the histogram for extreme outliers, but with n ≥ 30, moderate skewness is acceptable

Assuming at most moderate skewness, conditions are met for using the t-distribution.

Step 4: Calculate the test statistic

Degrees of freedom: \(df = n - 1 = 45 - 1 = 44\)

Standard error:

\[SE = \frac{s}{\sqrt{n}} = \frac{8.2}{\sqrt{45}} = 1.222\]

T-statistic:

\[T = \frac{\bar{x} - \mu_0}{SE} = \frac{33.8 - 30}{1.222} = 3.11\]

Step 5: Calculate the p-value using Jamovi

Randomize module → Model-Based Inference

To calculate the p-value:

  1. Under Distribution, choose t
  2. Enter degrees of freedom: 44
  3. Check “Calculate area (p-value)”
  4. Enter the T-statistic: 3.11
  5. Select tail direction: Right (since \(H_A: \mu > 30\))

P-value = 0.0016

Step 6: Interpret the p-value

Interpretation: If the true mean delivery time were actually 30 minutes, there is approximately a 0.16% chance of observing a sample mean of 33.8 minutes or higher in a random sample of 45 deliveries.

Step 7: Make a decision

Using the significance level α = 0.05:

  • P-value = 0.0016
  • Compare: Is 0.0016 < 0.05? YES

Decision: We reject \(H_0\) at the α = 0.05 level.

Step 8: State the conclusion in context

The data provide convincing evidence that the mean delivery time is longer than 30 minutes (T = 3.11, df = 44, p-value = 0.0016). The consumer advocacy group’s suspicion appears to be supported—deliveries take longer than the app claims, with a sample mean of 33.8 minutes.


Example 2: Confidence Interval for a Single Mean

Scenario: A health researcher wants to estimate the average daily caffeine consumption among college students at a large university. She randomly surveys 60 students and asks them to estimate their daily caffeine intake (in milligrams).

Sample results:

n \(\bar{x}\) s
60 187 mg 85 mg

Research question: What is the average daily caffeine consumption among college students at this university?

Task: Construct a 95% confidence interval for μ using the t-distribution.

Step 1: Identify the parameter and point estimate

Let μ = the true mean daily caffeine consumption (in mg) for all college students at this university.

Point estimate: \(\bar{x} = 187\) mg

Step 2: Check conditions for using t-distribution

Independence:

  • Random sample of students ✓

Normality:

  • n = 60 ≥ 30 ✓
  • With n ≥ 30, moderate skewness is acceptable as long as there are no extreme outliers

Assuming at most moderate skewness, conditions are met for using the t-distribution.

Step 3: Calculate the standard error

Degrees of freedom: \(df = n - 1 = 60 - 1 = 59\)

Standard error:

\[SE = \frac{s}{\sqrt{n}} = \frac{85}{\sqrt{60}} = 10.97\]

Step 4: Find the critical value using Jamovi

Randomize module → Model-Based Inference

To find \(t^*\):

  1. Under Distribution, choose t
  2. Enter degrees of freedom: 59
  3. Check “Calculate CI multiplier”
  4. Enter confidence level: 95

Critical value: \(t^*_{59} = 2.001\)

Step 5: Calculate the confidence interval

Margin of error:

\[ME = t^*_{df} \times SE = 2.001 \times 10.97 = 21.96\]

Confidence interval:

\[\text{CI} = \bar{x} \pm ME = 187 \pm 21.96\]

\[95\% \text{ CI} = (165, 209)\]

Step 6: Interpret the confidence interval

Interpretation: We are 95% confident that the true mean daily caffeine consumption for college students at this university is between 165 mg and 209 mg.


Example 3: Understanding Sampling Variability

This example explores how sample size affects sampling variability, which in turn affects both the precision of our estimates and the strength of evidence in hypothesis tests.


Scenario

You are a student in a biology lab. Each lab group collects a random sample of iris flowers and measures the longest petal on each flower.

Your group’s sample of 25 petals has:

  • Sample mean: \(\bar{x} = 4.3\) cm
  • Sample standard deviation: \(s = 0.5\) cm

Part A: Variability of Sample Means

Question: Based on your sample, how much do you expect the mean petal lengths to vary from group to group?

The standard error tells us how much we expect \(\bar{x}\) to vary across different random samples from the same population.

\[SE = \frac{s}{\sqrt{n}} = \frac{0.5}{\sqrt{25}} = \frac{0.5}{5} = 0.1 \text{ cm}\]

Answer: We expect sample means to vary by about 0.1 cm from group to group. Most groups will get sample means within 1-2 standard errors of the true population mean—roughly within 0.1 to 0.2 cm of each other.


Part B: Effect of Larger Sample Size

Question: What if the sample sizes were 100 instead of 25? How much would sample means vary from group to group?

With a larger sample size, the standard error decreases:

\[SE = \frac{s}{\sqrt{n}} = \frac{0.5}{\sqrt{100}} = \frac{0.5}{10} = 0.05 \text{ cm}\]

Answer: With n = 100, sample means would vary by about 0.05 cm from group to group—half as much variability as with n = 25.

Key insight: Quadrupling the sample size (25 → 100) cuts the standard error in half. Larger samples produce more consistent results.


Part C: Effect on Confidence Interval Width

Question: If you calculated a 95% confidence interval based on a sample of 100 petals, how would it compare to a 95% confidence interval based on a sample of 25 petals from the same population of irises?

The width of a confidence interval is determined by:

\[\text{Width} = 2 \times t^* \times SE\]

Since SE is smaller when n = 100:

  • n = 25: SE = 0.1 cm → wider CI
  • n = 100: SE = 0.05 cm → narrower CI

Approximate CI widths:

  • n = 25: Width ≈ 2 × 2.064 × 0.1 = 0.41 cm
  • n = 100: Width ≈ 2 × 1.984 × 0.05 = 0.2 cm

Answer: The confidence interval based on n = 100 would be about half as wide as the one based on n = 25. Larger samples give more precise estimates.

Back to top