One & Two-Sample
Hypothesis Tests
Master the foundations of statistical inference for means and proportions: when to use each test, how to compute test statistics, and how to interpret results for real business decisions.
What Is Hypothesis Testing?
Hypothesis testing is a formal statistical procedure for deciding whether sample data provide enough evidence to reject a claim about a population parameter. You start with two competing statements:
The Testing Framework
One-Sample vs Two-Sample
The number of samples determines which test formula to use. The logic is the same: compare a statistic to a known or estimated standard.
Example: "Is our mean delivery time different from 3 days?"
Example: "Do customers in Region A spend more than Region B?"
Means vs Proportions
Within each sample type, your test statistic formula depends on whether you are testing a mean (\(\mu\)) or a proportion (\(p\)):
One-Sample Test Statistics
Use when \(\sigma\) is known
Use when \(\sigma\) is unknown, \(df = n-1\)
Use for proportions; \(np_0 \ge 10\) and \(n(1-p_0) \ge 10\)
Two-Sample Test Statistics
Welch's \(t\)-test (unequal variances assumed)
Where \(\hat{p} = \frac{x_1+x_2}{n_1+n_2}\) is the pooled proportion
\(z\)-test vs \(t\)-test
| \(z\)-test | \(t\)-test | |
|---|---|---|
| Population \(\sigma\) | Known | Unknown |
| Estimate of spread | \(\sigma\) | \(s\) (sample std dev) |
| Distribution | Standard Normal | Student's \(t\) with \(df\) |
| When to use for means | Large \(n\) or \(\sigma\) known | Small \(n\), \(\sigma\) unknown |
| Proportions | Always \(z\) | Not used |
One-Tailed vs Two-Tailed Tests
Rejection region on the left.
"Is the mean less than the target?"
Rejection region on both sides.
"Is the mean different from the target?"
Rejection region on the right.
"Is the mean greater than the target?"
Step-by-Step Procedure
Example 1: One-Sample \(t\)-test
Example 2: One-Sample \(z\)-test for \(p\)
Example 3: Two-Sample \(t\)-test
Interpreting the \(p\)-value
Common Mistakes to Avoid
Summary of All Tests
| Test | Parameter | Statistic | Key Formula |
|---|---|---|---|
| 1-sample \(z\) (mean) | \(\mu\) | \(z\) | $$\frac{\bar{x}-\mu_0}{\sigma / \sqrt{n}}$$ |
| 1-sample \(t\) (mean) | \(\mu\) | \(t\) | $$\frac{\bar{x}-\mu_0}{s / \sqrt{n}}$$ |
| 1-sample \(z\) (proportion) | \(p\) | \(z\) | $$\frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$$ |
| 2-sample \(t\) (means) | \(\mu_1-\mu_2\) | \(t\) | $$\frac{\bar{x}_1-\bar{x}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}$$ |
| 2-sample \(z\) (proportions) | \(p_1-p_2\) | \(z\) | $$\frac{\hat{p}_1-\hat{p}_2}{\sqrt{\hat{p}(1-\hat{p})\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}}$$ |
Question 1 of 5
A manager wants to test whether the mean customer satisfaction score has changed from 75. She collects a sample and does not know the population standard deviation. Which test should she use?
Question 2 of 5
For a one-sample \(z\)-test for proportions, which condition must be satisfied for the test to be valid?
Question 3 of 5
A sample of \(n = 50\) yields \(\bar{x} = 102\) with \(s = 10\). Testing \(H_0: \mu = 100\) vs \(H_a: \mu > 100\), what is the test statistic?
Question 4 of 5
In a two-sample \(z\)-test for proportions, the pooled proportion \(\hat{p}\) is used in the standard error. Why do we pool?
Question 5 of 5
A researcher finds a \(p\)-value of 0.03 when testing at \(\alpha = 0.05\). Which conclusion is correct?