Tutorials › VEE Mathematical Statistics › A Complete Hypothesis Testing Workflow

VEE Mathematical Statistics · Hypothesis Testing Principles · Tutorial 607 of 880

A Complete Hypothesis Testing Workflow

Learn to set up, calculate, and interpret a hypothesis test in a consistent sequence.

Intermediate 11 min read

What You'll Learn

  • Translate a research question into a null hypothesis and an appropriate alternative.
  • Choose a one-sided or two-sided test before examining the observed statistic.
  • Match a test statistic and its null distribution to the sampling model and known information.
  • Calculate a p-value or compare the statistic with a critical value.
  • State the decision and its contextual meaning without treating nonrejection as proof.
  • Diagnose errors involving tail direction, standard errors, and test assumptions.

A Consistent Workflow for Hypothesis Tests

A hypothesis test is a rule for using sample data to assess a claim about a population parameter. A reliable solution makes the logical sequence visible: define the parameter, state the hypotheses, choose the tail, identify the model and test statistic, find its distribution under the null, and then make and interpret a decision. Getting the calculation right does not repair a test aimed at the wrong claim or built on an unsuitable model.

This workflow is aligned with the SOA VEE Mathematical Statistics syllabus. It uses familiar sampling distributions, including normal and Student’s \(t\) distributions, and a large-sample normal approximation for a proportion. In each case, the model assumptions must be checked before relying on the stated null distribution.

Definition: A hypothesis test evaluates a null hypothesis, denoted \(H_0\), against an alternative hypothesis, denoted \(H_A\), using sample data and a specified decision rule. The null specifies parameter value or values treated as the reference model; the alternative states the direction or range of values the test is designed to detect.

A complete test has six main steps. The choice between a one-sided and two-sided alternative comes from the research question, not from which direction the sample happens to point. The significance level \(\alpha\) is also set before using the data to make the decision; it is the probability of rejection when the null model is true, subject to the model and test rule.

1
Define the parameter and claim.
Write what population quantity is being tested and its units. State a null hypothesis that includes equality.
2
Choose the alternative and significance level.
Use \(H_A:\theta\ne\theta_0\) for a difference in either direction, \(H_A:\theta>\theta_0\) for an increase, or \(H_A:\theta<\theta_0\) for a decrease. Specify \(\alpha\).
3
Check assumptions and select a statistic.
State the sampling model and any conditions needed for the statistic’s null distribution to apply.
4
Calculate the observed statistic and p-value or critical-value comparison.
Use the null distribution and the tail or tails specified by \(H_A\).
5
Make the formal decision.
Reject \(H_0\) when the p-value is at most \(\alpha\); otherwise, fail to reject \(H_0\). The equivalent critical-value rule uses the rejection region determined by \(\alpha\).
6
Give a contextual conclusion.
Describe what the decision says about evidence for the alternative, without claiming more than the test establishes.

Why the Test Statistic Has a Null Distribution

The test statistic is chosen so that its behavior is known, or well approximated, when the null hypothesis is true. That reference distribution makes it possible to judge whether the observed data are unusual under \(H_0\). For example, suppose \(X_1,\ldots,X_n\) are independent observations from a normal population with mean \(\mu\) and known standard deviation \(\sigma\). Under \(H_0:\mu=\mu_0\), the sample mean has mean \(\mu_0\) and standard deviation \(\sigma/\sqrt{n}\). Standardizing gives a standard normal statistic:

$$ Z=\frac{\bar X-\mu_0}{\sigma/\sqrt{n}}\sim N(0,1)\quad\text{under }H_0. $$

The justification follows from the normal sampling distribution: \(\bar X\sim N(\mu,\sigma^2/n)\). Under the null, substitute \(\mu=\mu_0\); subtracting \(\mu_0\) centers the distribution at zero, and dividing by its standard deviation \(\sigma/\sqrt n\) gives variance one. The formula therefore depends on independent normal observations and known \(\sigma\). If \(\sigma\) is unknown, using the sample standard deviation instead changes the reference distribution: for independent normal observations, the corresponding statistic follows a Student’s \(t\) distribution with \(n-1\) degrees of freedom.

