Hypothesis Test Calculator

Perform z-tests, t-tests, and two-sample tests with step-by-step solutions and p-values

рдЦреАрдВрдЪреЗрдВ рдФрд░ рдЫреЛрдбрд╝реЗрдВ рдпрд╛ рдХреНрд▓рд┐рдХ рдХрд░реЗрдВ рдЫрд╡рд┐рдпрд╛рдБ рдпрд╛ PDF рдЬреЛрдбрд╝рдиреЗ рдХреЗ рд▓рд┐рдП

тИСMath Input
One-sample t-test: n=25, x_bar=52, sample sd=8, mu_0=50, alpha=0.05
One-sample z-test: n=100, x_bar=48, sigma=10, mu_0=50, alpha=0.05
Two-sample t-test: n1=30, x1=75, s1=6, n2=35, x2=71, s2=7
Test whether proportion p=0.48 differs from p_0=0.5, n=200, alpha=0.05

What is Hypothesis Testing?

Hypothesis testing is a formal statistical procedure for deciding whether sample data provide sufficient evidence to reject a claim about a population parameter.

The Two Hypotheses

  • Null hypothesis H0H_0: the default claim тАФ assumes no effect, no difference, or a specific parameter value (e.g., ╬╝=50\mu = 50).
  • Alternative hypothesis HaH_a (or H1H_1): the claim you want to support тАФ can be two-sided (тЙа\neq), left-tailed (<<), or right-tailed (>>).

The Logic

Assume H0H_0 is true. Compute how extreme the sample result is if H0H_0 were true тАФ this probability is the p-value. A very small p-value means the data would be highly unlikely under H0H_0, so we reject H0H_0 in favor of HaH_a.

Significance Level ╬▒\alpha

╬▒\alpha is the threshold for rejection. The most common choices are ╬▒=0.05\alpha = 0.05 (5%) and ╬▒=0.01\alpha = 0.01 (1%). If p-value<╬▒p\text{-value} < \alpha, you reject H0H_0.

Type I and Type II Errors

DecisionH0H_0 is trueH0H_0 is false
Reject H0H_0Type I error (false positive), prob. =╬▒= \alphaCorrect (power =1тИТ╬▓= 1 - \beta)
Fail to reject H0H_0Correct (prob. =1тИТ╬▒= 1 - \alpha)Type II error (false negative), prob. =╬▓= \beta

Common Hypothesis Tests

One-Sample Z-Test (known ╧Г\sigma)

Tests whether the population mean equals a specified value when the population standard deviation ╧Г\sigma is known:

z=x╦ЙтИТ╬╝0╧Г/nz = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}

Compare zz to a standard normal critical value zтИЧz^* (e.g., ┬▒1.96\pm 1.96 for two-sided ╬▒=0.05\alpha = 0.05).

One-Sample T-Test (unknown ╧Г\sigma)

The most common test in practice тАФ uses the sample standard deviation ss:

t=x╦ЙтИТ╬╝0s/n,df=nтИТ1t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}, \quad df = n - 1

Compare tt to a t-distribution critical value. For large nn, the t-distribution approaches the standard normal.

Two-Sample T-Test

Tests whether two independent population means are equal:

t=x╦Й1тИТx╦Й2s12n1+s22n2t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}}

Degrees of freedom are estimated with the WelchтАУSatterthwaite approximation when ╧Г1тЙа╧Г2\sigma_1 \neq \sigma_2 is not assumed.

Z-Test for a Proportion

Tests whether a population proportion equals a specified value p0p_0:

z=p^тИТp0p0(1тИТp0)/nz = \frac{\hat{p} - p_0}{\sqrt{p_0(1 - p_0)/n}}

Valid when np0тЙе10np_0 \geq 10 and n(1тИТp0)тЙе10n(1 - p_0) \geq 10.

Critical Values Quick Reference

Test type╬▒=0.05\alpha = 0.05╬▒=0.01\alpha = 0.01
Two-sided z┬▒1.96\pm 1.96┬▒2.576\pm 2.576
Right-tailed z1.6451.6452.3262.326
Left-tailed zтИТ1.645-1.645тИТ2.326-2.326

Step-by-Step Hypothesis Testing Procedure

Follow these five steps for any hypothesis test:

  1. State the hypotheses: Write H0H_0 and HaH_a in terms of the population parameter. Identify the tail direction (two-sided, left, or right).

  2. Choose the test and check conditions: Pick the appropriate test statistic (z or t). Verify sample size conditions (normality, independence).

  3. Compute the test statistic: Plug in the sample values.

  4. Find the p-value: Using the test statistic and the sampling distribution, compute the probability of observing a result at least as extreme as yours under H0H_0. For two-sided tests, double the one-tail area.

  5. State the conclusion: If p-value<╬▒p\text{-value} < \alpha, reject H0H_0 тАФ the data provide statistically significant evidence for HaH_a. Otherwise, fail to reject H0H_0 (this is NOT the same as accepting H0H_0).

