PSTAT 5LS – Theory-Based Inference for p (Slide Set 5)

Course Logistics and Administrative Details

  • Course: PSTAT 5LS (Statistics)
  • Current Topic: Theory-Based Inference for a Population Proportion pp (Slide Set 5)
  • Lecture Timeline
    • Today: Begin Slide Set 5 (Theory-Based Inference for pp)
    • Next Time: Continue/finish Slide Set 5
  • Upcoming Deadlines (Summer session examples)
    • HW 2 due Tue Jul 8, 11:59 PM
    • HW 3 due Mon Jul 14, 11:59 PM
    • HW 4 noted on slides (exact date partially obscured)
  • Office Hours
    • Instructor: Tue & Thu, 2–3 PM via Zoom (encouraged to attend)

Transition: From Simulation-Based to Theory-Based Methods

  • Previous slide sets used computer‐generated randomization/simulation distributions.
  • Empirical finding: these simulated distributions of p^\hat p looked approximately normal.
    • Example graphics shown
    • “Buzz the dolphin” correct-button guesses ⇒ bell-shaped curve for simulated p^\hat p.
    • Community recycling rate simulation likewise centered & symmetric.
  • Insight: The empirical bell shapes hint that a mathematical normal model can replace repeated simulations once its validity is justified.

Sampling-Distribution Fundamentals

  • Sampling distribution: distribution of any sample statistic (e.g., p^,  xˉ\hat p,\; \bar x) over all possible samples of fixed size n from the population.
    • Describes shape, center, variability due solely to random sampling.
    • Lets us quantify how “unusual” one observed statistic is when a null hypothesis is true.

Distribution of the Sample Proportion p^\hat p

  • Center: E[p^]=pE[\hat p]=p (the true population proportion).
  • Variability: Standard Error (SE)SE=p(1p)n\text{SE}=\sqrt{\dfrac{p(1-p)}{n}}
    • Acts as a new “ruler” for gauging how far an observed p^\hat p is from pp.

Central Limit Theorem (CLT) for Proportions

  • When certain conditions are met, the sampling distribution of p^\hat p is approximately normal with
    • Mean pp
    • Standard deviation SE=p(1p)/n\text{SE}=\sqrt{p(1-p)/n}.
  • Enables theory-based inference (z tests & CIs) rather than simulation.

Conditions Required for the Normal Approximation

1 Independence
  • Observations must not influence one another.
    • Usually reasonable if data came from a simple random sample.
    • If sampling without replacement from a finite population of size NN, check the 10 % rule (sample n0.10Nn \le 0.10N) to treat draws as independent.
2 Success–Failure Condition (S–F)
  • Need at least 10 expected successes & 10 expected failures.
    • “Success” = category of interest; “failure” = the other category.
  • For confidence intervals we use p^\hat p: np^10n\hat p \ge 10 and n(1p^)10n(1-\hat p) \ge 10.
  • For hypothesis tests we use the null value p<em>0p<em>0: np</em>010np</em>0 \ge 10 and n(1p0)10n(1-p_0) \ge 10.
    • Rationale: when H<em>0H<em>0 is true, the true proportion equals p</em>0p</em>0, so expected counts derive from p0p_0, not from data.
  • The cutoff “10” is empirical—balances approximation accuracy vs. practicality.