Definition: The p-value is the probability, calculated under the null model, of obtaining a test statistic at least as contrary to \(H_0\) as the observed statistic, in the direction or directions specified by \(H_A\). A small p-value indicates that the observed result would be unusual under that null model; it is not the probability that \(H_0\) is true.

Worked Tests From Setup to Conclusion

Worked Example: A Two-Sided Test of a Mean With Known Standard Deviation

A hypothetical calibration lab records readings from \(n=36\) independent devices. Assume readings are normally distributed with unknown population mean \(\mu\) and known population standard deviation \(\sigma=6\) units. The sample mean is \(\bar x=52.4\). At significance level \(\alpha=0.05\), test whether the population mean differs from 50 units.

Method and hypotheses. The parameter is the population mean reading \(\mu\), in units. “Differs” calls for a two-sided alternative: \(H_0:\mu=50\) versus \(H_A:\mu\ne 50\), with \(\alpha=0.05\).

Assumptions and statistic. The observations are independent and normally distributed, and \(\sigma=6\) is known. Thus the null standard error is \(6/\sqrt{36}=6/6=1\), and the \(Z\) statistic has a standard normal distribution under \(H_0\).

Calculation. The observed statistic is \(z=(52.4-50)/1=2.4\). For a two-sided test, both tails count: \(p=2P(Z\ge 2.4)\). The standard normal upper-tail probability is approximately \(0.0082\), so \(p\approx 2(0.0082)=0.0164\), to four decimal places.

Decision and conclusion. Since \(0.0164<0.05\), reject \(H_0\). The data provide evidence that the mean reading differs from 50 units. The test does not establish the size or practical importance of that difference.

Common mistake avoided. Using only the upper tail would give about \(0.0082\), not the two-sided p-value. The alternative includes departures both above and below 50, so both tails must be counted.

Worked Example: A One-Sided Test With an Estimated Standard Deviation

A hypothetical service center measures completion times for a random sample of \(n=16\) independent jobs. Assume times are normally distributed with unknown population mean \(\mu\) and unknown standard deviation. The sample mean is \(\bar x=18.6\) hours and the sample standard deviation is \(s=2.4\) hours. At \(\alpha=0.05\), test whether the mean completion time exceeds 17.5 hours.

Method and hypotheses. The parameter is the population mean completion time. The claimed direction is an increase, so use \(H_0:\mu=17.5\) versus \(H_A:\mu>17.5\). Equality belongs in the null; the one-sided alternative reflects the question and is fixed before looking at the sample direction.

Assumptions and statistic. Assume the sample is random, its observations are independent, and the population distribution is normal. Since the population standard deviation is unknown, use the one-sample \(t\) statistic with \(n-1=15\) degrees of freedom under \(H_0\): \(t=(\bar x-\mu_0)/(s/\sqrt n)\).

Calculation. The estimated standard error is \(2.4/\sqrt{16}=2.4/4=0.6\) hours. The observed statistic is \(t=(18.6-17.5)/0.6=1.1/0.6=1.8333\). The upper-tail critical value for a \(t\) distribution with 15 degrees of freedom at \(\alpha=0.05\) is approximately \(1.753\). Since \(1.8333>1.753\), the statistic lies in the rejection region.

Decision and conclusion. Reject \(H_0\) at the 5% significance level. Under the stated assumptions, the sample provides evidence that the population mean completion time exceeds 17.5 hours.

Common mistake avoided. This is an upper-tail test because the question asks whether the mean exceeds 17.5. A two-sided critical value would use a different rejection region and would not answer the stated question. Also, the \(t\) distribution is appropriate here because \(\sigma\) is estimated, not known.

Worked Example: A Large-Sample Test of a Proportion

A hypothetical quality audit examines \(n=100\) independently selected components and finds \(x=50\) with a specified surface mark. Test at \(\alpha=0.05\) whether the population proportion \(p\) with the mark exceeds \(0.40\). Use the large-sample normal score test.

Method and hypotheses. The parameter is the population proportion \(p\). The requested direction gives \(H_0:p=0.40\) versus \(H_A:p>0.40\). The observed sample proportion is \(\hat p=x/n=50/100=0.50\).