Examples

Step 1: Hypotheses: H0:╬╝=50H_0: \mu = 50, Ha:╬╝>50H_a: \mu > 50 (right-tailed), ╬▒=0.05\alpha = 0.05
Step 2: Test statistic: t=52тИТ508/25=21.6=1.25t = \dfrac{52 - 50}{8/\sqrt{25}} = \dfrac{2}{1.6} = 1.25, df=24df = 24
Step 3: Critical value: t24тИЧ=1.711t^*_{24} = 1.711 (one-tailed, ╬▒=0.05\alpha = 0.05)
Step 4: p-value: P(T24>1.25)тЙИ0.112P(T_{24} > 1.25) \approx 0.112
Step 5: Decision: 0.112>0.050.112 > 0.05 тАФ fail to reject H0H_0
Answer: Fail to reject H0H_0. Insufficient evidence to conclude ╬╝>50\mu > 50 at the 5% significance level (pтЙИ0.112p \approx 0.112).

Step 1: Conditions: np0=200(0.5)=100тЙе10np_0 = 200(0.5) = 100 \geq 10 тЬУ
Step 2: Test statistic: z=0.48тИТ0.50.5тЛЕ0.5/200=тИТ0.020.0354тЙИтИТ0.566z = \dfrac{0.48 - 0.5}{\sqrt{0.5 \cdot 0.5 / 200}} = \dfrac{-0.02}{0.0354} \approx -0.566
Step 3: Two-sided p-value: p=2├ЧP(Z<тИТ0.566)тЙИ2(0.2858)=0.572p = 2 \times P(Z < -0.566) \approx 2(0.2858) = 0.572
Step 4: Critical value: ┬▒1.96\pm 1.96; тИгтИТ0.566тИг<1.96|{-0.566}| < 1.96
Step 5: Decision: 0.572>0.050.572 > 0.05 тАФ fail to reject H0H_0
Answer: Fail to reject H0H_0. The data do not provide significant evidence that the true proportion differs from 0.5 (pтЙИ0.572p \approx 0.572).

Step 1: Hypotheses: H0:╬╝1=╬╝2H_0: \mu_1 = \mu_2, Ha:╬╝1тЙа╬╝2H_a: \mu_1 \neq \mu_2 (two-sided)
Step 2: Standard error: 62/30+72/35=1.2+1.4=2.6тЙИ1.612\sqrt{6^2/30 + 7^2/35} = \sqrt{1.2 + 1.4} = \sqrt{2.6} \approx 1.612
Step 3: Test statistic: t=(75тИТ71)/1.612тЙИ2.481t = (75 - 71)/1.612 \approx 2.481
Step 4: Degrees of freedom (Welch): dfтЙИ62df \approx 62
Step 5: p-value (two-sided): pтЙИ2├ЧP(T62>2.481)тЙИ0.016p \approx 2 \times P(T_{62} > 2.481) \approx 0.016
Step 6: Decision: 0.016<0.050.016 < 0.05 тАФ reject H0H_0
Answer: Reject H0H_0. There is significant evidence that the two group means differ (pтЙИ0.016p \approx 0.016).

Frequently Asked Questions

A result is statistically significant when the p-value is below the chosen significance level ╬▒. It means the observed result would be unlikely to occur by chance alone if the null hypothesis were true тАФ it does NOT measure the practical importance or size of the effect.

A two-tailed test checks for differences in either direction (H_a: ╬╝ тЙа ╬╝_0) and splits ╬▒ across both tails. A one-tailed test is directional (H_a: ╬╝ > ╬╝_0 or H_a: ╬╝ < ╬╝_0) and puts all of ╬▒ in one tail. Use a one-tailed test only when you have a strong a priori reason to expect a particular direction.

The p-value is the probability of observing a test statistic at least as extreme as the one computed, assuming H_0 is true. A small p-value means the observed data are inconsistent with H_0. It is NOT the probability that H_0 is true.

Use a z-test when the population standard deviation ╧Г is known. Use a t-test (far more common) when ╧Г is unknown and you estimate it with the sample standard deviation s. For large samples (n тЙе 30), the distinction matters less because the t-distribution closely approximates the normal.

Related Solvers

Related Guides

Try AI-Math for Free

Get step-by-step solutions to any math problem. Upload a photo or type your question.

Start Solving