Hypothesis-Testing Framework for a Single Proportion

  1. State hypotheses
    • Null: H<em>0!:p=p</em>0H<em>0!: p = p</em>0
    • Alternative (choose
    • p0p_0 is supplied by context, never from data.
  2. Check conditions (Independence & S–F as above).
  3. Compute test statistic zz (standardized p^\hat p).
  4. Find p-value from the standard normal distribution.
  5. Decision: compare p-value to significance level α\alpha (e.g., 0.05).
  6. Contextual conclusion: interpret in plain language.

Standardization and the z Test Statistic

  • Formula z=p^p<em>0p</em>0(1p0)nz = \dfrac{\hat p - p<em>0}{\sqrt{\dfrac{p</em>0(1-p_0)}{n}}}
    • Numerator: observed difference between sample and hypothesized proportions.
    • Denominator: SE computed with p<em>0p<em>0 (because under H</em>0H</em>0, p=p0p=p_0).
  • Interpretation
    • z=2z = 2 ⇒ observed p^\hat p lies 2 SEs above p0p_0.
    • Links directly to the normal curve & 68–95–99.7 rule.
Visual Recall of 68–95–99.7 Rule
  • Within ±1\pm1 SE: ~68 % of statistics.
  • Within ±2\pm2 SE: ~95 %.
  • Within ±3\pm3 SE: ~99.7 %.
  • Helps build intuition; exact p-values often require software.

Using R’s pnorm() for Normal Probabilities

  • Syntax: pnorm(q, mean = 0, sd = 1, lower.tail = TRUE)
    • q = quantile (z-score)
    • lower.tail = TRUE (default) ⇒ P(Zq)P(Z \le q).
    • lower.tail = FALSE ⇒ P(Z > q) (right tail).
  • Tail selection depends on the alternative hypothesis:
    • Left-tailed (<): p-value = pnorm(z, ... , lower.tail = TRUE).
    • Right-tailed (>): p-value = pnorm(z, ... , lower.tail = FALSE).
    • Two-tailed (\neq): p-value = 2 * pnorm(|z|, lower.tail = FALSE) (or multiply the smaller tail by 2).

Worked Examples

1 Dolphin Communication (Buzz & Doris)
  • Hypotheses: H0!: p = 0.50 \;\text{vs}\; HA!: p > 0.50.
  • Data: n=16,  p^=15/16=0.9375n = 16,\; \hat p = 15/16 = 0.9375.
  • Test statistic
    z=0.93750.500.50(10.50)/16=3.50z = \dfrac{0.9375-0.50}{\sqrt{0.50(1-0.50)/16}} = 3.50.
  • p-value (right tail)
  pnorm(3.50, mean = 0, sd = 1, lower.tail = FALSE)  # ≈ 0.00023

p0.00023p \approx 0.00023 (highly significant).

2 Community Recycling Rate
  • Hypotheses: H<em>0!:p=0.70  vs  H</em>A!:p0.70H<em>0!: p = 0.70 \;\text{vs}\; H</em>A!: p \neq 0.70.
  • Data: n=800,  p^=530/800=0.6625n = 800,\; \hat p = 530/800 = 0.6625.
  • Test statistic
    z=0.66250.700.70(10.70)/8002.315z = \dfrac{0.6625-0.70}{\sqrt{0.70(1-0.70)/800}} \approx -2.315.
  • p-value (two tails)
  2 * pnorm(-2.315, mean = 0, sd = 1, lower.tail = TRUE)  # ≈ 0.0206

p0.0206p \approx 0.0206 (significant at α=0.05\alpha=0.05 but not at stricter levels like 0.01).

Interpreting p-Values & Decisions

  • Definition: p-value = probability, under H0H_0, of observing a statistic as extreme or more extreme than the one obtained.
  • Direction matters:
    • H<em>A:p<p</em>0H<em>A: p < p</em>0 ⇒ left tail only.
    • H<em>A:p>p</em>0H<em>A: p > p</em>0 ⇒ right tail only.
    • H<em>A:pp</em>0H<em>A: p \neq p</em>0 ⇒ both tails (double the smaller tail).
  • Decision rule at level α\alpha
    • If pαp \le \alphaReject H0H_0 ⇒ result is statistically significant.
    • If p > \alpha ⇒ Fail to reject H0H_0 ⇒ not statistically significant.

Practical & Conceptual Takeaways

  • Once conditions hold, the normal model offers a fast, exact alternative to resampling.
  • Checking assumptions (randomness & S–F) is not optional; violations may invalidate results.
  • The SE built from p0p_0 reflects the variability expected under the null—a key distinction from confidence intervals.
  • Software (e.g., R, pnorm) is usually needed for precise p-values beyond simple z scores of 1, 2, 3.
  • Interpret findings in the context of the original research question, not just in terms of abstract numbers.