Assumptions and statistic. Treat the observations as independent Bernoulli outcomes with a common probability \(p\). Under the null, \(X\sim\operatorname{Binomial}(100,0.40)\). The normal score approximation uses the null standard error \(\sqrt{p_0(1-p_0)/n}\), not an estimated standard error based on \(\hat p\). Here \(np_0=40\) and \(n(1-p_0)=60\), so the expected counts under the null are sufficiently large for the usual normal approximation.

Calculation. The null standard error is \(\sqrt{0.40(0.60)/100}=\sqrt{0.0024}\approx0.04899\). Therefore \(z=(0.50-0.40)/0.04899\approx2.0412\). For the upper-tail alternative, the approximate p-value is \(P(Z\ge2.0412)\approx0.0206\), to four decimal places.

Decision and conclusion. Since \(0.0206<0.05\), reject \(H_0\). The audit provides evidence that the population proportion with the mark is greater than 0.40. This is a conclusion from an approximate test, so its accuracy depends on the sampling and approximation conditions.

Common mistake avoided. Substituting \(\hat p=0.50\) into the standard error would give \(\sqrt{0.50(0.50)/100}=0.05\), and a different statistic. For this null-based score test, the standard error is calculated using \(p_0=0.40\), because the reference distribution is specified under \(H_0\).

Decisions, Conclusions, and Common Traps

The p-value and critical-value approaches are two ways to apply the same test rule. With the p-value approach, reject when \(p\le\alpha\). With the critical-value approach, reject when the observed statistic falls in the rejection region whose probability under the null is \(\alpha\) (or at most \(\alpha\), where a discrete distribution prevents an exact match). Do not mix a one-sided p-value with a two-sided critical value.

A decision is not a statement of certainty. Rejecting \(H_0\) does not prove that the alternative is true, and failing to reject \(H_0\) does not establish that the null is true. Nonrejection means the data did not provide sufficiently strong evidence against \(H_0\) under the chosen test and significance level. The distinction is important when sample sizes are small or the test has limited power.

  • Letting the observed sign choose the tail. A sample mean above the null value does not justify changing a preplanned lower-tail test into an upper-tail test.
  • Using a statistic without its conditions. A normal or \(t\) reference distribution is not automatic; independence, distributional assumptions, and whether the population standard deviation is known all matter.
  • Misreading the p-value. It is a probability of outcomes under the null model, not a probability that the null hypothesis is correct.
  • Reporting only “reject” or “do not reject.” Name the population parameter and direction in the conclusion, and keep the claim within what the test addresses.
Key takeaway: A defensible test links the research question to the alternative, the alternative to the tail, and the assumed sampling model to the null distribution. Only then does the p-value or critical-value comparison have its intended meaning.

Check Your Understanding

For each problem, identify the hypotheses and test direction, then check the statistic, decision, and contextual conclusion.

  1. A random sample of 25 independent normal measurements has mean \(42.2\). The population standard deviation is known to be \(5\). Test \(H_0:\mu=40\) against a two-sided alternative at \(\alpha=0.05\). (Answer: \(z=2.20\), two-sided \(p\approx0.0278\); reject \(H_0\), evidence that \(\mu\) differs from 40.)
  2. A random sample of 9 independent normal observations has mean \(7.4\) and sample standard deviation \(1.5\). Test \(H_0:\mu=8\) against \(H_A:\mu<8\) at \(\alpha=0.05\). (Answer: \(t=-1.20\), \(df=8\); lower-tail critical value \(-1.860\); fail to reject \(H_0\), insufficient evidence that \(\mu<8\).)
  3. In 200 independent trials, 72 successes are observed. Test \(H_0:p=0.30\) against \(H_A:p\ne0.30\) at \(\alpha=0.05\), using the normal score approximation. (Answer: \(\hat p=0.36\), null standard error \(\sqrt{0.30(0.70)/200}\approx0.03240\), \(z\approx1.852\), two-sided \(p\approx0.0641\); fail to reject \(H_0\).)
  4. A random sample of 16 independent normal observations has mean \(53.0\). The known population standard deviation is \(4\). Test \(H_0:\mu=50\) against \(H_A:\mu>50\) at \(\alpha=0.01\). (Answer: \(z=3.00\), upper-tail \(p\approx0.00135\); reject \(H_0\), evidence that \(\mu>50\).)
Clinical Biostats