You are on page 1of 15

HYPOTHESIS TESTING

Lec_8

CYRUS MUTIE; BSc. N &PH, MIH, PhD (c)


Hypothesis Testing
• Hypothesis testing is a type of statistical inference

• It is a statement of tentative assumption as to the probable results

• It aids the researcher in reaching a decision concerning a population


by examining a sample from a population.
Hypothesis Testing
• In statistics, a hypothesis is a claim or statement about a property of a
population that we want to test

• A hypothesis test (or test of significance) is a procedure for testing a


claim about a property of a population.
Hypothesis Testing
• Null (H0) hypothesis; (zero hypothesis), no significance difference

• Alternative Hypothesis (H1 or HA); hypothesis of a significant


difference
Hypothesis Testing
• Null (H0) hypothesis; the currently accepted value for a parameter;
e.g. the birth weight, I.Q etc. (what we currently believe is true)

• Alternative Hypothesis (H1 or HA); also called the research hypothesis.


Involves the claim we want to test.
Hypothesis testing;
• Example;
• It is believed that a candy machine makes chocolate bars that are on
average 5 gms. A worker claim that the machine after maintenance
no loner makes 5 gm bars,
• Write the H0 and HA
• H0: µ=5gms (what is already known. Currently
accepted value for a parameter)
• HA: µ≠5gms (what we want to investigate. The claim
to be tested)
Hypothesis testing
• Possible outcomes for our example;
• Reject the Null hypothesis
• Fail to reject the Null hypothesis
• So we have to do a test statistic (so that we can decide to reject or fail
to reject the null hypothesis)
• We will need to do some calculations on sample data for us to decide
on the above outcomes.
• E.g we can sample 50 cholate bars, and get the average value of the
weight of the bars (the test statistic in this case)
Hypothesis testing
• Statistically significant; where do we draw the line to make a decision?
• Level of confidence;
• C-95%
• C-99%
• How confident are we in our decision.
• Level of significance (a compliment of level of confidence) alpha α =1-C
• So LoC=95%, or 99%
• α=0.05
• α=0.01
• You can be given either the level of confidence or level of
significance…(and you can use either, they mean the same thing).
Hypothesis testing
• The test statistic outcome has to be statistically significant; for us to
know where we draw the line to make a decision on whether to reject
or fail to reject the null hypothesis

• (think of 3 guys taking the averages in 3 different days; guy 1 gets


(5.12gms), guy 2 gets (5.72 gms), and guy 3 gets (7.23 gms). We
realize guy 3 got 7.23gms, which is far from 5 gms (the current value
for the parameter)…(do we say this is statistically significant?)
Hypothesis testing;
• Suppose we want to test if the mean/average of the chocolate bars is
below 5 gms. Then we write the hypothesis as below;
• H0: µ≥5gms
• HA: µ<5gms
• Suppose we want to test if the mean/average of the chocolate bars is
above/greater than 5gms. Then we write the hypothesis as below;
• H0: µ≤5gms
• HA: µ>5gms
Hypothesis testing;
One tailed

Left tailed Right tailed


Two tailed

H0: µ=5gms H0: µ≥5gms H0: µ≤5gms


HA: µ≠5gms HA: µ<5gms HA: µ>5gms

Reject H0 Reject H0
Reject H0 Fail to Reject H0 Reject H0 Fail to Reject H0
Fail to Reject H0
(Acceptance) Region (Acceptance) Region
(Acceptance) Region
Type 1 and 2 Errors in Hypothesis Testing
• Type 1 error; occurs when you reject the null hypothesis when it is
true
• The probability of committing type 1 error is represented by alpha (α)
• Type 1 error is also called random error
• Type 2 error; occurs when you fail to reject the null hypothesis when
it is false
• The probability of committing type 2 error is represented by beta (β)
• Type 2 error is also called systematic or error of measurement
• The probability of rejecting a false null hypothesis is given by (1-β)
and is called the power of the test or precision
Type 1 and 2 Errors in Hypothesis Testing
Decision (Null Hypothesis) H0

H0 True H0 False
Reject H0 Type 1 Error Correct Decision
Fail to reject H0 Correct Decision Type 2 Error

• Here, we have the null hypothesis (true or false), which we can’t control because it is the true state of nature.
• But we can control our decisions, either to reject the null hypothesis or fail to reject it.
• Let us say the null hypothesis is true, and we reject it when it is true, then that’s an error, (type 1 error)
• If the null hypothesis is false, and we reject it, then we have made a good decision and not an error.
• If the null hypothesis is true, and we fail to reject it, it’s also a good decision, and not an error.
• But, if the null hypothesis is false and we fail to reject it, then that’s bad (we don’t want to accept a false null
hypothesis) and it’s an error (type 2 error).
Example;
• let's say that the null hypothesis (H0 ): John’s car is safe to drive.
a) Which statement represent type 1 error?
b) Which statement represents a type 2 error?
c) Which type of error has greater consequence?
A. John thinks that his car may be safe when in fact, it is not safe.
B. John thinks that his car may be safe when in fact it is safe.
C. John thinks that his car may not be safe when in fact it is not safe.
D. John thinks that his car may not be safe when in fact it is safe.
Example;
A. John thinks that his car may be safe when, in fact, it is not safe. (type 2
error)
B. John thinks that his car may be safe when, in fact it, is safe. (correct
decision)
C. John thinks that his car may not be safe when, in fact, it is not safe
(correct decision)
D. John thinks that his car may not be safe when, in fact, it is safe (type 1
error)
• (type 2 error (systematic/error of measurement) as given above, has a
greater consequence, because john may actually drive the car which is not
safe and cause an accident).
• (type 1 error (random error) as given above, has lesser consequence,
because by the fact that john believes the car is not safe, will not drive it,
and perhaps stay indoors, and no chances of causing an accident).

You might also like