๐Ÿ”Ž The Proportion Files
pฬ‚
TOP EDU PREP ยท CASE FILE SERIES ยท UNIT 6

The Proportion Files:
Case of the Missing Percentage

Somewhere out there is a true population proportion โ€” and nobody has ever seen it. Every poll, every clinical trial, every factory inspection is really just a detective gathering clues about a number that's hiding in plain sight. Open this casebook, put on your coat, and learn the tools real statisticians use to hunt it down: confidence intervals, hypothesis tests, and the two proportion tricks that solve every case in Unit 6.

6 case files Worked examples + solutions Mobile-friendly casebook By Teacher Minho Kim
FILE 01

Range of Suspicion

Why we estimate with an interval, not a single number.

FILE 02

Trial of the Null

H0, Ha, and what a p-value actually measures.

FILE 03

One Suspect

The one-proportion z-test and z-interval.

FILE 04

Two Suspects

Comparing two proportions head-to-head.

FILE 05

Wrongful Verdicts

Type I, Type II error, and statistical power.

FILE 06

The Casebook

Every formula and rule, on one page.

CASE FILE 01

The Range of Suspicion

THE LOGIC OF CONFIDENCE INTERVALS

Inspector P-Hat never claims to know the exact truth. "Nobody has ever met the real population proportion," she says, tapping her notebook. "It's a shy number โ€” call it p โ€” and it never comes out to be interviewed. All I can do is question a sample of witnesses and report my best guess."

Her partner, Sergeant Z, always reminds her: a single guess is risky. "Give the Chief a range, not a point," he says. "A range of suspicion โ€” wide enough to very likely contain the real number, narrow enough to still be useful."

๐Ÿ•ต๏ธWhy an interval, not a single number?

  • A point estimate (like a sample proportion \(\hat p\)) is our single best guess for the true parameter \(p\) โ€” but different samples give different \(\hat p\) values, so any single guess is almost certainly a little off.
  • A confidence interval reports a plausible range of values for \(p\), built from the point estimate plus a margin of error.
  • The width of that range depends on how confident we want to be, and how much the sample proportion bounces around from sample to sample (its standard error).
FORMULA โ€” ONE-PROPORTION CONFIDENCE INTERVAL
\[ \hat p \;\pm\; z^{*}\sqrt{\dfrac{\hat p (1-\hat p)}{n}} \]

๐Ÿ“ŒWhat "95% confident" really means

COMMON TRAP โ€” DO NOT FALL FOR IT A 95% confidence interval does not mean "there is a 95% probability that the true \(p\) is in this interval." Once the interval is calculated, \(p\) either is or isn't inside it โ€” there's no more randomness left. The correct meaning: if we repeated this sampling process many, many times, about 95% of the intervals we'd build would capture the true proportion \(p\). Confidence is a statement about the method, not about one specific interval.
EVIDENCE #1 The Missing Umbrella Poll

Detective P-Hat surveys \(n = 200\) randomly chosen city residents and asks whether they own an umbrella. \(x = 120\) say yes. Build a 95% confidence interval for the true proportion \(p\) of umbrella owners in the whole city.

  • Conditions: Random sample โœ“. Independence: 200 is less than 10% of the city โœ“. Large Counts: \(n\hat p = 120 \ge 10\) and \(n(1-\hat p)=80\ge 10\) โœ“.
  • Point estimate: \(\hat p = \dfrac{120}{200} = 0.600\)
  • Standard error: \(SE = \sqrt{\dfrac{0.6(0.4)}{200}} = \sqrt{0.0012} \approx 0.0346\)
  • Critical value: for 95% confidence, \(z^{*} = 1.96\)
  • Margin of error: \(ME = 1.96 \times 0.0346 \approx 0.0679\)
  • Interval: \(0.600 \pm 0.068 \;\rightarrow\; (0.532,\ 0.668)\)
