- Learn
- Mathematics
- Statistics
- Introduction to Statistics
- Hypothesis Testing
Hypothesis Testing
BeginnerLesson 9 of 12 in Introduction to Statistics Course
What you will learn
- Explain the reasoning behind a significance test: state competing hypotheses about a population, measure how surprising the sample would be if the null hypothesis were true, make a decision, and recognize the two ways that decision can be wrong.
- Turn a research question into null and alternative hypothesesName the population parameter a question is about and write a null and an alternative hypothesis that are clear, testable and fixed before looking at the data.
- Measure evidence with a test statistic and a p-valueUse the sampling distribution under the null hypothesis to turn a sample result into a test statistic and a p-value, and read the p-value as a measure of how surprising the data would be if the null hypothesis were true.
- Decide with a significance level and state the conclusion in contextCompare the p-value with a significance level chosen in advance, decide whether to reject the null hypothesis, and write a conclusion about the population in the words of the problem.
- Recognize Type I and Type II errors and their consequencesDescribe the two ways a test decision can be wrong, explain what each would mean in a real situation, and explain how the significance level and the sample size affect the chance of each.
- Turn a research question into null and alternative hypotheses
- Carry out a one-proportion z test: check that the normal model fits, compute the z statistic from the null value, find the p-value, and conclude in context.
- Check the conditions and compute the z statistic for a proportionDecide whether the normal model can be used for a sample proportion, and compute the standard error and the z statistic from the null value.
- Find the p-value and conclude a one-proportion z testUse the standard normal distribution to find the p-value for a one-sided or two-sided alternative, make the decision and state what it means for the population.
- Check the conditions and compute the z statistic for a proportion
- Carry out a one-sample t test: check its conditions, compute the t statistic and its p-value, conclude in context, and choose correctly between the tests for a mean and for a proportion.
- Know when to use the t distribution and check its conditionsExplain why a test for a mean with an unknown population standard deviation uses a t distribution, and check whether the sample makes the test trustworthy.
- Carry out a one-sample t test from start to finishCompute the standard error, t statistic, degrees of freedom and p-value for a one-sided or two-sided test of a mean, and state the decision and conclusion in context.
- Choose the right one-sample test and read software outputMatch a question to the test for a proportion or the test for a mean, recognize when neither fits, and read the results that calculators and statistics software report.
- Know when to use the t distribution and check its conditions
- Use confidence intervals alongside tests, judge whether a significant result matters in practice, and describe p-values and conclusions without the usual misreadings.
- Connect hypothesis tests with confidence intervalsUse a confidence interval to predict the decision of a test, explain when the two agree exactly, and use the interval to describe the size of a difference.
- Tell statistical significance from practical importanceExplain why a statistically significant result can be too small to matter and why a non-significant result can hide a large effect, and judge importance from the estimated difference.
- Read p-values correctly and report results clearlyState what a p-value does and does not mean, correct the common misreadings, and report a test so that a reader can judge its evidence.
- Connect hypothesis tests with confidence intervals
Hypothesis Testing study guide
1Understand how a hypothesis test weighs evidence
A hypothesis test starts with a population claim and asks whether sample variation can reasonably explain the observed departure. The research question fixes the direction of evidence before the sample arrives. A test statistic and p-value turn that question into a calculation; a significance level turns the calculation into a decision. Understanding what could go wrong helps you describe that decision without claiming certainty about the population.
1.1 Turn a research question into null and alternative hypotheses
A sample can differ from a claim even when the claim is right. A hypothesis test asks whether that difference is large enough to count as evidence about the population. Start by naming exactly what the claim describes.
Name the population and parameter
A parameter is a number describing a population or a long-run process. Use for a population mean, such as the average fill of every bottle from a production line. Use for a population proportion, such as the share of residents who use transit weekly. The sample mean and sample proportion estimate these numbers.
Hypotheses concern the unknown parameter. Writing misses the question: once the sample has been measured, its mean is already known. Define the population as well as the symbol, so a statement about one city's residents does not quietly become a statement about all residents nationwide.
Write the two hypotheses
The null hypothesis, , gives a fixed reference value. It represents no change, no effect, or agreement with a claimed value. The alternative hypothesis, , states the departure the study seeks evidence for. You may also see it written as .
| Research question | Null hypothesis | Alternative |
|---|---|---|
| Has the mean increased above 500? | ||
| Has the mean fallen below 500? | ||
| Does the mean differ from 500? |
The alternatives are right-tailed, left-tailed, and two-sided, respectively. Use the same signs for a proportion. Equality belongs in the null; the alternative excludes the null value.
Work from the question
A juice label gives a mean fill of 500 mL. A consumer group suspects underfilling. Let be the mean fill of all bottles from that line. Write mL and mL. A manager concerned about either overfilling or underfilling instead chooses mL.
For transit use, let be the proportion of all city residents who use transit weekly. To investigate an increase from 30%, write and . The null value comes from the earlier claim, not from the new survey. Enter 0.30 in formulas, not 30.
Choose before seeing the result
Fix the alternative and the significance level before examining the data. A sample above the target cannot justify changing a planned two-sided test into a right-tailed test. That change makes the evidence appear stronger by selecting the favorable tail after the result is known.
A claim such as "batteries last at least 20 hours on average" is challenged by , with at the boundary. Some textbooks write the null as . The calculation still uses 20, the boundary value. A result that fails to support underperformance leaves the company's claim unchallenged by this test; it does not establish the claimed lifetime.
Key Takeaways
- Hypotheses describe a population mean or proportion, not the observed sample statistic.
- The null value comes from the claim or benchmark; equality belongs in the null.
- The research question determines the alternative: greater, less, or different.
- Choose the hypotheses and significance level before examining the data.
1.2 Measure evidence with a test statistic and a p-value
Testing begins by temporarily treating the null hypothesis as true. That gives a model for the sample-to-sample variation we would expect. Evidence against the null comes from a result that is unusual within that model.
Put the difference on a common scale
The test statistic measures the difference from the null value in standard errors:
A statistic of 2 means the estimate is two standard errors above the null value. A statistic of −2 means it is two standard errors below. The sign describes direction; the distance from zero describes the standardized departure. The standard error measures how much the estimate varies across samples, not how much individual observations vary.
The null distribution describes the test statistic when the null is true. The statistic in a one-proportion z test approximately follows the standard normal distribution. A one-sample t test uses a t distribution with the appropriate degrees of freedom. Each model needs its conditions checked.
Read the tail area
The p-value is the probability, assuming the null and the test's conditions, of a statistic at least as extreme as the observed one in the direction of the alternative.
| Alternative | Area counted |
|---|---|
| Greater than | Right of the observed statistic |
| Less than | Left of the observed statistic |
| Not equal to | Both tails beyond its distance from zero |
For a symmetric normal or t distribution, the two-sided area is twice the smaller tail beyond the observed statistic. "At least as extreme" includes results farther from the null, not just the observed value.
A coin example
Test against . In 100 tosses, 60 are heads, giving . Under the null,
The normal area to the right of 2 is about 0.0228. Counting both tails gives a p-value of about 0.0455. Under the fair-coin normal model, a statistic at least this far from zero occurs in about 4.6% of samples of this size.
The same proportion from only 25 tosses gives and . Its two-sided p-value is about 0.317. The observed share is unchanged, but the smaller sample leaves more sampling variation, so it provides weaker evidence.
Simulate the null model
A computer can repeatedly simulate 100 tosses of a fair coin, calculate each statistic, and count the share at least as far from zero as the observed one. That share estimates the p-value. Simulating the null is essential: using a coin set to the observed 60% would answer a different question.
A p-value of 0.0455 is a probability about possible data under a fair-coin model. It is not a 4.55% probability that the coin is fair. Nor does subtracting it from 1 give the probability that the coin is unfair. The model was assumed to calculate the probability; its truth was not assigned a probability by the test.
Key Takeaways
- The test statistic counts the estimate’s distance from the null in standard errors.
- The null distribution describes the statistic when the null hypothesis is true.
- A p-value counts results at least as extreme as observed in the alternative’s direction.
- Smaller p-values give stronger evidence against the null model.
- The p-value is a probability about data under the null, not the probability of a hypothesis.
1.3 Decide with a significance level and state the conclusion in context
A p-value describes evidence on a continuous scale. A significance level turns that evidence into a decision rule. State the rule before collecting or examining the data so the cutoff is independent of the result.
Compare the p-value with the cutoff
The significance level, , is the largest p-value that leads to rejection. Common choices are 0.10, 0.05, and 0.01; 0.05 is the usual default when a level is not specified. A smaller level demands stronger evidence.
| Comparison | Decision | Description |
|---|---|---|
| p-value | Reject | Statistically significant at this level |
| p-value | Fail to reject | Not statistically significant at this level |
Use the unrounded p-value when it is close to the cutoff. A displayed value of 0.050 may conceal a value on either side. Report enough precision to make the comparison clear.
For the coin with a two-sided p-value of about 0.0455, reject at 0.05 or 0.10. At 0.01, fail to reject. The data and p-value stay the same; only the previously chosen standard for rejection changes.
Say what the decision means
A useful conclusion gives the comparison, the decision, and the population claim. For the coin: "Because 0.0455 is below 0.05, reject the fair-coin null hypothesis. There is convincing evidence that the long-run probability of heads differs from one half."
For a p-value of 0.317, write: "Because 0.317 is above 0.05, fail to reject the null hypothesis. There is not convincing evidence that the long-run probability of heads differs from one half."
Fail to reject leaves the null among the values consistent with the evidence. It does not establish it as the correct value. A small sample can miss a real departure. A legal verdict of "not guilty" offers a useful analogy: evidence fell short of the required standard, which is different from demonstrating innocence.
Conclusions concern the population parameter. Saying "the sample proportion differs from 0.5" only repeats an observed fact. The statistical question is whether the sample supports a departure in the population or long-run process.
Use a rejection region
A critical value marks the boundary of a rejection region in the test statistic's distribution. For a two-sided z test at 0.05, the boundaries are and . The coin's falls beyond the upper boundary, giving the same decision as its p-value.
For a right-tailed z test at 0.05, reject at or above 1.645; for a left-tailed test, at or below −1.645. For a two-sided z test at 0.01, the boundaries are approximately ±2.576. A t test needs critical values for its degrees of freedom.
Keep the whole test visible
A complete analysis states the parameter, hypotheses, and level; checks conditions; calculates the test statistic; finds the matching p-value; makes the decision; and gives the conclusion in context. A small p-value cannot repair a poor sample design, so the condition checks belong before the calculation.
Key Takeaways
- Reject when the p-value is at or below the level chosen in advance.
- Failing to reject means the evidence fell short, not that the null is established.
- A critical-value comparison and the corresponding p-value comparison give the same decision.
- Conclusions name the population and describe evidence for the alternative.
- Check conditions before relying on a test’s calculation.
1.4 Recognize Type I and Type II errors and their consequences
A test makes a decision from incomplete information, so it can be wrong. To identify the error, keep two questions separate: what is really true about the population, and what decision did the test make?
Match truth with decision
| Reality | Reject the null | Fail to reject the null |
|---|---|---|
| The null is true | Type I error | Correct decision |
| The null is false | Correct decision | Type II error |
A Type I error is a false alarm: rejecting a true null. A Type II error is a missed effect: failing to reject a false null. The labels refer to the whole decision, not an arithmetic error in the calculation.
For juice bottles, use mL and mL. A Type I error concludes that the line underfills when its true mean is 500 mL. The company might stop production or recalibrate a machine unnecessarily. A Type II error misses actual underfilling, leaving customers with less juice than promised.
Understand the probabilities
The level controls false alarms under the null model. For a random sample from a normal population, the one-sample t test's Type I error probability equals its level. The same holds for a mean z test under its exact model. The one-proportion z test is approximate, so its false-alarm probability is approximately . An exact binomial test has a rate at most ; whole-number counts can prevent it from attaining the level exactly.
At level 0.05, think of repeatedly testing situations where the null is true: about 5% of valid tests reject under an exact continuous model. This is not a statement that 5% of all rejections are wrong. That second probability also depends on how often the null is true among the situations tested.
The probability of a Type II error is . It depends on the particular true value under the alternative. A mean just below 500 mL is harder to distinguish from 500 than a mean far below it. Power is : the probability of detecting the departure when that particular alternative value is true.
Choose a sensible tradeoff
For a fixed sample size and true departure, lowering reduces false alarms but raises the chance of missing the departure. The rejection region becomes harder to reach. Increasing the sample size at the same level reduces and increases power, because the estimate becomes more precise.
Error costs depend on the setting. An unnecessary machine adjustment and undetected underfilling have different costs. A costly false alarm may justify a smaller level. The choice should reflect those consequences before the results arrive.
Identify what could have gone wrong
After rejecting, the decision is either correct or a Type I error. After failing to reject, it is either correct or a Type II error. The sample alone does not reveal which case occurred, because the true parameter is unknown. Do not call a non-significant result a Type II error without knowing that the null is false. Nor is the observed p-value the probability of a Type I error: the level was fixed before the sample, while the p-value came from that sample.
Key Takeaways
- A Type I error rejects a true null; a Type II error fails to reject a false null.
- The significance level controls false alarms under the null model.
- Type II error probability depends on the particular alternative value.
- Power is one minus the Type II error probability.
- At fixed sample size, a lower level trades fewer false alarms for more missed departures.
- A larger sample increases power at the same significance level.
2Test a claim about a population proportion
A proportion describes the share of a population with a particular outcome, such as weekly transit use or a white flower. A one-proportion test compares the observed share with a fixed benchmark. Its probability model comes from the benchmark, so both the condition checks and the standard error use the null proportion.
2.1 Check the conditions and compute the z statistic for a proportion
A yes-or-no variable leads to a proportion. Count a clearly defined outcome as a "success," even if the outcome is undesirable, such as a defective part. The name is only a counting convention.
Establish the normal model
For successes in observations, . To test with a one-proportion z test, check three conditions.
- Random: use a random sample or a suitable randomized experiment.
- Independent: observations must be independent. When sampling without replacement, the sample should be no more than 10% of the population.
- Large counts: both and . These are expected counts under the null, not the observed counts.
The large-counts condition makes the sampling distribution close enough to normal for the approximation. Some texts use a threshold of 5; the threshold of 10 gives a safer approximation. A huge voluntary-response poll still fails the random condition: more responses do not remove bias in who chooses to participate.
Use the null in the standard error
The test asks what would happen if , so calculate
The subscript on reminds you that this is a null-model standard error. The numerator compares the observed proportion with the claim. The denominator measures expected sampling variation under that claim. A positive z puts the observation above the null; a negative z puts it below.
Calculate with transit data
A city claims 30% of residents use transit weekly. A random sample of 400 residents from a population of 250,000 contains 138 weekly riders. The sample share is . The sample is well under 10% of the city, and the expected counts are and . Both pass.
Retain extra digits in the standard error until the final statistic. Substituting the observed 0.345 into the denominator gives about 0.0238 and a different statistic, about 1.89. That sample-based standard error belongs to the usual proportion confidence interval, not this null test. Likewise, the numerator needs the proportion 0.345, not the count 138.
When counts are small
For and , the null expects only 3 successes. Use an exact binomial probability instead of the normal approximation. If 7 successes occur and the planned alternative is , calculate for a binomial variable with 30 trials and success probability 0.10. The exact p-value is about 0.026; the z approximation gives about 0.007. The difference can change a decision at a strict level. An exact calculation addresses small counts, but still needs an appropriate sampling model.
Key Takeaways
- Compute the sample proportion as the success count divided by the sample size.
- Check random sampling, independence, and both expected counts under the null.
- The test standard error uses the null proportion, not the observed proportion.
- Use exact binomial probabilities when the expected counts are too small.
2.2 Find the p-value and conclude a one-proportion z test
Once the z statistic is available, the alternative determines which normal area to find. The same z can give very different p-values for a left-tailed, right-tailed, or two-sided question.
Select the right area
Let have the standard normal distribution. With observed statistic , use:
| Alternative | p-value |
|---|---|
A cumulative normal table often gives the area to the left. For a right-tailed test, subtract that area from 1. For a two-sided test, find the small tail beyond the absolute statistic and double it. Keep the unrounded statistic in technology, especially near the cutoff.
Finish the transit test
The transit sample gives for . The planned question asks about an increase, so . The right-tail area is about 0.025. At , reject the null: "There is convincing evidence that more than 30% of the city's residents use transit weekly."
The population statement is about all city residents, not just the 400 respondents. The observational survey supports a population comparison with the benchmark. It does not establish that a new bus line caused the increase; fuel prices or other changes might also matter. A causal conclusion needs a randomized comparison.
Work a two-sided example
A genetic model predicts 25% white-flowered offspring. A random sample of 400 offspring has 80 white flowers. Suppose independence is reasonable. Test against . The expected counts are 100 and 300, so the normal approximation is suitable.
Both tails together give a p-value of about 0.021. Reject at 0.05 but fail to reject at 0.01. There is convincing evidence at the 5% level that the population share differs from 25%. The sample points toward a lower share.
Handle insufficient evidence
A region's survey finds 21 cyclists among 250 randomly sampled workers. Against , and . For a two-sided alternative, the p-value is about 0.080, so fail to reject at 0.05. The evidence is insufficient to conclude that the region's share differs from 12%.
A left-tailed alternative chosen before the study would give about 0.040. Switching after seeing the lower sample share would select a more favorable analysis and inflate false alarms. Conversely, for a preselected right-tailed alternative, a negative statistic gives a p-value greater than 0.5. A large departure in the wrong direction supplies no evidence for the specified increase.
Key Takeaways
- Use the alternative to select the normal tail or tails.
- Compare the resulting p-value with the level before stating the population conclusion.
- A significant observational result does not establish a cause.
- A large statistic in the direction opposite to a one-sided alternative gives a large p-value.
- Keep the planned alternative even when the sample points another way.
3Test a claim about a population mean
Testing a mean connects measurements from a sample to a claim about a population average. Estimating the population spread from the sample calls for the t distribution, whose shape depends on degrees of freedom. Data collection and the shape of the observations determine whether its probabilities are trustworthy. A complete analysis combines those checks with a worked calculation, a matching tail area, and a careful reading of software output.
3.1 Know when to use the t distribution and check its conditions
Measurements such as time, mass, and scores lead to a test about a mean. Usually the population standard deviation is unknown. Estimating it from the sample adds uncertainty, which the t distribution accounts for.
Build the t statistic
Use the sample standard deviation to estimate the standard error of the mean:
When the null is true and the observations are a random sample from a normal population, this statistic has a t distribution with degrees of freedom. The degrees of freedom identify which t curve to use. Using instead of selects the wrong curve.
Like the standard normal distribution, a t distribution is symmetric and centered at zero. Its heavier tails allow for sample-to-sample variation in . As the degrees of freedom increase, the t curve approaches the normal curve. Two-sided 5% critical values illustrate this: 2.776 at 4 df, 2.131 at 15 df, 2.045 at 29 df, and 1.984 at 99 df, compared with 1.960 for z.
Check collection and shape
The sample must be random and its observations independent. When sampling without replacement, it should be no more than 10% of the population. Then check whether the population is approximately normal or the sample is large enough for the sample mean to have an approximately normal sampling distribution.
A useful guide for the shape check is:
- Fewer than 15 observations: data should look close to normal, without outliers.
- About 15 to 40: avoid strong skewness and outliers.
- About 40 or more: the method works for clearly skewed data, but strong outliers still need attention.
The common rule is a shortcut, not a reason to ignore a graph. The central limit theorem describes the sampling distribution of the mean. It does not turn the individual observations into normally distributed data.
Inspect unusual values
A dotplot, histogram, boxplot, or normal probability plot helps reveal skewness and outliers. Sixteen coffee fills between 236 and 256 mL, with no unusual values, support a t analysis. A cup at 210 mL would be a reason to investigate. It might be a measuring mistake or a real feature of the process. Deleting it simply because it disrupts the test would distort the evidence. Both the mean and standard deviation are sensitive to extreme values.
Recognize the known-standard-deviation case
If the population standard deviation really is known, use
and the standard normal distribution, under the same suitable sampling and shape conditions. For , , and against , the standard error is 2.5 and z is 1.80. The two-sided p-value is about 0.072. Knowing a sample standard deviation is not the same as knowing ; a large sample alone does not change an unknown-standard-deviation mean test into a z test.
Key Takeaways
- Use the sample standard deviation in the standard error when the population standard deviation is unknown.
- The one-sample t statistic uses n − 1 degrees of freedom.
- The t distribution has heavier tails to account for estimating the population spread.
- Check sampling, independence, skewness, and outliers.
- The central limit theorem concerns sample means, not the shape of individual data.
- Use a mean z test only when the population standard deviation is known.
3.2 Carry out a one-sample t test from start to finish
A full t test connects a population question to the calculation and back to a conclusion. Keep the units attached to the mean and standard error; the t statistic itself has no units.
Set up the coffee test
A coffee machine targets 250 mL per cup. A random sample of 16 cups has mean 246.2 mL and standard deviation 6.4 mL. Overfilling and underfilling both matter, so let be the mean fill of all cups from this machine and state against . Choose .
The sample is random and is a small fraction of all cups from the machine. A dotplot shows no strong skewness or outliers. With these conditions checked, the t model is appropriate.
Calculate in order
First estimate the sampling variation of the mean:
Then standardize the observed difference:
There are degrees of freedom. For the two-sided alternative, count both tails beyond a distance of 2.375 from zero. Technology gives for the t distribution with 15 df.
Since 0.031 is below 0.05, reject the null. "There is convincing evidence that the machine's population mean fill differs from 250 mL; the sample suggests underfilling." At a preselected level of 0.01, the same result would fall short of rejection.
Check with a table
For 15 df, a two-sided 5% critical value is 2.131. The observed absolute statistic, 2.375, is larger, so it lies in the rejection region. A printed t table may only bound a p-value: 2.375 lies between 2.131, associated with two-sided area 0.05, and 2.602, associated with 0.02. Thus the p-value lies between 0.02 and 0.05. Software provides a more precise numerical value.
Work a one-sided question
Researchers predict that students at a college average less than 7 hours of sleep. A random sample of 25 students has mean 6.6 hours and standard deviation 1.1 hours, without strong skewness or outliers. With independence checked, test against at 0.05.
Use 24 df and the lower tail. The p-value is about 0.041, so reject: the evidence supports a population mean below 7 hours. A two-sided test of these data gives about 0.082. The difference comes from which departures the question counts, not from a new sample.
Enter the analysis carefully
A calculator can use raw data or the four summary values: null mean, sample mean, sample standard deviation, and sample size. Select the intended alternative. Dividing the sample difference by alone ignores sample size; dividing by in place of shrinks the standard error too much. Record the condition checks and the contextual conclusion alongside the output, because neither follows automatically from the calculator's result.
Key Takeaways
- State the parameter, hypotheses, level, and conditions before calculating.
- Compute the standard error, then t, then n − 1 degrees of freedom.
- Find a t tail area that matches the preplanned alternative.
- A printed t table may give p-value bounds; technology gives a numerical value.
- Explain the decision as evidence about the population mean.
3.3 Choose the right one-sample test and read software output
Start with what each observation measures and whether the comparison is with a fixed benchmark or another sample.
Choose by the quantity being tested
| Question | Parameter | Suitable one-sample method |
|---|---|---|
| What share of voters supports a park? | Population proportion | Proportion z test if expected counts pass |
| What is the average commute time? | Population mean | t test when population spread is unknown |
| What share of commutes exceeds 25 minutes? | Population proportion | Proportion z test if expected counts pass |
| What is the mean score with known population spread? | Population mean | Mean z test with a suitable normal model |
A commute measured in minutes is quantitative. Classifying that same commute as longer than 25 minutes or not creates a binary variable. The parameter changes from a mean to a proportion because the question changes.
The methods compare one sample with a fixed claim or standard. Comparing two groups measured in the same study needs a method that accounts for uncertainty in both estimates. Treating the second sample's mean as a fixed benchmark understates that uncertainty.
Check the method's conditions
Small null expected counts call for an exact binomial proportion test. A small quantitative sample with strong skewness or outliers does not support an ordinary t analysis. Software will often compute a result anyway.
Read each output field
The coffee analysis can be reported as:
One Sample t-test
t = -2.375, df = 15, p-value = 0.03132
alternative: true mean is not equal to 250
95% confidence interval: 242.7897 to 249.6103
sample mean: 246.2
The sample mean estimates the population mean; the confidence interval describes its uncertainty. The t value measures the standardized departure, and df selects the reference distribution. The p-value is two-sided because the printed alternative says "not equal." Never assume that the software used the alternative you intended: many programs default to two-sided.
Convert a two-sided p-value carefully
For a symmetric t or z distribution, halve a two-sided p-value only when the estimate points in the planned alternative's direction. For the coffee result, a preplanned alternative gives about . A preplanned alternative gives about . The sample is below the target, so evidence for an increase is weak.
For proportions, some software applies a continuity correction by default and may report a chi-square statistic. Without correction that statistic equals . Matching the hand z calculation requires disabling the correction. Finally, read scientific notation correctly: 3.2e-05 means 0.000032. Report such a small value as "p < 0.001." A display rounded to zero is not a literal probability of zero for these finite t or z statistics.
Key Takeaways
- Choose the method from the parameter: a mean or a proportion.
- Comparing two estimated group results requires a method for two groups.
- Check the alternative printed in software output.
- Halve a two-sided p-value only when the estimate points in the planned direction.
- Software corrections and rounding can change the displayed result.
- Report very small p-values with an inequality instead of a rounded zero.
4Interpret and report test results responsibly
A test decision is one part of a statistical report. Confidence intervals describe which parameter values remain plausible, and estimated differences show the size of a departure in useful units. These help distinguish strong evidence from practical importance. Careful wording and transparent reporting also reveal what a p-value means, how much uncertainty remains, and whether choices made after seeing the data have made the result look stronger.
4.1 Connect hypothesis tests with confidence intervals
A test checks a particular parameter value. A confidence interval shows a range of plausible values and how precisely the sample estimates the parameter. Reading both helps explain what a decision leaves uncertain.
Match a mean test with its interval
For the same data and t procedure, a two-sided test at level corresponds to a two-sided confidence interval at confidence level . A null value outside the interval is rejected; a value strictly inside is not rejected. Thus a 5% two-sided test matches a 95% t interval, and a 1% test matches a 99% interval. At an exact endpoint, use the test's stated equality rule for the decision.
For the coffee data, the 95% interval is
or about 242.79 to 249.61 mL. The target 250 mL lies outside, matching the p-value of about 0.031 and rejection at 0.05. The interval also shows the size of the departure: plausible means are about 0.4 to 7.2 mL below target.
At 99% confidence, the multiplier is 2.947. The interval is about 241.49 to 250.91 mL and includes 250, matching failure to reject at 0.01. Including 250 does not select it as the true mean; the interval includes many other plausible values too.
Match the direction of a one-sided test
A one-sided t test at level uses the appropriate endpoint of the two-sided interval with confidence level . At 0.05, use the relevant endpoint of a 90% interval.
- For , reject when the upper endpoint is below the null value.
- For , reject when the lower endpoint is above the null value.
For the sleep data, the 90% interval is , about 6.22 to 6.98 hours. Its upper endpoint is below 7, agreeing with the lower-tailed test. If the entire interval were above 7, that would support an increase, not the specified decrease. Simply finding the null outside an interval is insufficient for a one-sided question; direction matters.
Understand the proportion mismatch
The one-proportion z test uses in its standard error. The usual sample-centered proportion interval, often called a Wald interval, uses . They can disagree near a cutoff because they use different uncertainty calculations.
For the transit data, the two-sided test gives a p-value about 0.0495, just below 0.05. The usual 95% interval is about 0.298 to 0.392 and includes 0.30. The cycling example reverses the mismatch: its test p-value is about 0.080, but its usual interval, about 0.050 to 0.118, excludes 0.12.
Report both results and describe the borderline evidence clearly. Follow the stated test's own p-value for its decision. A Wilson interval is formed by inverting the proportion z test, so it agrees with that test at matching levels and with consistent endpoint rules.
Key Takeaways
- A two-sided mean t test at level α matches the t interval at confidence level 1 − α.
- An interval adds the plausible size and direction of a difference.
- A one-sided t test uses the matching directional endpoint of the 1 − 2α interval.
- The usual proportion interval and null-based z test may disagree near a cutoff.
4.2 Tell statistical significance from practical importance
A small p-value tells you that the data are hard to reconcile with the null model. It does not tell you whether the difference is large enough to matter. Practical importance needs the estimated difference, its uncertainty, and knowledge of the situation.
Compare two kinds of significance
| Question | What answers it? |
|---|---|
| Is there evidence against the null value? | A suitable test and its p-value |
| How large might the population difference be? | An estimate and confidence interval |
| Is that difference useful or costly? | A meaningful threshold in context |
For a mean, express the difference as in the original units. For a proportion, use ; a change from 30% to 34.5% is 4.5 percentage points. The p-value has no measurement units and cannot supply that size information.
A tiny difference with strong evidence
A test-prep company asks whether its students score above a national benchmark of 500. A random sample of 10,000 course students has mean 502 and standard deviation 100. With suitable conditions, and . The one-sided p-value is about 0.023, significant at 0.05.
The mean difference is only 2 points. A 95% interval of about 500.04 to 503.96 places the difference at about 0.04 to 3.96 points above the benchmark. On a scale with variation around 100 points, that is too small to matter for most purposes. The large sample makes the estimate precise enough to detect a small departure.
A large estimate with weak evidence
A random sample of only 9 course students has mean 530 and standard deviation 60. With a suitable near-normal population and no outliers, , , and df is 8. The one-sided p-value is about 0.086, falling short at 0.05.
The estimated difference is 30 points, but the 95% interval, about 483.9 to 576.1, permits differences from about −16.1 to 76.1 points. These data leave room for no difference and for a large positive difference. More information would help distinguish them. A non-significant result is not evidence that the difference must be small.
Keep the comparison and the cause separate
Neither sample establishes that the course raised scores. Course students might already differ in motivation or prior scores. Random sampling supports estimation of the course students' mean. A randomized comparison of students with and without the course is needed to estimate the course's effect.
A meaningful difference should be judged using a threshold relevant to costs, benefits, or performance. That threshold comes from the setting, not from whether a p-value crosses 0.05. Report "statistically significant" when discussing evidence, then give the difference in points, minutes, milliliters, or percentage points so readers can judge its value.
Key Takeaways
- Statistical significance measures evidence against a null value; practical importance concerns the size that matters.
- A large sample can detect a difference too small to be useful.
- A small sample can leave an important difference uncertain.
- Report differences and intervals in the original units.
- A comparison with a benchmark does not isolate the effect of an intervention.
4.3 Read p-values correctly and report results clearly
A clear report lets readers see what was tested, whether the model fits, and how uncertain the estimate remains. A p-value on its own leaves out much of that information.
Keep the assumption in the interpretation
For the sleep test, a p-value around 0.041 means: "If the population mean were 7 hours and the test's conditions held, about 4.1% of random samples of 25 students would give a t statistic of −1.82 or lower."
The probability concerns data under an assumed model. "There is a 4.1% chance the mean is 7 hours" reverses that logic. Likewise, "there is a 4.1% chance the result is due to chance" assigns a probability to an explanation that the calculation assumed. Subtracting the p-value from 1 does not give the probability that the alternative is true.
Separate evidence from effect size
A large p-value means the data are compatible with the null model, but other parameter values may also fit. A small sample can leave a wide range of plausible values. A tiny p-value can accompany a tiny difference in a large sample. Give the estimated difference and its interval to communicate size and precision.
The threshold 0.05 is a convention, not a boundary between true and false. Results with p-values 0.049 and 0.051 provide very similar evidence even though a 5% decision rule gives different decisions. Report the actual p-value, along with the preselected level, so readers can see proximity to the cutoff.
Report the analysis as well as the result
A useful report includes:
- the population parameter, null and alternative, and significance level;
- the sampling design and relevant condition checks;
- the test name, statistic, and degrees of freedom where applicable;
- the p-value, estimate, and confidence interval;
- a conclusion in context and the size of the difference in its units.
For the coffee analysis: "A random sample of 16 cups had no strong skewness or outliers, and independence was reasonable. A two-sided one-sample t test of a 250 mL mean at level 0.05 gave t = −2.375, 15 df, and p = 0.031. The estimated mean was 246.2 mL, with a 95% interval of 242.8 to 249.6 mL. There is convincing evidence that the machine's mean fill differs from its target; the estimate is 3.8 mL below it."
Make selection visible
Choosing outcomes, subgroups, or alternatives after seeing the data makes small p-values easier to find. Running many tests and reporting only the significant ones hides the search that produced the result. Say which analyses were planned, what else was tested, and which choices followed inspection of the data.
The American Statistical Association's 2016 principles connect these points: p-values describe incompatibility with a specified model; they are not probabilities of hypotheses or of "chance alone"; a threshold should not carry the whole decision; sound inference requires transparent reporting; p-values do not measure effect size or importance; and a p-value alone is an incomplete account of evidence. Interpret it alongside the design, the model, the estimate, and the uncertainty.
Key Takeaways
- Interpret the p-value as a probability about extreme data under the null and the test’s conditions.
- Report the estimate, interval, test details, and conclusion alongside the p-value.
- Values just above and below 0.05 provide similar evidence.
- Disclose planned analyses and choices made after examining the data.
Hypothesis Testing examples
1From a claim to a decision
17 steps
- 1IntroductionAsk about a population
A battery supplier claims a mean lifetime of 12 hours. A sample will rarely average exactly 12, even if the claim is right. The question is whether its departure is large compared with ordinary sampling variation.
A hypothesis test builds that comparison under the claimed population mean. You will choose a question, measure evidence, and decide what the sample supports. A p-value and significance level guide that decision, which can still be a Type I or Type II error.
- 2ExplanationName the quantity being tested
Let be the mean lifetime of all batteries from the supplier’s production process. The null claim is hours.
The symbol describes the population. A sample mean is an observed estimate used as evidence about that population; it does not belong in the hypothesis. The value 12 comes from the supplier’s claim, not from the new measurements.
- 3ExampleChoose the departure that matters
A buyer wants to detect batteries that last less than claimed, so the planned alternative is . This is a left-tailed test.
If the question were whether the claim is inaccurate in either direction, use instead. Choose this direction before looking at the sample. Selecting whichever one-sided question favors the observed result would overstate the evidence.
- 4ChallengeWrite an alternative
A manufacturer instead asks whether its population mean battery lifetime exceeds 15 hours. Name the parameter and write the alternative.
---reveal---
Let be the mean lifetime of all batteries from that process. The alternative is , a right-tailed claim. The null uses equality to 15; an observed sample mean is evidence, not the unknown quantity named by the hypothesis.
- 5ExplanationStandardize the departure
Suppose a suitable battery sample has mean 11.4 hours and estimated standard error 0.3 hour. Its standardized departure is
The estimate lies two standard errors below the claim. Its sign matches the planned decrease. The reference distribution tells us how unusual a statistic this low would be if the population mean really were 12.
- 6ExplanationCount extreme results under the null
The p-value counts a statistic at least as extreme as observed, assuming the null and the test’s conditions. For the battery decrease, it is the area to the left of the observed statistic.
A two-sided question would count both tails beyond the observed distance from zero. The tail comes from the planned alternative, not from a rule that always chooses whichever area is smaller.
- 7Key InsightKeep the probability pointed the right way
If a p-value is 0.03, the null model assigns 3% probability to results at least as extreme as observed in the chosen direction. The calculation began by assuming the null.
It does not assign a 3% probability to the null itself, and 97% is not the probability that the alternative is true. These are different probability questions from the one the test calculated.
- 8ChallengeEstimate evidence by simulation
In a null simulation, 42 of 2000 statistics fall at least as far into the planned left tail as the observed statistic. What p-value does the simulation estimate?
---reveal---
The estimated p-value is . It is the share of extreme results under the null model. Do not double it: the count already matches the planned left-tailed question, which detects a decrease only.
- 9ExplanationApply a level chosen in advance
The significance level is the preselected cutoff for rejection. At level 0.05, reject when the p-value is at or below 0.05; otherwise fail to reject.
A stricter level such as 0.01 requires stronger evidence. The p-value itself does not change when the level changes. The level controls the decision rule, while the sample and reference model determine the p-value.
- 10ExampleState the population conclusion
For a planned battery underperformance test with a p-value of 0.03 at level 0.05, reject the null. Write: "There is convincing evidence that the supplier’s population mean battery lifetime is below 12 hours."
If the p-value were 0.20, the evidence would fall short. "Fail to reject" would leave 12 plausible; it would not establish that the supplier’s mean is exactly 12.
- 11ChallengeCompare evidence with the planned cutoff
A planned test of a population mean gives a p-value of 0.024 at level 0.01. State the decision and explain what it says about the null.
---reveal---
Fail to reject because . The sample does not provide enough evidence against the null at that level. The null remains compatible with this analysis, but other parameter values may also be compatible. A 0.05 cutoff would be a different decision rule.
- 12ExplanationRecognize a false alarm
A Type I error rejects a null that is true. If the battery process really averages 12 hours but the test concludes that it underperforms, the buyer receives a false alarm.
The significance level controls this risk under the null model. For an exact t model it equals the level; for the proportion z approximation it is approximately the level. It is not the probability that this particular rejection is wrong.
- 13ExplanationRecognize a missed departure
A Type II error fails to reject a null that is false. If batteries truly average less than 12 hours but the test misses the underperformance, a real shortfall goes undetected.
Its probability, beta, depends on the true mean: a tiny shortfall is harder to detect than a large one. Power is one minus beta, the probability of detecting a particular true departure with this test.
- 14ConnectionImprove detection without changing the level
For a fixed true shortfall, a larger random sample reduces sampling variation and improves power at the same significance level.
Lowering the level while keeping the sample size fixed has a different effect: it reduces false alarms but makes a real shortfall harder to detect. Error costs help choose the level; sample size affects how much information the test has for that choice.
- 15ChallengeIdentify the possible error
A shipment test fails to reject the lifetime claim. What kind of error is possible, and what additional fact would make it an actual error?
---reveal---
A Type II error is possible. It is an actual error only if the null claim is false. The non-rejection alone cannot establish this, because the true population mean is unknown. A Type I error requires rejection, which did not occur here.
- 16ChallengeConnect a stricter rule with its cost
A buyer uses the same sample size but lowers the level from 0.05 to 0.01. For a fixed true shortfall, explain the decision tradeoff.
---reveal---
Stronger evidence is required to reject. False alarms become less likely when the claim is true, but missing that real shortfall becomes more likely. A non-rejection at the stricter level therefore gives no guarantee that the batteries meet the claimed mean lifetime.
- 17RecapKeep evidence, decision, and truth distinct
Begin with a parameter and a direction chosen before the data. Measure the observed departure in standard errors, find its tail probability under the null, and compare that p-value with the planned level.
A decision describes what the evidence supports about the population. Rejection can be a false alarm; non-rejection can miss a real departure. The sample does not reveal the true parameter with certainty.
2Test a share from counts to conclusion
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionTurn a count into evidence about a share
- 2ExampleWrite the model before calculating
- 3ExplanationCheck random selection and independence
- 4ExampleCheck counts under the claim
- 5ExampleCalculate the null standard error
- 6ChallengeChoose a model when counts fail
- 7ExplanationRead the right tail
- 8ExampleMake the population statement
- 9ConnectionChange the question before a future study
- 10ChallengeUse the direction in the question
- 11ChallengeAssemble the full analysis
- 12RecapUse the null for variation and the alternative for direction
3Test a measured average with t
16 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionAllow for an estimated population spread
- 2ExplanationWhy the reference curve has heavier tails
- 3ExampleCheck the data before the formula
- 4ChallengeDecide whether t is justified
- 5ExampleFix the hypotheses and level
- 6ExampleEstimate variation in the mean
- 7ExampleFind the standardized difference
- 8ExplanationFind both t tails
- 9ConnectionUse a critical value to check
- 10ChallengeRecalculate after a new sample
- 11ExplanationChoose a test from the recorded outcome
- 12TipRead what the software actually tested
- 13ChallengeDo not halve the wrong tail
- 14Key InsightRecognize when one sample is not enough
- 15ChallengeConnect the data, curve, and decision
- 16RecapKeep the calculation tied to its model
4Explain the size and uncertainty of a result
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionRead beyond a rejection decision
- 2ExplanationMatch a two-sided t test and interval
- 3ExplanationCheck direction in a one-sided match
- 4ChallengeUse an interval without declaring equality
- 5ConnectionKnow why proportions can disagree
- 6ExplanationDefine a difference that matters
- 7ExampleUse precision to judge practical importance
- 8ChallengeSeparate sample size from effect size
- 9ExplanationKeep the null assumption visible
- 10TipShow the choices behind the number
- 11ChallengeCorrect a report’s probability claim
- 12Key InsightPut threshold decisions in perspective
- 13ChallengeImprove the whole conclusion
- 14RecapReport evidence, magnitude, and uncertainty together
Hypothesis Testing practice questions
Set 1: Choose models and interpret evidence10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Build and apply a test10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Work through decisions and uncertainty10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Evaluate a complete analysis10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Alternative hypothesis
Analysis report
B
Beta
C
Causal effect
Central limit theorem
Confidence bound
Confidence interval
Contextual conclusion
Continuity correction
Critical value
D
Degrees of freedom
E
Estimated difference
Exact binomial test
Expected count
F
False alarm rate
L
Large-counts condition
Left-tailed test
M
Mean z test
N
Null distribution
Null hypothesis
Null mean
Null simulation
Null value
O
One-proportion z test
One-sample t test
Outlier
P
P-value
Percentage point
Planned analysis
Point estimate
Population parameter
Power
Practical importance
R
Rejection region
Right-tailed test
S
Sample proportion
Scientific notation
Selective reporting
Significance level
Standard error
Statistical significance
T
T distribution
T statistic
T table
Test statistic
Transparency
Two-sided alternative
Two-sided p-value
Type I error
Type II error
W
Wald interval
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.