Hypothesis testing steps
A hypothesis test has five steps: state the null and alternative hypotheses, choose a significance level alpha (usually 0.05), compute the test statistic from the sample, find the p-value (or critical value), and reject the null if p is below alpha, otherwise fail to reject it.
Syntax
H0: mu = mu0; H1: mu != mu0 (two-sided) or mu > mu0 / mu < mu0 (one-sided)| Part | What it is |
|---|---|
H0 | the null hypothesis, the no-effect or status-quo claim being tested |
H1 | the alternative hypothesis, what you conclude if H0 is rejected |
alpha | the maximum acceptable probability of rejecting a true H0 |
Examples
1. H0: mean fill = 500 ml; H1: mean fill != 500 ml
2. alpha = 0.05
3. n = 25, x-bar = 505, s = 10: t = 5 / (10 / 5) = 2.5
4. p = T.DIST.2T(2.5, 24) = 0.0197
5. 0.0197 < 0.05Result: Reject H0: the mean fill differs from 500 ml
Critical value approach for the same test
=T.INV.2T(0.05, 24)Result: 2.064; since |2.5| > 2.064, reject H0
One-sided version: H1: mean > 500
p = T.DIST.RT(2.5, 24)Result: 0.0098
Common mistakes
- Choosing the direction of H1 after seeing the data; decide one-sided or two-sided before computing anything.
- Writing accept H0 when p is large; the correct wording is fail to reject, because the test cannot prove the null.
- Putting the claim you hope to show into H0; H0 is the hypothesis of no difference, the claim goes in H1.
Practice Hypothesis testing steps
These drills check your answer on live data, free, no account needed.
- One-sample t statisticA manager claims the average order value is 68 dollars. A random sample of 13 gives x̄ = 69.23 and s = 29.5. What is the t statistic for testing the claim? Round to 2 decimal places.
- Two-sided t test: p-value and decisionTest H0: μ = 68 against H1: μ ≠ 68 for the average order value (dollars). A random sample of 11 gives x̄ = 69.33 and s = 29.5. Find the p-value of the one-sample t test, then decide at α = 0.05. Round to 4 decimal places.
Questions
What is the difference between the p-value and critical value approaches?
They always agree. The p-value approach compares p with alpha; the critical value approach compares the statistic with the cutoff that corresponds to alpha.
Why is alpha usually 0.05?
Convention. It means accepting a 5% risk of a false positive. Use 0.01 when a false positive is costly, or report the exact p-value and let readers judge.
Which test should I use?
One mean: one-sample t. Two independent means: two-sample t. Before and after: paired t. Proportions: z-test. Counts in categories: chi-square. Relationship between two numeric variables: correlation or regression.
Related
- p-valueA p-value is the probability of a result at least as extreme as the observed one if the null is true. How to compute it from z and t, and common misreadings.
- Type I and Type II errorsA Type I error rejects a true null (false positive, probability alpha); a Type II error misses a false null (false negative, probability beta). Examples.
- One-sample t-testHow to run a one-sample t-test: compute t = (x-bar - mu0) / (s / sqrt(n)), find the p-value with n - 1 degrees of freedom and decide. Example and Excel.
- Statistical powerStatistical power is the probability a test detects a real effect, 1 - beta. What drives it, the 80% convention and sample size formulas with examples.