RANGE CONFIRMED We are 95% confident the true proportion of umbrella owners in the city is between 53.2% and 66.8%.
Quick Case: A different sample of \(n = 150\) residents finds \(x = 90\) who say they recycle regularly. Find a 95% confidence interval for the true proportion of recyclers. (Try it yourself first!)
\(\hat p = \dfrac{90}{150}=0.600\). \(SE=\sqrt{\dfrac{0.6(0.4)}{150}}=\sqrt{0.0016}=0.0400\). Margin of error \(=1.96(0.0400)=0.0784\). Interval: \(0.600 \pm 0.078 \rightarrow (0.522,\ 0.678)\). We are 95% confident the true recycling rate is between 52.2% and 67.8%.

โš–๏ธWhat changes the width of the range?

  • Higher confidence level (say 99% instead of 95%) โ†’ bigger \(z^{*}\) โ†’ wider interval. More certainty requires a bigger net.
  • Larger sample size \(n\) โ†’ smaller standard error โ†’ narrower interval. More witnesses, sharper picture.
  • The interval says nothing useful if the sample wasn't random, or if the Large Counts condition fails โ€” a shaky witness makes for a shaky case.
\(\hat p\) sample proportion
\(p\) true population proportion
\(z^{*}\) critical value
ME margin of error
SE standard error
CASE FILE 02

Trial of the Null

THE LOGIC OF HYPOTHESIS TESTING โ€” Hโ‚€, Hโ‚, AND THE P-VALUE

Every case at the agency ends in a courtroom. The suspect โ€” a claim about the world โ€” is presumed innocent until the evidence says otherwise. Judge Nullis always opens with the same statement: "We assume nothing unusual is happening, until the data forces us to think otherwise."

That presumption of innocence is the null hypothesis, \(H_0\). The detective's suspicion โ€” that something is going on โ€” is the alternative hypothesis, \(H_a\). And the p-value is simply: if the suspect really were innocent, how surprising would evidence this extreme be?

โš–๏ธThe four pieces of every trial

  • \(H_0\) โ€” the null hypothesis: the "nothing new here" claim, usually stating a parameter equals a specific value (e.g. \(p = p_0\)). This is what's assumed true unless the evidence overwhelms it.
  • \(H_a\) โ€” the alternative hypothesis: what the detective actually suspects โ€” that \(p\) differs from, is greater than, or is less than \(p_0\).
  • Test statistic: a standardized score (here, a z-score) measuring how far the sample result is from what \(H_0\) predicts, in standard errors.
  • p-value: the probability of getting a test statistic at least as extreme as ours, assuming \(H_0\) is true. A small p-value is strong evidence against \(H_0\).
THE GOLDEN RULE OF VERDICTS If the p-value is small (typically less than the significance level \(\alpha\), often 0.05), the evidence is unlikely to have happened by chance alone under \(H_0\) โ€” reject \(H_0\). If the p-value is not small, the evidence isn't strong enough โ€” fail to reject \(H_0\). We never "accept" or "prove" \(H_0\); a courtroom that fails to convict hasn't proven innocence, only that the evidence wasn't strong enough.
EVIDENCE #2 The Coin of Sergeant Fivecents

A suspicious coin is confiscated. Sergeant Z claims it's unfair. He flips it \(n = 100\) times and gets \(x = 62\) heads. Test, at \(\alpha = 0.05\), whether the coin's true probability of heads \(p\) differs from 0.5.

  • Hypotheses: \(H_0: p = 0.5\)    \(H_a: p \ne 0.5\)
  • Conditions: Random flips โœ“. \(np_0 = 50 \ge 10\), \(n(1-p_0)=50\ge10\) โœ“.
  • Sample proportion: \(\hat p = \dfrac{62}{100} = 0.62\)
  • Standard error under \(H_0\): \(SE_0 = \sqrt{\dfrac{0.5(0.5)}{100}} = 0.05\)
  • Test statistic: \(z = \dfrac{0.62-0.5}{0.05} = 2.40\)
  • p-value (two-sided): \(p = 2 \times P(Z > 2.40) \approx 0.0164\)
