Hypothesis Testing Basics
Hypothesis Testing
Hypothesis testing uses sample data to test claims about population parameters. The process determines whether an assumed population value (mean, proportion, variance, etc.) is still valid or has shifted. This is similar to confidence intervals, where sample data estimates a range of plausible values, but hypothesis testing directly evaluates a specific claimed value.
The Five-Step Process
Hypothesis testing follows a structured procedure with five main steps:
Identify the hypotheses – the null and alternative statements
Compute the test statistic – a value from sample data that measures how far the sample result is from the assumed population value
Determine critical values or the p-value – these provide a decision rule
Make a decision – reject or fail to reject the null hypothesis
Summarize the conclusion – state the result in the context of the original problem
Step 1: State the Hypotheses
Two competing statements are set up:
Null hypothesis (H0): The statement of no change, no effect, or the assumed value. It always contains an equality (=, ≤, ≥ but typically just =). It represents the current belief or the value under test.
For the mean: H0:μ=μ0
For the proportion: H0:p=p0
For the standard deviation/variance: H0:σ=σ0 or H0:σ2=σ02
Alternative hypothesis (H1 or Ha): The statement that challenges the null, indicating a possible change. It uses an inequality (<, >, =). The direction determines the type of test.
Left-tailed: H1:μ<μ0 (parameter less than assumed value)
Right-tailed: H1:μ>μ0 (parameter greater than assumed value)
Two-tailed: H1:μ=μ0 (parameter different from assumed value)
The alternative hypothesis is based on the researcher's claim or suspicion, and its form dictates whether the test is one-tailed (left or right) or two-tailed.
Key Point: The null hypothesis always contains the equality, and the alternative contains the inequality. The value in both hypotheses comes from the assumed population parameter (the value under test).
Step 2: Compute the Test Statistic
The test statistic is a standardized score computed from sample data. It measures how far the sample result lies from the null hypothesis value, relative to the expected variability. The formula depends on the parameter being tested.
For a Proportion (p)
When testing a population proportion, the test statistic is a z-score:
Where:
p^=nx is the sample proportion (number of successes divided by sample size)
p0 is the hypothesized population proportion from H0
n is the sample size
For a Mean (μ)
If the population standard deviation (σ) is known (rare in practice): use a z-score
If σ is unknown (most common): use a t-score (Student's t distribution)
Where:
xˉ is the sample mean
μ0 is the hypothesized population mean from H0
s is the sample standard deviation
n is the sample size
Degrees of freedom: df=n−1
For a Standard Deviation or Variance (σ or σ2)
The test statistic follows a chi-square (χ2) distribution:
Where:
s2 is the sample variance
σ02 is the hypothesized population variance from H0
n is the sample size
Degrees of freedom: df=n−1
Note: The chi-square distribution is used only for tests about variability (standard deviation or variance), not for means or proportions.
Step 3: Determine the Decision Rule (Critical Value or p-value)
Two common methods exist for deciding whether to reject the null hypothesis. Both require a significance level, denoted α (alpha). α is the probability of making a Type I error — rejecting a true null hypothesis. Common values are 0.01 (1%), 0.05 (5%), and 0.10 (10%). α is chosen before the test.
Method A: Critical Value Approach
Critical values are cutoff points from the sampling distribution (z, t, or χ2) that mark the boundary of the rejection region. The rejection region is the set of test statistic values that would lead to rejecting H0 at the given α.
Left-tailed test (H1 uses <): The rejection region is in the left tail, area α below the critical value. For a z-test, the critical value is negative (e.g., zα).
Right-tailed test (H1 uses >): The rejection region is in the right tail, area α above the critical value. For a z-test, the critical value is positive (e.g., zα).
Two-tailed test (H1 uses =): The rejection region is split equally between both tails, each with area α/2. Two critical values: one negative, one positive (e.g., zα/2 and −zα/2).
Decision rule: If the test statistic falls inside the rejection region (i.e., beyond the critical value in the direction of the alternative), reject H0. Otherwise, fail to reject H0.
Method B: p-value Approach
The p-value is the probability of observing a test statistic as extreme as (or more extreme than) the one computed from the sample, assuming the null hypothesis is true. It represents the strength of evidence against H0.
For a left-tailed test: p-value = area to the left of the test statistic
For a right-tailed test: p-value = area to the right of the test statistic
For a two-tailed test: p-value = 2 × (area in the tail beyond the test statistic, in the direction of the extreme)
Decision rule:
If p-value ≤α, reject H0. The sample result is too unlikely to occur by random chance alone at the chosen significance level.
If p-value >α, fail to reject H0. The sample result is not sufficiently unusual.
Key Insight: The p-value method is generally preferred when using statistical software, as it directly provides the probability. The critical value method gives a visual cutoff but requires looking up values from tables or calculators.
Step 4: Make the Decision
Based on either the critical value or p-value comparison, the decision is one of two outcomes:
Reject H0: The sample data provides enough evidence to conclude that the null hypothesis is not true. The assumed population parameter appears to have changed.
Fail to reject H0: The sample data does not provide sufficient evidence to conclude that the null hypothesis is false. The assumed value remains plausible.
Important Note: "Fail to reject" does not mean "accept" the null hypothesis. It simply means the evidence is not strong enough to reject it. The null hypothesis might still be false, but the test didn't detect the difference.
Step 5: Summarize the Conclusion
The conclusion must be written in the context of the original research question. It should clearly state whether there is sufficient evidence to support the alternative claim.
Phrases used:
If reject H0: "There is sufficient evidence to conclude that [state the alternative in context]."
If fail to reject H0: "There is not sufficient evidence to conclude that [state the alternative in context]."
For example, if testing whether a new drug reduces blood pressure (with H1:μ<120):
Reject: "The data provide sufficient evidence that the drug reduces blood pressure below 120."
Fail to reject: "The data do not provide sufficient evidence that the drug reduces blood pressure below 120."
Worked Example: One-Proportion z-Test
Problem: A survey claims that 38% of Americans will not eat carbs this Thanksgiving. A dietitian believes the proportion is actually lower. A random sample of 150 residents shows that 48 said they will not eat carbs. Test the dietitian's claim at the 5% significance level.
Step 1: Hypotheses
H0:p=0.38 (the assumed proportion)
H1:p<0.38 (the dietitian's claim — lower)
Step 2: Test Statistic
Sample proportion: p^=15048=0.32
Null proportion: p0=0.38
Sample size: n=150
Compute z-score:
Step 3: Decision Rule (p-value method)
Significance level: α=0.05
This is a left-tailed test, so p-value = area to the left of z=−1.51 under the standard normal curve.
Using software or a z-table: p-value ≈0.0655
Step 4: Decision
Compare p-value to α: 0.0655>0.05
Since p-value >α, we fail to reject H0.
Step 5: Conclusion
"There is not sufficient evidence at the 5% significance level to conclude that the proportion of Americans who will not eat carbs this Thanksgiving is less than 38%."
Note on Critical Value Method: For a left-tailed test with α=0.05, the critical z-value is zα=−1.645. Since the test statistic z=−1.51 is greater than −1.645 (i.e., lies to the right of the critical value, outside the rejection region), we fail to reject H0 — the same conclusion.
Using Software (StatCrunch)
Statistical software like StatCrunch simplifies the computation. For hypothesis tests:
For proportions: Stat → Proportion Stats → One Sample → With Summary → enter number of successes (x), sample size (n), null proportion (p0), and select the alternative hypothesis direction (<, >, =). Choose "Hypothesis test" and set the significance level. Check "Show critical value" if desired. The output provides the test statistic (Z-stat), p-value, and critical value.
For means (unknown σ): Stat → T Stats → One Sample → With Summary → enter sample mean, sample standard deviation, sample size. Set the null mean and alternative direction. The output gives the t-statistic, p-value, and critical t-value.
For means (known σ): Stat → Z Stats → One Sample → With Summary (rarely used)
For standard deviation/variance: Stat → Variance Stats → One Sample → With Summary → enter sample variance (or standard deviation) and sample size. The output gives the chi-square statistic and p-value.
Two-sample tests follow a similar pattern under "Two Sample" options.
Two-Population Hypothesis Tests (Introduction)
The same five-step process extends to comparing two populations. The hypotheses now involve the difference between two parameters.
For two proportions: H0:p1=p2 (or p1−p2=0); H1:p1=p2 (or p1<p2, p1>p2)
For two means: H0:μ1=μ2 (or μ1−μ2=0); H1:μ1=μ2 (or μ1<μ2, μ1>μ2)
For two variances/standard deviations: H0:σ12=σ22; H1:σ12=σ22 (usually using an F-test)
The test statistics use pooled or unpooled estimates. The decision and conclusion steps are analogous. For example, in StatCrunch for two independent sample means, use Stat → T Stats → Two Sample → With Summary, enter sample statistics for both groups, set the null difference to 0, and choose the appropriate alternative. The output provides a t-statistic and p-value.
Takeaway: The logic of hypothesis testing — form hypotheses, compute a test statistic, compare to a critical value or p-value, make a decision, and state a conclusion — remains identical whether testing one parameter or comparing two. Only the formulas and distributions change according to the parameter type and sample design.

Ask anything
We've read this whole study set, so questions about it get the best answers.