Chapter 8: Confidence Intervals

Estimating Population Parameters

Point Estimates • Error • z-Intervals •t-Intervals

Brace for Impact!

Welcome to Statistical Inference.

A lot of details are coming your way.
The training wheels are officially off! Concepts are dense, formulas are detailed, and reading carefully is everything.

More Complex Formulas

Deep Reading Required

Rigorous Interpretation

The Inference Roadmap

This is what the rest of our semester looks like.

INFERENCE
We start here!

Confidence Intervals

  • 1-Mean (Ch.8)
  • 2-Mean
  • Proportions

Hypothesis Testing

1-Mean2-MeanProportionsChi-SquareANOVALinear Regression

Coming Soon...

Estimating a Population Mean ($\mu$)

Estimating the Unknown

Point Estimate:
A single value of a statistic used to estimate a parameter.
(e.g., Using $\bar{x}$ to estimate $\mu$)
Confidence Interval (CI):
An interval of numbers obtained from a point estimate, used to estimate the parameter.
  • Confidence Level: The confidence we have that the parameter lies in the interval.
  • CI Estimate: The confidence level AND the confidence interval.

Visualizing the Estimate

Point Estimate ($\bar{x}$) vs. Interval Estimate

x̄ (Point)Confidence Interval

Understanding Confidence Intervals

Imagine taking many samples. Each sample gives a different interval. Most catch the true mean, but some miss!



True Population Mean(μ)

Blue intervals contain the true mean. Red intervals miss the true mean.

I. C.I. when $\sigma$ Is Known

The Foundation (from Normal Distributions)

Remember the normal distribution logic regarding sample means ($\bar{x}$):

Approximately $95\%$ of all samples have means within $2$ standard deviations of $\mu$.

More precisely, $100(1-\alpha)\%$ of all samples have means within $z_{\alpha/2}$standard deviations of $\mu$.

The One-Mean $z$-Interval Procedure

Purpose & Assumptions

Purpose: To find a CI for a population mean, $\mu$.


Assumptions:

  1. Simple random sample
  2. Normal population OR large sample ($n \ge 30$)
  3. $\sigma$ is KNOWN.

The 3 Steps

1Find Critical Value: For confidence level $1-\alpha$, use the normal table to find $z_{\alpha/2}$.

2Find the Interval: The CI for $\mu$is:

$\bar{x} \pm z_{\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}$

3Interpret: We are $(1-\alpha)\%$confident that the true population mean $\mu$ falls in this interval.

When to Use the $z$-Interval

Sample Size ($n$)Guideline for Use
Small ($n <15$)Use ONLY when the variable is normally distributed (or very close).
Moderate ($15 \le n \le 30$)Use UNLESS the data contain outliers or the variable is far from normal.
Large ($n \ge 30$)Use essentially without restriction. (Watch out for severe outliers).
Fundamental Principle of Data Analysis:
Before performing statistical inference, EXAMINE the sample data(e.g., plot it). If conditions are violated, DO NOT apply the procedure. Use a more appropriate one.

Margin of Error ($E$)

Definition

The margin of error for the estimate of $\mu$ is $E$. It is the "plus or minus"part of the interval.

$E = z_{\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}$

Interval is computed as:$\bar{x}\pm E$

x̄x̄ - zα/2 · σ/√nx̄ + zα/2 · σ/√nEE

Trade-offs & Accuracy

  • Critical Value: The critical value ($z$ or $t$) increaseswith higher confidence levels.
  • Margin of Error: A larger critical value results in alarger margin of error ($E$).
  • Wider Interval: The margin of error, added to and subtracted from the point estimate, creates the confidence interval. Therefore, a higherconfidence level leads to a wider interval.

  • Confidence Level (Trade-off):
    fixed sample size $\rightarrow$ decreased confidence level $\rightarrow$ decreased$E$
    (Improves interval tightness, but less confident).
  • Sample Size($n$):
    fixed confidence level $\rightarrow$ increased sample size $\rightarrow$ decreased$E$
    (Improves the accuracy of the estimate through more data).

Determining Required Sample Size ($n$)

If we want a specific Margin of Error ($E$) at a specific Confidence Level($1-\alpha$), we can solve for $n$:

$n = \left(\frac{z_{\alpha/2} \cdot \sigma}{E}\right)^2$

Crucial Rule

ALWAYS ROUND UP!