Hโ‚€ REJECTED Since \(0.0164 < 0.05\), we reject \(H_0\). There is convincing evidence the coin's true heads probability is different from 0.5 โ€” the coin looks unfair.
Quick Case: A cafe claims 40% of customers order iced coffee. A detective samples \(n=80\) customers and finds \(x=40\) order iced coffee. Test \(H_0: p=0.40\) vs \(H_a: p>0.40\) at \(\alpha=0.05\). What's the verdict?
\(\hat p = 40/80 = 0.50\). \(SE_0=\sqrt{\dfrac{0.4(0.6)}{80}}=\sqrt{0.003}\approx0.0548\). \(z=\dfrac{0.50-0.40}{0.0548}\approx1.83\). One-sided p-value \(=P(Z>1.83)\approx0.0336\). Since \(0.0336<0.05\), reject \(H_0\) โ€” convincing evidence more than 40% of customers order iced coffee.

๐ŸงญChoosing a direction for \(H_a\)

SuspicionAlternative Hypothesisp-value calculation
"different from" \(p_0\)\(H_a: p \ne p_0\)two-sided โ€” double the tail area
"greater than" \(p_0\)\(H_a: p > p_0\)one-sided โ€” right tail only
"less than" \(p_0\)\(H_a: p < p_0\)one-sided โ€” left tail only
\(H_0\) null hypothesis
\(H_a\) alternative hypothesis
\(\alpha\) significance level
z test statistic
p-value
CASE FILE 03

One Suspect, One Proportion

THE ONE-PROPORTION Z-TEST AND Z-INTERVAL, FORMALIZED

Files 01 and 02 taught the logic. File 03 is where the agency writes the official procedure โ€” the exact steps that go in every report, so any detective in the building can reproduce the same investigation.

๐Ÿ“‹The official checklist (STATE โ†’ PLAN โ†’ DO โ†’ CONCLUDE)

  • STATE: Write \(H_0\) and \(H_a\) in terms of the population proportion \(p\), and name your significance level \(\alpha\) (for an interval, name the confidence level).
  • PLAN: Choose a one-proportion z-procedure, and check conditions โ€” Random (random sample / random assignment), Independence (10% condition: \(n \le 0.10N\)), and Large Counts (for a test, \(np_0 \ge 10\) and \(n(1-p_0)\ge10\); for an interval, \(n\hat p\ge10\) and \(n(1-\hat p)\ge10\)).
  • DO: Compute the sample proportion, standard error, test statistic (or margin of error), and the p-value (or the interval).
  • CONCLUDE: Compare the p-value to \(\alpha\) and state the verdict in the context of the story โ€” or state what the interval captures.
FORMULA โ€” ONE-PROPORTION Z-TEST STATISTIC
\[ z = \dfrac{\hat p - p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}} \]
FORMULA โ€” ONE-PROPORTION Z-INTERVAL
\[ \hat p \;\pm\; z^{*}\sqrt{\dfrac{\hat p(1-\hat p)}{n}} \]
NOTICE THE SWITCH For a test, the standard error uses the claimed value \(p_0\) โ€” because we're asking "if the claim were true, how much would \(\hat p\) bounce around?" For an interval, we don't have a claimed value to test, so we use the observed \(\hat p\) instead.
EVIDENCE #3 The Faulty Gadget Factory

A factory claims its defect rate is only 5%. An inspector samples \(n = 400\) gadgets and finds \(x = 28\) defective. Test, at \(\alpha = 0.05\), whether the true defect rate is higher than the factory claims.

  • Hypotheses: \(H_0: p = 0.05\)    \(H_a: p > 0.05\), where \(p\) = true defect rate
  • Conditions: Random sample โœ“. \(np_0 = 20 \ge 10\), \(n(1-p_0)=380\ge10\) โœ“.
  • Sample proportion: \(\hat p = \dfrac{28}{400} = 0.07\)
  • Standard error under \(H_0\): \(SE_0 = \sqrt{\dfrac{0.05(0.95)}{400}} \approx 0.0109\)
  • Test statistic: \(z = \dfrac{0.07-0.05}{0.0109} \approx 1.84\)
  • p-value (one-sided): \(p = P(Z>1.84) \approx 0.0332\)
