Hypothesis Test Calculator (z-test & t-test)
Perform one-sample hypothesis tests. Calculate the z-statistic or t-statistic and determine whether to reject the null hypothesis.
As an Amazon Associate and CJ Affiliate publisher we earn from qualifying purchases. Prices and availability may vary.
Hypothesis Testing Guide
What do I need to know about Steps in Hypothesis Testing?
1. State H₀ (null hypothesis) and H₁ (alternative hypothesis). 2. Choose significance level α (typically 5%). 3. Calculate test statistic: z = (x̄ − μ₀) / (σ/√n). 4. Find critical value from z-table (or t-table for t-test). 5. Decision rule: reject H₀ if |z| > z_critical (two-tailed) or z > z_critical (one-tailed upper). Or equivalently: reject H₀ if p-value < α. Example: H₀: μ = 50. H₁: μ > 50. x̄ = 52.3, σ = 8, n = 36. z = (52.3-50)/(8/6) = 2.3/1.333 = 1.725. One-tailed at α=0.05: critical z = 1.645. Since our calculated z (1.725) exceeds this critical value, we reject H₀ and conclude there is significant evidence the true mean exceeds 50.
What should I know about Type I and Type II Errors?
Type I error (α): rejecting H₀ when it is actually true. The significance level α is the probability of a Type I error. Choosing α = 0.05: 5% chance of incorrectly rejecting a true null hypothesis. Type II error (β): failing to reject H₀ when it is actually false. Power of test = 1 − β = probability of correctly rejecting a false H₀. There is a trade-off: reducing α (stricter) increases the chance of a Type II error. Context matters: in medical testing for a serious disease, a Type II error — missing a true diagnosis — is usually considered far worse than a Type I error, which is why screening tests are often deliberately set to be more sensitive at the cost of more false positives.
What should I know about p-value Interpretation?
The p-value is the probability of observing a test statistic as extreme as or more extreme than the one calculated, assuming H₀ is true. p-value < α: reject H₀ — statistically significant result. p-value > α: fail to reject H₀ — insufficient evidence. Common misinterpretation: the p-value is NOT the probability that H₀ is true. It is NOT the probability of getting this result by chance. It IS the probability of getting this extreme a result if H₀ were true. A p-value of 0.03 means: if H₀ were true, there's only a 3% chance of observing a result this extreme purely by random variation — evidence against the null hypothesis, but not proof it's false.
What's the difference between z-test and t-test?
Use z-test when: population standard deviation σ is known. Sample size is large (n > 30, approximately). Use t-test when: population σ is unknown and estimated from sample. Sample is small (n < 30). The t-distribution has heavier tails than the normal — it is more conservative (harder to reject H₀), reflecting the additional uncertainty from estimating σ. For large n, t approaches z — the test choice matters mainly for small samples. Degrees of freedom for t-test: df = n − 1. The critical t-value is always slightly larger than the equivalent z-value for the same confidence level, since the t-distribution accounts for the extra uncertainty of estimating the standard deviation from a small sample.