HypothesisTesting
Dr. Nelson K.Bii
Hypothesis Testing
Dr. Nelson K. Bii
13/08/2021
Institute of Mathematical Sciences, Strathmore University
HypothesisTesting
Dr. Nelson K.Bii
Hypothesis Testing
A hypothesis test is a process that uses sample statisticsto test a claim about the value of a population parameter.e.g if a manufacturer claims that a battery lasts for anaverage 1000 hours, then a sample would be taken to testthis claim.
A verbal statement, or claim, about a populationparameter is called statistical hypothesis.
A pair of hypothesis is stated - one that represents theclaim, and the other, its complement. When one of thesehypotheses is false, the other must be true.
HypothesisTesting
Dr. Nelson K.Bii
Types of Hypothesis
Null Hypothesis H0 : - Contains statement of equalitye.g. ≤, =, or ≥Alternative Hypothesis Ha : - Complement of H0. Mustbe true if H0 is false. It contains statement of inequalitye.g. <, 6=, or >.
Note:
To write H0 or Ha, translate the claim made about thepopulation parameter from a verbal statement to amathematical statement.
HypothesisTesting
Dr. Nelson K.Bii
Tests of Hypothesis contd...
Example 1:A manufacturer claims that its rechargeable batteries have anaverage life of atleast 1000 charges.
µ ≥ 1000 is a condition of equality.
Write the claim as a mathematical sentence. State H0 andHa. Identify which represents the claim.Solution:
H0 : µ ≥ 1000 (claim)
Ha : µ < 1000
(“ <′′ complement of H0)
HypothesisTesting
Dr. Nelson K.Bii
Types of errors
No matter which hypothesis represents the claim, alwaysbegin the hypothesis testassuming that the null hypothesis, H0 is true.
At the end of the test, one of two decisions will be made:
(a) Reject H0 or
(b) Fail to reject H0
Type I error occurs if H0 is rejected when it is true.
Type II error occurs if H0 is not rejected when it is false.
HypothesisTesting
Dr. Nelson K.Bii
Types of Errors contd...
Actual Truth of H0
Decision H0 True H0 FalseDo not reject H0 Correct Decision Type II Error
Reject H0 Type I Error Correct Decision
Example 2A certain college claims that 94% of their graduates findemployment within 6 months of graduation. What will a type Ior type II error be?
H0 : p = 0.94 (claim)Ha : p 6= 0.94
Type I error: Population proportion is 0.94 but is rejected,(we believe it is not 0.94).Type II error: Population proportion is not 0.94 but is notrejected, (we believe it is 0.94).
HypothesisTesting
Dr. Nelson K.Bii
Level of Significance, α
Is the maximum allowable probability of making a type Ierror.
Hypothesis tests are based on α.
Probability of making type II error is denoted by β.
Note: By setting α at a small value, one is saying that he/shewants the probability of rejecting H0 to be small. Commonlyused level of α are α = 0.10, α = 0.05 or α = 0.01.
After stating H0 and Ha and specifying α, a randomsample is taken from the population and sample statisticsare calculated.
The statistic that is compared with the parameter in H0 iscalled the test statistic.
HypothesisTesting
Dr. Nelson K.Bii
Test Statistic
Example:
Population Parameter Test Statistic Standardized Test Statistic
µ X̄ Z (n ≥ 30), t (n < 30)p p̂ Zσ2 S2 X̄ 2
Use of Z :
Population is normal (or approx. normal)
n ≥ 30
σ is known
Use of t:
Population is normal (or approx. normal)
n < 30
σ is unknown
HypothesisTesting
Dr. Nelson K.Bii
Test of Hypothesis contd...
P-Values:
If H0 is true, a P-value (or probability value) of ahypothesis test is the probability of obtaining a samplestatistic with a value as extreme or more extreme than theone determined from the sample data.
The P-value (or calculated probability) is the estimatedprobability of rejecting the null hypothesis (H0) of a studyquestion when that hypothesis is true.
A smaller P-value means that there is stronger evidence infavor of the alternative hypothesis.
P-value of a hypothesis test depends on the nature of thetest.
HypothesisTesting
Dr. Nelson K.Bii
Test of Hypothesis contd...
Types of Tests:
1 Left-tailed test
2 Right-tailed test
3 Two-tailed test.
The type of test depends on the region of samplingdistribution that favours a rejection region of H0. Thisregion is indicated by the Ha.
HypothesisTesting
Dr. Nelson K.Bii
Test of Hypothesis contd...
(a) Left-Tailed Test:
Ha contains < sign
H0 : µ ≥ kHa : µ < k
HypothesisTesting
Dr. Nelson K.Bii
Test of Hypothesis contd...
(b) Right-Tailed Test:
Ha contains > sign
H0 : µ ≤ kHa : µ > k
HypothesisTesting
Dr. Nelson K.Bii
Test of Hypothesis contd...
(c) Two-Tailed Test:
Ha contains 6= sign
H0 : µ = kHa : µ 6= k
HypothesisTesting
Dr. Nelson K.Bii
Test of Hypothesis contd...
Identifying Types of Tests:Example 1:For each claim, state H0 and Ha. Then determine whether thehypothesis test is a left-tailed, right-tailed, or two-tailed test.
(a) A cigarette manufacturer claims that less than one-eighthof the Kenyan adult population smokes cigarettes.
H0 : p ≥ 0.125Ha : p < 0.125 (claim) < =⇒ left-tailed test.
(b) A local telephone company claims that the average lengthof a phone call is 8 minutes.
H0 : µ = 8 (claim)Ha : µ 6= 8 = =⇒ two-tailed test.
HypothesisTesting
Dr. Nelson K.Bii
Making a Decision
(a) Decision Rule Based on P-value
To use a P-value to make a conclusion in a hypothesistest, compare the P-value with α.
(i) If P ≤ α, then reject H0
(ii) If P > α, then fail to reject H0
HypothesisTesting
Dr. Nelson K.Bii
Interpreting a Decision
A hypotheis test is performed for the following claim. Howshould you interpret your decision if you
(a) Reject H0
(b) Fail to reject H0?
Example:H0 : ( Claim ) A cigarette manufacturer claims that less thanan eighth of the Kenyan adult population smokes cigarettes.
(i) If H0 is rejected, you should conclude: “there is sufficientevidence to indicate that the manufacturer’s claim isfalse.”
(ii) If you fail to reject H0, you should conclude: “there is notsufficient evidence to indicate that the manufacturer’sclaim is false.”
HypothesisTesting
Dr. Nelson K.Bii
Steps for Hypothesis Testing
1 State the claim (mathematically and verbally). Identify H0
and Ha.
2 Specify α.
3 Determine the standardized sampling distribution anddraw its graph assuming H0 is true.
4 Calculate test statistic and its standardized value. Add itto your sketch.
HypothesisTesting
Dr. Nelson K.Bii
Steps for Hypothesis Testing contd...
5 Find the P-value.
6 Use the following decision rule: Is P-value ≤ α ? If yes,Reject H0. If no, fail to reject H0.
7 Write a statement to interpret the decision in the contextof the original claim.Note: These steps apply to left-tailed, right-tailed andtwo-tailed tests.