FAD1015 Reader's Note — Sampling, Estimation & Hypothesis Testing
A behind-the-scenes look at Parts G and H of the Comprehensive Drill. This note builds both intuition (what is actually happening) and mechanics (how to compute without thinking).
The Big Picture: What Is Statistical Inference?
You have a population (all UM students). You want to know the average height $\mu$. You cannot measure everyone. So you take a sample, compute $\bar{x}$, and use that to guess $\mu$.
That is statistical inference: using what you know (the sample) to say something about what you do not know (the population).
There are two flavours:
| Flavour | Question | Example |
|---|---|---|
| Estimation (Part G) | "What is $\mu$?" | Estimate average height of UM students |
| Hypothesis Testing (Part H) | "Is $\mu$ equal to some specific value?" | Is average height = 165 cm? |
They are connected. A confidence interval tells you which values of $\mu$ are plausible. A hypothesis test tells you whether a specific $\mu_0$ is among those plausible values. Same coin, two sides.
Part G — Sampling & Estimation (Problems 41–46)
The Engine: Sampling Distribution of $\bar{X}$
You take one sample of size $n$ from the population. You get one $\bar{x}$.
Now imagine doing this over and over — take 1000 different samples of size $n$, compute $\bar{x}$ for each. The 1000 $\bar{x}$ values form a distribution. That is the sampling distribution of the sample mean.
Key fact: This distribution is normal (or approximately normal) with:
- Mean = $\mu$ (the true population mean — same as the original population)
- Standard deviation = $\displaystyle \frac{\sigma}{\sqrt{n}}$ — this is called the Standard Error
$$ \bar{X} \sim N!\left(\mu,\ \frac{\sigma}{\sqrt{n}}\right) $$
Intuition for Standard Error
Why does $\sigma/\sqrt{n}$ shrink as $n$ gets bigger?
Think of averaging more people. If you ask 5 people their height, the average could be all over the place. If you ask 1000 people, the average is much more stable — outliers cancel out. So the spread of possible $\bar{x}$ values gets smaller. That is the $\sqrt{n}$ in the denominator — it pulls the distribution tighter.
| Sample size $n$ | Standard Error | Behaviour |
|---|---|---|
| 1 | $\sigma$ | Same spread as population |
| 4 | $\sigma/2$ | Half the spread |
| 100 | $\sigma/10$ | One-tenth the spread |
The Central Limit Theorem (CLT) — Why You Can Sleep at Night
The CLT says: even if the population is not normal, the sampling distribution of $\bar{x}$ becomes approximately normal when $n$ is large enough.
- $n \ge 30$: good enough for most populations
- $n \ge 5$: good enough if the population is fairly symmetric
- If the population is already normal: any $n$ works
This is why normal distribution methods work even when your raw data looks nothing like a bell curve — the averages still behave nicely.
Confidence Intervals — The Fishing Net
A point estimate ($\bar{x} = 165$ cm) is a single number. It is almost certainly wrong — the true $\mu$ is not exactly 165.000... So instead, give a range:
$$ \bar{x} \pm \text{Margin of Error} $$
This is a Confidence Interval.
Intuition
Imagine casting a net to catch a fish ($\mu$). A wider net is more likely to catch it. A 99% net is wider than a 95% net. A larger sample gives a narrower net (because the standard error is smaller).
$$ \text{Width} \propto \frac{\text{critical value} \times \sigma}{\sqrt{n}} $$
The Big Trap: What "95% Confident" Means
Correct: "If we repeated this sampling process many times, 95% of the constructed intervals would contain the true $\mu$."
Wrong: "There is a 95% probability that $\mu$ lies in this specific interval."
$\mu$ is a fixed number, not a random variable. Either it is in the interval or it is not. The 95% is about the procedure — how reliable it is over many repetitions.
The z vs t Decision Tree (CRITICAL)
This is the #1 place to lose marks. Memorise this flowchart:
Is σ known?
├── YES → Use z (normal distribution)
│ CI = x̄ ± z·σ/√n
│
└── NO → What is n?
├── n ≥ 30 → Use z with s (CLT applies)
│ CI = x̄ ± z·s/√n
│
└── n < 30 → Use t (Student's t)
df = n - 1
CI = x̄ ± t·s/√n
The z Values to Memorise
| Confidence Level | $\alpha$ | $z_{\alpha/2}$ |
|---|---|---|
| 90% | 0.10 | 1.645 |
| 95% | 0.05 | 1.96 |
| 99% | 0.01 | 2.576 |
The t Value: Where to Find It
$t_{\alpha/2,, n-1}$ — read from the t-table:
- Rows = degrees of freedom ($n-1$)
- Columns = $\alpha/2$ (for a two-tailed CI)
Example: 95% CI, $n = 25$, $\sigma$ unknown
- $df = 24$, $\alpha/2 = 0.025$
- $t_{0.025,,24} = 2.064$
Rule of thumb: $t$ is always larger than $z$ for the same confidence level. The $t$-distribution has fatter tails because using $s$ instead of $\sigma$ adds uncertainty. As $n$ grows, $t \to z$.
Sample Size Formula (Problem 45–46)
If you want a CI with a specific margin of error $E$:
$$ n = \left(\frac{z_{\alpha/2} \cdot \sigma}{E}\right)^2 $$
Always round UP to the nearest whole number. If the formula gives 61.5, the answer is $n = 62$. A sample of 61 would give a margin of error larger than desired.
Trade-off: Higher confidence (99% vs 95%) → larger $z$ → larger $n$. More precision (smaller $E$) → larger $n$.
Part H — Hypothesis Testing (Problems 47–54)
The Courtroom Analogy
| Element | Courtroom | Hypothesis Testing |
|---|---|---|
| Defendant | Innocent until proven guilty | $H_0$ assumed true until evidence says otherwise |
| Verdict | Guilty / Not guilty | Reject $H_0$ / Fail to reject $H_0$ |
| Evidence | Witnesses, DNA | Test statistic, p-value |
| Threshold | "Beyond reasonable doubt" | $\alpha$ (significance level) |
Step 1: State $H_0$ and $H_1$
$H_0$ (Null hypothesis): Always contains equality ($=$, $\le$, or $\ge$). It is the status quo — what you assume is true.
$H_1$ or $H_a$ (Alternative hypothesis): What you want to find evidence for. It determines the tail direction.
| Problem says... | $H_0$ | $H_1$ | Type |
|---|---|---|---|
| "Test if mean differs from 100" | $\mu = 100$ | $\mu \neq 100$ | Two-tailed |
| "Test if mean is less than 8" | $\mu \ge 8$ (often written $\mu = 8$) | $\mu < 8$ | Left-tailed |
| "Test if mean is greater than 95" | $\mu \le 95$ (often written $\mu = 95$) | $\mu > 95$ | Right-tailed |
Shortcut: $H_1$ always points in the direction of the claim. $H_0$ is the opposite.
Step 2: Choose $\alpha$
Standard values: 0.10, 0.05, 0.01. Usually given in the problem.
Step 3: Calculate the Test Statistic
Identical formula to the z/t for CIs:
$$ z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} \qquad \text{or} \qquad t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} $$
The same decision tree for z vs t applies:
| Condition | Test |
|---|---|
| $\sigma$ known | z-test |
| $\sigma$ unknown, $n \ge 30$ | z-test with $s$ |
| $\sigma$ unknown, $n < 30$ | t-test, $df = n-1$ |
Step 4–5: Make a Decision (Three Ways, Same Answer)
All three methods always agree. Pick whichever is easiest.
Method 1: Critical Value (Traditional)
Compare your test statistic to a critical value from the table:
| Test Type | Reject $H_0$ if... | Example ($\alpha = 0.05$) |
|---|---|---|
| Two-tailed ($\neq$) | $\vert\text{stat}\vert > z_{\alpha/2}$ | $z > 1.96$ or $z < -1.96$ |
| Right-tailed ($>$) | $\text{stat} > z_{\alpha}$ | $z > 1.645$ |
| Left-tailed ($<$) | $\text{stat} < -z_{\alpha}$ | $z < -1.645$ |
Method 2: P-value
What is a p-value? The probability of observing your sample result (or something more extreme) if $H_0$ were true.
- Small p-value → the sample result is unlikely under $H_0$ → evidence against $H_0$
- Large p-value → the sample result is plausible under $H_0$ → not enough evidence
Decision rule:
- $p \le \alpha$ → Reject $H_0$ (statistically significant)
- $p > \alpha$ → Fail to reject $H_0$
The p-value tells you "how weird" your result is. A p-value of 0.0215 means: "If $H_0$ is true, there is only a 2.15% chance of seeing data this extreme." That is weird enough to reject at $\alpha = 0.05$, but not at $\alpha = 0.01$.
Method 3: Confidence Interval
Construct a $(1-\alpha)$ CI for $\mu$:
- $\mu_0$ inside the CI → Fail to reject $H_0$
- $\mu_0$ outside the CI → Reject $H_0$
This works because the CI shows the plausible values of $\mu$. If $\mu_0$ is not plausible (outside the CI), reject it.
Reading R Output (Problems 53–54)
When you see R output like:
One Sample t-test
data: sample
t = 2.456, df = 24, p-value = 0.0215
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
50.23 54.77
sample estimates:
mean of x
52.5
Read it:
| Field | What it tells you | Action |
|---|---|---|
t = 2.456 |
Test statistic | Compare to critical value if using traditional method |
df = 24 |
$n - 1$, so $n = 25$ | |
p-value = 0.0215 |
Probability under $H_0$ | If $p < \alpha$, reject $H_0$ |
alternative hypothesis: true mean is not equal to 50 |
This is a two-tailed test ($H_1: \mu \neq 50$) | |
95 percent CI: (50.23, 54.77) |
Does NOT contain $\mu_0 = 50$ | Reject $H_0$ at $\alpha = 0.05$ |
mean of x: 52.5 |
Sample mean $\bar{x}$ |
Mechanical Reference Tables
Choosing z vs t
| Situation | Use | Formula |
|---|---|---|
| $\sigma$ known | z | $\bar{x} \pm z_{\alpha/2}\cdot\sigma/\sqrt{n}$ |
| $\sigma$ unknown, $n \ge 30$ | z with $s$ | $\bar{x} \pm z_{\alpha/2}\cdot s/\sqrt{n}$ |
| $\sigma$ unknown, $n < 30$ | t | $\bar{x} \pm t_{\alpha/2,,n-1}\cdot s/\sqrt{n}$ |
Critical z Values
| $\alpha$ (two-tailed) | $z_{\alpha/2}$ |
|---|---|
| 0.10 (90% CI) | 1.645 |
| 0.05 (95% CI) | 1.96 |
| 0.01 (99% CI) | 2.576 |
One-Tailed vs Two-Tailed Critical Values
For one-tailed tests at $\alpha$:
- 90% → $z = 1.282$
- 95% → $z = 1.645$
- 99% → $z = 2.326$
For two-tailed tests at $\alpha$:
- 90% → $z = 1.645$
- 95% → $z = 1.96$
- 99% → $z = 2.576$
Writing Hypotheses Cheat Sheet
| Keywords in problem | $H_1$ | Tail |
|---|---|---|
| "different from", "changed", "not equal" | $\neq$ | Two |
| "greater than", "increased", "more than", "above" | $>$ | Right |
| "less than", "decreased", "fewer than", "below" | $<$ | Left |
P-value Decision
if p <= alpha:
reject H0
else:
fail to reject H0
Common Traps
- Rounding sample size: Always round up. $n = 61.1$ → $n = 62$.
- z vs t: $\sigma$ unknown + $n < 30$ = t. Everything else = z.
- $H_0$ always has equality. Even if the problem says "test if mean is less than 100", $H_0$ is $\mu \ge 100$ (or $\mu = 100$ in many textbooks).
- CI and hypothesis testing agree. If you reject $H_0$ with a test, the corresponding CI will exclude $\mu_0$.
- P-value is not the probability $H_0$ is true. It is the probability of the data given $H_0$ is true. Subtle but important.
- $n-1$ is the degrees of freedom. In R output, $df = n-1$.
Related Resources
- FAD1015 L20 — Sampling Distribution of the Mean
- FAD1015 L21-L22 — Estimation of Population Mean
- FAD1015 L23-L24 — Hypothesis Testing About the Mean
- FAD1015 L25-L26 — Hypothesis Testing in R
- Hypothesis Testing
- FAD1015 Tutorial 9 — Sampling and Sampling Distributions
- FAD1015 Tutorial 10 — Estimation of the Population Mean
- FAD1015 Tutorial 11 — Hypothesis Testing About the Mean
- FAD1015 Tutorial 12 — Hypothesis Testing in R