If your calculation gives $n = 41.12$, you must take $n = 42$ to ensure your margin of error requirement is strictly met.

II. C.I. when $\sigma$ is UNKNOWN

The Reality of Statistics

In real life, if we don't know the population mean ($\mu$), we almost certainly don't know the population standard deviation ($\sigma$).


The Solution: Student's $t$-Distribution

We replace $\sigma$ with our sample standard deviation $s$. The standard normal$z$ is replaced with the $t$-statistic:

$t = \frac{\bar{x} - \mu}{s/\sqrt{n}}$

Degrees of Freedom (df) = $n -1$

Properties of $t$-Curves

  • Area: Total area under curve = $1$.
  • Asymptotes: Extends indefinitely, never touches x-axis.
  • Symmetry: Symmetric about $0$.
  • Convergence: As df ($n-1$) gets larger, the $t$-curve looks increasingly like the standard normal $z$-curve.
The t-dist has "fatter tails" than Normal for small n.

The One-Mean $t$-Interval Procedure

Assumptions

  1. Simple random sample
  2. Normal pop. OR large sample ($n \ge 30$)
  3. $\sigma$ is UNKNOWN.

The 3 Steps

1Critical Value: Find$t_{\alpha/2}$with $df = n-1$.

2Interval: Compute CI:

$\bar{x} \pm t_{\alpha/2} \cdot \frac{s}{\sqrt{n}}$

3Interpret.

NOTE: Exact for normal populations; approx. correct for large samples from nonnormal pops.

The Role of Degrees of Freedom ($df$)

Degrees of Freedom ($df = n-1$) determines the shape of the $t$-distribution.
Smaller $df$ means we are less certain, resulting in "fatter tails". We compensate by using wider intervals.


Standard Normal ($z$)
Area in tails (beyond $\pm 1.96$): 5.00%
$t$-Curve (df=4)
Area in tails (beyond $\pm 1.96$): 12.16%

Real-World Data Set Application

Mobile Homes

25 different confidence intervals for mean price (samples of 36).Demonstrates how 95% of intervals actually contain true $\mu$.

Civilian Labor Force Ages

Sample dataset detailing ages of 50 randomly selected people. Perfect for applying the t-interval with $n \ge 30$.

Pickpocket Offenses

Losses ($) for $n=25$ offenses. Includes normal probability plots to assess normality before using small-sample procedures.

Chicken Consumption

Normal plots showing visually the difference between original data and data with an outlier removed. Highlights the "Fundamental Principle".

Key Takeaways

  • Range: A confidence interval provides a range in which the population mean is likely to fall.
  • CI Estimate: Includes the confidence level AND the confidence interval.
  • Critical Value: The critical value($z$ or $t$) increases with higher confidence levels.
  • Margin of Error: A larger critical value results in a larger margin of error ($E$).
  • Interval Width: A higher confidence level leads to a wider interval.
  • Sample Size Impact:Increasing sample size reduces confidence interval width, making estimates more precise!

R Code: One-Mean $z$-Interval

Manual calculation assuming $\sigma$ is known.

# Data & Parameters
data <- c(54, 57, 53, 59, 58)
sigma <- 5            # Population Std Dev is KNOWN
alpha <- 0.05         # For 95% Confidence Level

n <- length(data)
x_bar <- mean(data)

# 1. Critical Value: 
# Using qnorm for the normal distribution
z_star <- qnorm(1 - alpha/2)

# 2. Margin of Error
ME <- z_star * (sigma / sqrt(n))

# 3. Report the Interval
z_star
ME
c(x_bar - ME, x_bar + ME)

R Code: One-Mean $t$-Interval

Manual calculation assuming $\sigma$ is UNKNOWN (we use $s$).

# Data & Parameters
data <- c(54, 57, 53, 59, 58)
alpha <- 0.05         # For 95% Confidence Level

n <- length(data)
x_bar <- mean(data)
s <- sd(data)         # We calculate Sample Std Dev from data
df <- n - 1           # Degrees of Freedom

# 1. Critical Value: 
# Using qt for the t-distribution
t_star <- qt(1 - alpha/2, df)

# 2. Margin of Error
ME <- t_star * (s / sqrt(n))

# 3. Report the Interval
t_star
ME
c(x_bar - ME, x_bar + ME)

Questions?

End of Chapter 8: Confidence Intervals