Hypothesis Testing Calculator
Perform Z-tests and T-tests to evaluate null and alternative hypotheses with statistical significance
Hypothesis Test Setup
Choose based on sample size and known parameters
Direction of the alternative hypothesis
Value specified in the null hypothesis (H₀: μ = μ₀)
Probability of Type I error (rejecting true H₀)
Average value of your sample data
Number of observations in your sample
Sample standard deviation (uses T-test)
Example: Factory Weight Claim
Problem Statement
A factory claims that the average weight of its products is 500g. A quality control officer takes a sample of 30 products.
Sample results: Sample mean = 495g, Sample SD = 10g
Question: Test at α = 0.05 whether the factory's claim is true.
Solution Steps
1. Hypotheses: H₀: μ = 500, H₁: μ ≠ 500 (two-tailed)
2. Test statistic: Z = (495 - 500) / (10/√30) = -2.74
3. Critical value: ±1.96 (for α = 0.05, two-tailed)
4. Decision: |−2.74| > 1.96 → Reject H₀
5. Conclusion: Sufficient evidence that mean weight ≠ 500g
When to Use Which Test
Z-Test
- • Population SD (σ) is known
- • Sample size n ≥ 30
- • Population is normally distributed
- • More powerful than t-test
T-Test
- • Population SD (σ) is unknown
- • Any sample size (especially n < 30)
- • Uses sample SD (s) as estimate
- • More conservative than z-test
Types of Alternative Hypotheses
Two-tailed (μ ≠ μ₀)
Tests if mean is different from hypothesized value
Right-tailed (μ > μ₀)
Tests if mean is greater than hypothesized value
Left-tailed (μ < μ₀)
Tests if mean is less than hypothesized value
Understanding Hypothesis Testing
What is Hypothesis Testing?
Hypothesis testing is a statistical method used to make inferences about population parameters based on sample data. It provides a structured approach to determine whether observed differences are statistically significant or due to random chance.
Key Components
- •Null Hypothesis (H₀): Statement of no effect or difference
- •Alternative Hypothesis (H₁): Statement of effect or difference
- •Test Statistic: Standardized measure of evidence
- •P-value: Probability of observing data if H₀ is true
Test Formulas
Z-test Statistic:
Z = (x̄ - μ₀) / (σ / √n)
When population standard deviation σ is known
T-test Statistic:
t = (x̄ - μ₀) / (s / √n)
When population standard deviation σ is unknown
Decision Rules
- Critical Value: Reject H₀ if |test statistic| > critical value
- P-value: Reject H₀ if p-value < α
- Confidence: Higher confidence → larger critical values
Types of Errors
Type I Error (α)
- • Rejecting true null hypothesis
- • False positive result
- • Controlled by significance level
- • More serious in some contexts
Type II Error (β)
- • Failing to reject false null hypothesis
- • False negative result
- • Related to statistical power (1-β)
- • Reduced by larger sample sizes