Hypothesis testing is a form of statistical inference that uses data from a sample to draw conclusions. There are 5 steps of Hypothesis Testing that has been illustrated below:
Step 1 – Setup hypothesis and determine level of significance
- Setup Null hypothesis (H0) from population parameters
- Setup Alternative hypothesis (H1)
- Setup appropriate significance level,α
Step 2 – Compute test statistic
- From H1, determine whether this is an upper, lower, or two-tailed test
- Depending on sample size select appropriate sample distribution (t-statistic or Z-statistic
- Compute the test statistic
Step 3 – Determine critical value(Zα) of the test based on a ( level of significance)
Step 4 – Compare Z with Zα, and conclude the test
Step 5 – Decision Rule
- if I Z l< Zα, Z is not significant and the null hypothesis may, therefore, be accepted
- If I Z I≥ Zα, Z is significant and the null hypothesis is rejected.
Let’s understand Hypothesis Testing with an example.
Example : Hypothesis Test – Population Mean – Upper Tailed Test
Chips company claims that maximum saturated fat content in chip packet is 2 grams with std dev = 0.25
A test on a sample of 35 packets reveal that mean saturated fat is 2.1 grams
Should the claim of Chips company be rejected?
Let’s test the null hypothesis at the significance level of 5%.
Step 1: Set up null hypothesis and alternative hypothesis
H0 : mu <= 2
Null Hypothesis
H1 : mu > 2
Alternative Hypothesis – Upper tailed test
level of significance = 0.05
Step 2: Compute Test Statistics
Sample size id more than 30. So, need to calculate Z statistics mu = 2
Population mean Xbar = 2.1
Sample mean sigma = 0.25
Population Std Dev n = 35
Sample Size SE = sigma/sqrt(n)
Sample std deviation: 0.0422 Z = (Xbar – mu)/SE
Z score – Z – 2.36 std dev away from the mean
Step 3: Compute critical value for significance level = 0.05 or Confidence Interval = 95%
Zα = qnorm(1-α)
Zα – Critical value for 95% confidence
Step 4: Compare Test statistic with critical value and conclude the test
Decision
if Z < Zα, Z is not significant and the null hypothesis may, therefore, be accepted.
if Z ≥ Zα, Z is significant and the null hypothesis is rejected Z > Zα
Conclusion
With 95% confidence the claim of at most 2 grams of saturated fat in a chips packet should be rejected
Chances of Error in Sampling
TYPE I Error
When we reject the null Hypothesis, although that Hypothesis was true, it is called as TYPE I Error. This type of error is denoted by alpha(α). In Hypothesis Testing, the normal curve that shows the critical region is called the alpha region
TYPE II error
When we accept the null Hypothesis but it is false then it is called as TYPE II error. This type of error is denoted by (β). In Hypothesis Testing, the normal curve that shows the acceptance region is called the beta region