Hypothesis Test and Confidence Interval Calculator
This calculator performs hypothesis tests and calculates confidence intervals for population means. It helps determine whether sample data provides enough evidence to reject a null hypothesis and estimates the range where the true population mean likely falls.
What is a Hypothesis Test and Confidence Interval?
A hypothesis test evaluates whether sample data provides enough evidence to reject a null hypothesis. A confidence interval estimates the range where the true population parameter likely falls with a specified probability.
Common hypothesis tests include z-tests and t-tests, while confidence intervals are calculated using sample statistics and standard errors.
Key Formulas
Z-test statistic: \( z = \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}} \)
T-test statistic: \( t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}} \)
Confidence interval: \( \bar{x} \pm z_{\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} \) (for z-test) or \( \bar{x} \pm t_{\alpha/2} \cdot \frac{s}{\sqrt{n}} \) (for t-test)
Note: This calculator assumes normally distributed data. For small samples (n < 30), use the t-distribution. For larger samples, use the z-distribution.
How to Use This Calculator
- Enter your sample mean (x̄)
- Enter the population standard deviation (σ) or sample standard deviation (s)
- Enter the sample size (n)
- Enter the hypothesized population mean (μ₀)
- Select the significance level (α)
- Choose between z-test or t-test
- Click "Calculate" to get results
Formulas and Assumptions
The calculator uses these statistical formulas:
- Z-test for large samples (n ≥ 30)
- T-test for small samples (n < 30)
- Confidence intervals based on standard error
Assumptions:
- Data is normally distributed
- Samples are independent and random
- Population standard deviation is known for z-tests
Worked Example
Suppose we want to test if the average height of a population is 170 cm, with a sample mean of 172 cm, standard deviation of 5 cm, and sample size of 50.
- Calculate standard error: 5/√50 ≈ 0.707
- Calculate z-score: (172-170)/0.707 ≈ 2.83
- Determine p-value from z-table: ≈ 0.0023
- Compare to α = 0.05: p < α → Reject null hypothesis
- Calculate 95% confidence interval: 172 ± 1.96*0.707 → [170.6, 173.4]
Interpreting Results
For hypothesis tests:
- If p-value < α, reject the null hypothesis
- If p-value ≥ α, fail to reject the null hypothesis
For confidence intervals:
- 95% CI means there's 95% probability the true mean falls within the interval
- Wider intervals indicate more uncertainty