PSTAT 5A: Confidence Intervals Deep Dive

Lecture 12 - From Theory to Practice: z and t Distributions

Narjes Mathlouthi

2025-07-24

Welcome to Lecture 12

Confidence Intervals: From Theory to Practice

“A confidence interval is a way of expressing uncertainty in a precise, mathematical way”

📢 Important Announcements

📝 Quiz 2 Details

When:
- 📅 Date: Friday, July 25
- ⏰ Window: 7 AM – 12 AM
- ⏳ Duration: 1 hour once started

Where: 💻 Online via Canvas

Covers: Material from Weeks 3-4

📚 What to Expect

  • Discrete & continuous distributions
  • Probability calculations
  • Expected value & variance
  • Normal distribution applications
  • Note: Upload photos of written work for calculation problems

📢 Today’s Roadmap

🎯 Learning Objectives

  • Know the difference between z and t distributions
  • Understand when to use each distribution
  • Learn to find critical values from tables and plots
  • Practice calculating confidence intervals step-by-step
  • Interpret results correctly in context

📋 What We’ll Cover

  1. Review: Confidence interval basics
  2. The t-Distribution: When and why we use it
  3. Critical Regions: Finding the right values
  4. Practical Examples: z and t calculations
  5. Common Mistakes: What to avoid
  6. Real Applications: Making it meaningful

Quick Review: Confidence Interval Basics 🔄

🎯 The Big Idea

A confidence interval (CI) takes a single sample statistic and turns it into a range that is likely to contain an unknown population parameter; most often the mean \mu.

CI template

\underbrace{\text{Point estimate}}_{\color{blue}{(e.g., \bar{x})}} \;\pm\; \underbrace{\text{(critical value) $\times$ (standard error)}}_{\color{red}{\text{Margin of Error (ME)}}}

For the mean

Situation Formula Distribution
σ known (rare) \displaystyle \bar{x} \;\pm\; z^{*}\,\frac{\sigma}{\sqrt{n}} z-distribution
σ unknown (typical) \displaystyle \bar{x} \;\pm\; t^{*}\,\frac{s}{\sqrt{n}} t-distribution (df = n-1)

Key points

  • We never know the true mean \mu in practice, that’s exactly what the CI estimates.
  • Use the population SD σ only when it is genuinely known (e.g., industrial process with long‑term QC).
  • Otherwise substitute the sample SD s and switch to the t‑distribution, which is wider to reflect that extra uncertainty.

Key Formula: \bar{x} \pm z^* \cdot \frac{s}{\sqrt{n}} (when using z-distribution)

Step-by-Step Example 1: Using z-Distribution 📝

🎯 Problem Setup

Research Question: What is the average SAT score of students at UCSB?

Given Information:

  • Sample size: n = 50 students
  • Sample mean: \bar{x} = 1180
  • Population standard deviation: \sigma = 120 (known from past data)
  • Confidence level: 95\%

Question: Construct a 95\% confidence interval for the population mean SAT score.

Step 1: Check conditions

  • \sigma is known ✓
  • Use z-distribution ✓

Step 2: Find critical value

  • For 95\% CI: \alpha = 0.05, \frac{\alpha}{2} = 0.025
  • z^* = 1.96 (from z-table)

Step 3: Calculate SE

SE = \frac{\sigma}{\sqrt{n}} = \frac{120}{\sqrt{50}} = \frac{120}{7.071} = 16.97

Step 4: Calculate Margin of Error

ME = z^* \times SE = 1.96 \times 16.97 = 33.26

Step 5: Construct CI

CI = \bar{x} \pm ME = 1180 \pm 33.26 = (1146.7, 1213.3)

Final Answer: We are 95% confident that the true average SAT score is between 1146.7 and 1213.3.

Step-by-Step Example 2: Using t-Distribution 📝

🎯 Problem Setup

Research Question: What is the average daily coffee consumption at our office?

Given Information:

- Sample size: n = 16 employees

- Sample mean: \bar{x} = 2.8 cups

- Sample standard deviation: s = 0.9 (\sigma unknown)

- Confidence level: 90%

Question: Construct a 90% confidence interval for the population mean daily coffee consumption.

Step 1: Check conditions - \sigma is unknown ✓ - n < 30 ✓ - Use t-distribution ✓

Step 2: Calculate degrees of freedom - df = n - 1 = 16 - 1 = 15

Step 3: Find critical value - For 90% CI: \alpha = 0.10, \alpha/2 = 0.05 - t* = 1.753 (from t-table, df = 15)

Step 4: Calculate SE

SE = \frac{s}{\sqrt{n}} = \frac{0.9}{\sqrt{16}} = \frac{0.9}{4} = 0.225

Step 5: Calculate Margin of Error

ME = t^* \times SE = 1.753 \times 0.225 = 0.394

Step 6: Construct CI

CI = \bar{x} \pm ME = 2.8 \pm 0.394 = (2.406, 3.194)

Final Answer: We are 90% confident that the true average daily coffee consumption is between 2.406 and 3.194 cups.

Practice Problem: Test Your Skills! 🧠

🎯 Your Turn!

Problem: A researcher wants to estimate the average time students spend studying per day.

Given:

  • Sample size: n = 25 students
  • Sample mean: \bar{x} = 3.2 hours
  • Sample standard deviation: s = 1.1 hours
  • Confidence level: 95\%

Questions:

  1. Should you use z or t-distribution? Why?
  2. What are the degrees of freedom?
  3. What is the critical value?
  4. Calculate the 95% confidence interval
  5. Interpret your result in context

Step 1: Distribution Choice Use t-distribution because: - σ is unknown (only sample standard deviation s is given) - n = 25 < 30

Step 2: Degrees of Freedom df = n - 1 = 25 - 1 = 24

Step 3: Critical Value For 95% CI with df = 24: t* = 2.064

Step 4: Calculate CI

Standard Error: SE = \frac{s}{\sqrt{n}} = \frac{1.1}{\sqrt{25}} = \frac{1.1}{5} = 0.220

Margin of Error: ME = t^* \times SE = 2.064 \times 0.220 = 0.454

Confidence Interval: CI = \bar{x} \pm ME = 3.2 \pm 0.454 = (2.746, 3.654)

Step 5: Interpretation We are 95% confident that the true average study time for students is between 2.746 and 3.654 hours per day.

🤔 Think About It…

  • Why is the t-distribution appropriate here?
  • How would the interval change if n = 100?
  • What if we wanted 99% confidence instead?

Summary: Key Takeaways 🎯

🧠 Core Concepts

1. Distribution Choice - σ known → z-distribution - σ unknown + n ≥ 30 → z-distribution
- σ unknown + n < 30 → t-distribution

2. t-Distribution Properties - Heavier tails than z - Depends on degrees of freedom (df = n-1) - Approaches z as df increases

3. Critical Regions - α/2 in each tail for two-sided CI - Critical values from tables or software - Larger confidence → larger critical values

🛠️ Practical Skills

4. Calculation Steps 1. Check conditions (σ known?, sample size?) 2. Choose distribution (z or t) 3. Find critical value 4. Calculate standard error 5. Compute margin of error
6. Construct interval 7. Interpret in context

5. Interpretation - “We are C% confident…” - Focus on the process, not individual interval - Consider practical significance

6. Common Pitfalls to Avoid - Wrong distribution choice - Incorrect degrees of freedom - Using α instead of α/2 - Misinterpreting the interval

🏠 Back to Main Page