Hโ‚€ REJECTED Since \(0.0332 < 0.05\), we reject \(H_0\). There is convincing evidence the true defect rate is greater than the claimed 5%. (Note: at \(\alpha=0.01\) this evidence would not be strong enough โ€” the verdict depends on the standard the agency sets in advance!)
Quick Case: The same factory data (\(\hat p=0.07\), \(n=400\)) โ€” build a 90% confidence interval for the true defect rate instead of testing it. (\(z^*=1.645\) for 90% confidence.)
Interval uses \(\hat p\), not \(p_0\): \(SE=\sqrt{\dfrac{0.07(0.93)}{400}}\approx0.0128\). Margin of error \(=1.645(0.0128)\approx0.0210\). Interval: \(0.07\pm0.021 \rightarrow (0.049,\ 0.091)\). We're 90% confident the true defect rate is between 4.9% and 9.1% โ€” notice it barely excludes 5%, matching how close our test decision was.
\(p_0\) claimed/hypothesized value
10% condition
Large Counts condition
one-sided vs two-sided
CASE FILE 04

Two Suspects, Compared

THE TWO-PROPORTION Z-TEST AND Z-INTERVAL

Some cases have two suspects, and the real question isn't "is suspect A guilty?" โ€” it's "did A and B behave differently at all?" Detective P-Hat now needs two witnesses, two proportions, and one new question: is the gap between them just sampling noise, or a real difference?

๐Ÿ”The idea

  • We now compare \(p_1\) and \(p_2\), the true proportions in two populations (or two treatment groups).
  • The hypotheses are usually about the difference: \(H_0: p_1 - p_2 = 0\) (no difference) vs. \(H_a: p_1-p_2 \ne 0\) (or \(>0\), or \(<0\)).
  • For a test, since \(H_0\) assumes \(p_1=p_2\), we pool both samples into one combined estimate \(\hat p_c\) to compute the standard error โ€” one shared "innocent until proven guilty" number.
  • For a confidence interval, there's no shared claim to test, so each sample keeps its own proportion in the standard error.
FORMULA โ€” TWO-PROPORTION Z-TEST
\[ \hat p_c = \dfrac{x_1+x_2}{n_1+n_2} \qquad\qquad z = \dfrac{\hat p_1 - \hat p_2}{\sqrt{\hat p_c(1-\hat p_c)\left(\dfrac{1}{n_1}+\dfrac{1}{n_2}\right)}} \]
FORMULA โ€” TWO-PROPORTION Z-INTERVAL
\[ (\hat p_1 - \hat p_2) \;\pm\; z^{*}\sqrt{\dfrac{\hat p_1(1-\hat p_1)}{n_1}+\dfrac{\hat p_2(1-\hat p_2)}{n_2}} \]
EVIDENCE #4 Ad Campaign A vs. Ad Campaign B

A marketing detective tests two ad campaigns. Campaign A: \(n_1=500\), \(x_1=45\) clicks. Campaign B: \(n_2=520\), \(x_2=60\) clicks. Test, at \(\alpha=0.05\), whether the true click-through rates differ.

  • Hypotheses: \(H_0: p_1 = p_2\)    \(H_a: p_1 \ne p_2\)
  • Sample proportions: \(\hat p_1 = 45/500 = 0.090\),   \(\hat p_2 = 60/520 \approx 0.1154\)
  • Pooled proportion: \(\hat p_c = \dfrac{45+60}{500+520} = \dfrac{105}{1020}\approx0.1029\)
  • Conditions: Random โœ“. \(n_1\hat p_c,\ n_1(1-\hat p_c),\ n_2\hat p_c,\ n_2(1-\hat p_c)\) are all comfortably \(\ge10\) โœ“.
  • Standard error (pooled): \(SE_c = \sqrt{0.1029(0.8971)\left(\dfrac{1}{500}+\dfrac{1}{520}\right)} \approx 0.0190\)
  • Test statistic: \(z = \dfrac{0.090-0.1154}{0.0190} \approx -1.33\)
  • p-value (two-sided): \(p \approx 0.1823\)
Hโ‚€ NOT REJECTED Since \(0.1823 > 0.05\), we fail to reject \(H_0\). There isn't convincing evidence that the two campaigns' true click-through rates differ โ€” the gap we saw is small enough to be explained by sampling variability alone.

๐ŸงฉThe matching interval

Building a 95% confidence interval for \(p_1-p_2\) on the same data (using the unpooled standard error): difference \(=0.090-0.1154=-0.0254\), \(SE\approx0.0190\), margin of error \(=1.96(0.0190)\approx0.0372\), giving the interval \((-0.0626,\ 0.0118)\).

WHY THIS CONFIRMS THE TEST The interval for \(p_1-p_2\) contains 0 โ€” meaning "no difference" is a plausible value for the true gap. That lines up perfectly with failing to reject \(H_0: p_1=p_2\) at the matching confidence/significance level. A test and its matching interval should always agree like this.
Quick Case: Which standard error formula (pooled or unpooled) should you use for a two-proportion confidence interval, and why?
Unpooled. A confidence interval doesn't start by assuming \(p_1=p_2\) โ€” it's built to estimate the size of the gap, whatever it is โ€” so each group's own sample proportion is used in its own part of the standard error. Pooling is only valid when \(H_0\) itself claims the two proportions are equal, which only happens in the hypothesis test.
\(\hat p_c\) pooled proportion
pooled SE (for tests)
unpooled SE (for intervals)
\(p_1 - p_2\)
CASE FILE 05

Wrongful Verdicts

TYPE I & TYPE II ERRORS, AND STATISTICAL POWER

No courtroom is perfect. Sometimes the agency convicts someone who was truly innocent. Sometimes a genuinely guilty suspect walks free because the evidence wasn't strong enough. Every hypothesis test carries both risks โ€” the trick is understanding them, not eliminating them.

๐ŸšจThe two ways a verdict can go wrong

\(H_0\) is actually TRUE (innocent)\(H_0\) is actually FALSE (guilty)
Reject \(H_0\) (convict)Type I Error โ€” convicted an innocent suspect. Probability = \(\alpha\)Correct decision โœ“ โ€” caught the guilty suspect
Fail to reject \(H_0\) (acquit)Correct decision โœ“ โ€” let an innocent suspect goType II Error โ€” let a guilty suspect walk. Probability = \(\beta\)

๐Ÿ“Defining each term precisely

  • Type I error: rejecting \(H_0\) when \(H_0\) is actually true. Its probability is exactly \(\alpha\), the significance level you chose before the trial began.
  • Type II error: failing to reject \(H_0\) when \(H_0\) is actually false. Its probability is called \(\beta\), and it depends on how far the true parameter is from \(H_0\)'s claim, the sample size, and \(\alpha\).
  • Power: the probability of correctly rejecting a false \(H_0\) โ€” i.e., successfully catching a truly guilty suspect. Power \(= 1 - \beta\).
THE TRADE-OFF THE AGENCY CAN'T ESCAPE Lowering \(\alpha\) (demanding stronger evidence before convicting) reduces Type I errors โ€” but makes it easier to let a guilty suspect walk, raising \(\beta\) and lowering power. You cannot shrink both error rates at once without changing something else about the investigation.

๐Ÿ’ชWhat increases power (helps catch true guilt)?

  • Larger sample size \(n\) โ€” more witnesses sharpen the picture and shrink standard error. This is the detective's favorite lever, since it doesn't cost any Type I error risk.
  • Larger true effect size โ€” if the true \(p\) is very far from \(p_0\), it's easier to detect. A blatant crime is easier to prove than a subtle one.
  • Higher \(\alpha\) โ€” being willing to convict on weaker evidence raises power, but also raises the Type I error rate. A real trade-off, not a free lunch.
  • Less variability in the data โ€” a cleaner crime scene makes for clearer evidence.
EVIDENCE #5 The Case of the Overcautious Judge

Judge Nullis sets an unusually strict standard: \(\alpha = 0.01\) instead of the usual 0.05, because "wrongful convictions must be extremely rare." What happens to Type I error, Type II error, and power?

  • Type I error rate: decreases โ€” by definition it equals \(\alpha\), which just got smaller.
  • Type II error rate (\(\beta\)): increases โ€” it's now harder to reject \(H_0\) even when it's truly false, so more guilty suspects slip away.
  • Power: decreases โ€” since power \(=1-\beta\), and \(\beta\) just went up.
TRADE-OFF LOGGED A stricter courtroom convicts fewer innocent people, but at the direct cost of missing more genuinely guilty ones.
Quick Case: A quality-control test has \(H_0: p=0.05\) (defect rate is normal) vs \(H_a: p>0.05\) (defect rate too high). Describe, in the context of the factory, what a Type I error and a Type II error would each mean.
Type I error: the test concludes the defect rate is too high when it's actually normal โ€” the factory gets flagged/shut down unnecessarily. Type II error: the test fails to detect a genuinely elevated defect rate โ€” a real problem goes unnoticed and faulty products keep shipping.
\(\alpha\) = P(Type I error)
\(\beta\) = P(Type II error)
Power = \(1-\beta\)
FILE 06 โ€” FINAL

The Casebook

EVERY FORMULA, EVERY RULE โ€” CLOSED CASE SUMMARY

Case closed. Before Detective P-Hat files this away, she pins every formula, every condition, and every rule from Unit 6 to one board โ€” so any agent can walk in and be up to speed in five minutes.

1-Proportion Z-Interval

\[ \hat p \pm z^{*}\sqrt{\dfrac{\hat p(1-\hat p)}{n}} \]
Conditions: Random, 10% (\(n\le0.10N\)), Large Counts (\(n\hat p\ge10\), \(n(1-\hat p)\ge10\))

1-Proportion Z-Test

\[ z=\dfrac{\hat p-p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}} \]
Same conditions, but Large Counts uses \(p_0\) instead of \(\hat p\): \(np_0\ge10\), \(n(1-p_0)\ge10\)

2-Proportion Z-Interval

\[ (\hat p_1-\hat p_2)\pm z^{*}\sqrt{\dfrac{\hat p_1(1-\hat p_1)}{n_1}+\dfrac{\hat p_2(1-\hat p_2)}{n_2}} \]
Uses each sample's own \(\hat p\) โ€” unpooled standard error

2-Proportion Z-Test

\[ \hat p_c=\dfrac{x_1+x_2}{n_1+n_2},\quad z=\dfrac{\hat p_1-\hat p_2}{\sqrt{\hat p_c(1-\hat p_c)\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}} \]
Uses the pooled proportion \(\hat p_c\) since \(H_0\) assumes \(p_1=p_2\)
DECISION FLOWCHART โ€” WHICH TOOL DO I REACH FOR?
Q1Am I estimating an unknown proportion, or testing a specific claim about it? โ†’ Estimating: use a confidence interval. Testing a claim: use a hypothesis test.
Q2Am I working with one group, or comparing two groups? โ†’ One group: 1-proportion procedure. Two groups: 2-proportion procedure.
Q3Running a test? โ†’ Check conditions using the claimed value(s) (\(p_0\), or pooled \(\hat p_c\) for two groups).
Q4Building an interval? โ†’ Check conditions and compute the standard error using the observed sample proportion(s).
Q5p-value \(< \alpha\)? โ†’ Reject \(H_0\): convincing evidence for \(H_a\). p-value \(\ge \alpha\)? โ†’ Fail to reject \(H_0\): not enough evidence.

๐Ÿ—‚๏ธType I / Type II / Power โ€” one-line reminders

TermMeaningSymbol
Type I ErrorReject a true \(H_0\) (false alarm)\(\alpha\)
Type II ErrorFail to reject a false \(H_0\) (missed signal)\(\beta\)
PowerCorrectly reject a false \(H_0\)\(1-\beta\)

Power increases with: larger \(n\), larger true effect size, higher \(\alpha\), and less variability. Lowering \(\alpha\) always lowers power โ€” there is no way around this trade-off.

โœ…The confidence interval, restated one more time

"We are C% confident that the interval from ___ to ___ captures the true [population proportion in context]." This is a claim about the long-run success rate of the method, not a probability statement about one specific interval.

โ€” END OF FILE โ€”
TOP EDU PREP ยท Unit 6: Inference for Categorical Data: Proportions
Written by Teacher Minho Kim ยท Case File Series for Self-Study