0% found this document useful (0 votes)
5 views51 pages

Biostat Lecture Eight

The document provides an overview of hypothesis testing, including definitions of null and alternative hypotheses, types of errors (Type I and Type II), and the process for conducting hypothesis tests. It outlines the steps for testing population means, the significance levels, and the decision rules for accepting or rejecting hypotheses. Additionally, it includes examples to illustrate the application of these concepts in statistical analysis.

Uploaded by

birukfirdut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views51 pages

Biostat Lecture Eight

The document provides an overview of hypothesis testing, including definitions of null and alternative hypotheses, types of errors (Type I and Type II), and the process for conducting hypothesis tests. It outlines the steps for testing population means, the significance levels, and the decision rules for accepting or rejecting hypotheses. Additionally, it includes examples to illustrate the application of these concepts in statistical analysis.

Uploaded by

birukfirdut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

Hypothesis Testing

TESHOME. D (BSc, MPH)

02/08/2025 [email protected] 1
What is a Hypothesis?

•A hypothesis is a statement
of belief about the values of I assume the mean
population parameters. G PA of this class is
3.25!
•A parameter is a
characteristic of the
population, like its mean or
variance.
• The parameter must
be identified before
analysis.
© 1984-1994 T/Maker
Co.

2
Hypothesis
testing
• The procedure for evaluating a hypothesis.

• Hypothesis:
 Is a testable statement that describes the nature of the
proposed relationship between two or more variables of
interest.
 It is a guesswork about a population parameter.

• This statement (assumption) may or may not be true.

33
Hypothesis testing
cot…
• Statistical tests can prove (with a certain degree of
confidence), whether the statement is true or not
• The best way to determine whether a statistical hypothesis
is true would be to examine the entire population.

• Examples of hypothesis testing


• The mean height of Haramaya College of Medical Sciences
(HCMS) students’ is 1.63m.
• There is no difference between the distribution of Pf and Pv
malaria in Ethiopia (i.e. are distributed in equal proportions)
44
Hypothesis testing
• Typescot…
of hypothesis:

1.Null hypothesis (H0); is a statistical hypothesis that states


that there is no difference between a parameter and a specific
hypothesized value, or that there is no difference between two
parameters.
• It is the main hypothesis which we wish to test .

• H0: parameter = hypothesized value.


55
Hypothesis
testing
• HO is always a statement about a parameter (mean,

proportion, etc.. of a population).

• The null hypothesis (H0) will always state that the parameter

equals the value specified in the alternative hypothesis (H1)

66
Hypothesis testing
cot…

2. alternative hypothesis symbolized by H1:


• is a statistical hypothesis that states the existence of a
difference between a parameter and a specific
hypothesized value, or states that there is a difference
between two parameters
• Contains the values of the parameter we accept if we
reject the null.

77
State the null and alternative
hypothesis for each
statement
a. A researcher thinks that if expectant mothers use vitamin
pills, the birth weight of the babies will increase. The
average birth weight of the population is
8.6 pounds.
b. There is a belief that 10% of the smokers develop
lung cancer in country Ethiopia.
c. A psychologist feels that playing soft music during a
test will change the results of the test. The psychologist
is not sure whether the grades will be higher or lower.
In the past, the mean of the scores was 73
d. Researchers are interested in the mean level of some
enzyme in a certain population. They want to know
whether they can conclude that the mean enzyme
level in this population is different from 25. 88
Soluti
on
a. H0: μ = 8.6 vs H 1: μ
> 8.6
b. H0: P= 0.1 vs H1: P
ǂ 0.1
c. H0: μ= 73 vs H1: μ
ǂ 73

9
Hypothesis testing
cot… α
Level of significance
• A method for making a decision must be agreed upon.

• If HO is rejected, then H1 is accepted.

• A null hypothesis is either true or false, and it is either rejected


or not rejected.

• Decision rule: The decision rule tells us to reject the null


hypothesis if the value of the test statistic in the rejection region
and not to reject the null hypothesis if the test statistic is one of
the values in the non rejection region.
10
Types of Errors in
Whenever we reject or accept the Ho, we commit
Hypothesis Tests

errors.
Two types of errors are committed.
 Type I Error
 Type II Error

02/08/2025 [email protected]
Type I Error
The error committed when a true Ho is rejected
The probability of a type I error is the probability of
rejecting the Ho when it is true-
The probability of type I error is α
 Called level of significance of the test
 Set by researcher in advance

02/08/2025 [email protected] 12
Type II Error
The error committed when a false Ho is not rejected
The probability of Type II Error is 

Power
The probability of rejecting the Ho when it is false.
Power = 1 – β = 1- probability of type II error
We would like to maintain low probability of a Type I error (α)
And low probability of a Type II error (β) [high power = 1 - β].

02/08/2025 [email protected] 13
Action Reality
(Conclusion)
Ho True Ho False

Do not Correct action Type II error (β)


reject Ho (Prob. = 1-α) (Prob. = β= 1-Power)

Reject Ho Type I error (α) Correct action


(Prob. = α = Sign. level) (Prob. = Power = 1-β)

02/08/2025 [email protected] 14
Type I & II Error
Relationship

02/08/2025 [email protected] 15
Hypothesis testing for Population Mean

• For the given null hypothesis, H0: μ = μ0


• we could have three different alternative
hypothesis.

• These are:

Two tail test

One tail test

16
1
4
Hypothesis testing for single
population
Steps in hypothesismean
testing
1. state the null hypothesis: H0: μ = μ0
2. state the alternative hypothesis:H1:μ≠μ0
3. fix the level of significance(α) and compute the test
statistics as:

NB: this is not the only test statistics. depending on the type of
data and sample size, we may need to compute z-score, t-test or
x2- test

17
Steps in hypothesis
testing
• For large samples (n≥30) and σ2 is known, the test
statistic has standard normally distribution, Z- test
• For small sample (n<30) and if the true variance (σ2)
is unknown. the test statistic is distributed as a
student t-distribution with n-1 degrees of freedom.
• If the interest is to check the presence or absence of
association then x2 score distribution will be used
18
Steps in hypothesis
testing
4.Find cot..corresponds to the given
the critical values:
alpha (α) from the distribution table.
5.Decision rule: For the hypothesis which is two
tailed, the decision is defined by:
• Reject the null Hypothesis if:

• Do not reject the null hypothesis if:

19
Exam
ple
• We suspect that the average fasting blood sugar level of urban
residents in Ethiopia is 108 with a standard deviation of 10. A
random sample of 225 clinic patients (all urban) yields a mean
blood sugar level of 119. Test whether the hypothesis true or not at
0.05 level of significant. Follow the steps and give your
conclusion.

Solution: Given
•Mean(μ) =108, n = 225, sample mean = 119 and σ = 10 Test
procedure
1. Null hypothesis H0: μ=108
20
20
Example
cot…

21
21
Exampl
es

22
Example
3. Find the critical values 𝑡 =𝑡 =
cot… 𝛼 0.05
,𝑛−1 ,9
2.26
2 2
4. Decision: reject the null
𝑡 𝑐𝑎𝑙 >
hypothesis if: other wise we do not reject
hypothesis, therefore
the null 2.46 > 2.26, so we reject the
𝑡 𝑡𝑎𝑏
null
hypothesis

5. Conclusion: based on the given data set and 95%


level of significance the average days of infection
in the hospital is not 16.3.

23
Test procedures for one
tailed
• Test procedure fortestone tailed test is similar with that of the two
tailed test except at some steps.
1. State the null hypothesis Ho: μ = μo
2. State the alternative hypothesis: H1: μ < μo or H1: μ > μo.
The choice of the two type depends on the problem
situation.

• If we are interested to check whether the true parameter is less


than the hypothesized value, then we will choose
• H1: μ < μo as our alternative.
• However, if the interest is to check whether the true parameter
is greater than the hypothesized value, then H1: μ > μo will
be chosen as the alternative.

24
Test procedures for one
tailed test…
• Fix the level significance (α) and compute the test statistic: this step is the
same with that of two tailed test. In addition, the choice of the test statistic is
also the same. That is the test statistics for one test is defined as:

• Find the critical values: in the tails of distribution, the test


statistic that given for the 95% distribution. The critical value can
be obtained from the distribution table of the test statistic.

–Hence the critical value is the value of Z at level of


significance α = 0.05.
25
Test procedures for one
tailed
• If the test..
alternative hypothesis is H : μ < μ , then the critical value is given by z
1 o tab
= -zα, while
• If the alternative hypothesis is H1: μ > μo, then the critical
value is given by ztab = zα.
• Decision rule: as the alternative hypothesis is one tailed, the followings are the
rules:
• If the alternative hypothesis is H1: μ < μo, then the decision
should be:

𝑍𝑐𝑎𝑙 = 𝑠.𝑥−𝜇0 < −𝑍𝛼 other wise do not reject the null
– Reject the null hypothesis if:

if 𝑒
hypothesis


:

𝑍𝑐𝑎 >
0
−𝑠. 𝜇
=𝑙 −𝑍
𝑒


26
Test procedures for one
tailed test..hypothesis is H : μ > μ
• If the alternative 1 o,
then the decision will be;
• Reject the null hypothesis if:

�𝑐 𝑎 𝑙= 𝑥̅x − 𝜇𝑜 >
𝛼
𝑠.
• Other wise do� 𝑒 the null
𝑍
not reject
hypothesis if:

�𝑐 𝑎 = 𝑥̅x − 𝜇𝑜
𝑙
𝑠.
𝑒

� �

< 𝑍

27
Exam
ple
• Certain brand of cigarettes is advertised by manufacturer as
having mean nicotine content of 15 mg/cigarette. A
sample of 200 cigarettes is tested by lab and found to have
average of 16.2 mg of nicotine with known SD = 3.6. Using a
0.01 level of significance, can we conclude that actual mean
nicotine content of this brand is greater than 15 mg?

28
H 0 :   1 5; H 1 :   15 0 
15

X  0 
16.2  1 5

Z   .255
n
4.71
 2.33
Z 1-0.01  - Z 0.01

4.71  2.33  C o n c l u d e at 1 % level that m e a n


nicotine level in this b r a n d is greater than 15.

29
Exampl
e 1to assume that systolic blood pressures
• A research team is willing
in a certain population of males are approximately normally
distributed with a standard deviation of 16. A simple random
sample of 64 males from the population had a mean systolic
blood pressure reading of 133. At the 0.05 level of significance,
do these data provide sufficient evidence for us to conclude that
the population mean is greater than 130?
• Solution:
1. State null and alternative hypothesis
Ho: μ= 130 vs H1: μ >130
2. Find the test statistic: 𝑍𝑐𝑎𝑙 = 𝑥̅−𝜇0
= 133−130
2
=
= 1.5
3 𝜎2 16 2
6
𝑛 4

30
Example 1
the cont.… 𝑍𝛼 = 𝑍0.05 =
1.645
3. Find critical/tabulated values

𝑍𝑐𝑎𝑙 > 𝑍𝛼 but 1.5 < 1.645, therefore, failed to


4.decision: reject the null hypothesis if:

reject/accept the null hypothesis

5.Conclusion: based on the given data set and 95%


level of confidence we have enough evidence to
accept the null hypothesis which implies that the
systolic blood pressure of males is not greater than
130.

31
Exampl
e 2of a sample of 25 records of
• A study was made
patients seen at a chronic disease hospital on an
outpatient basis. The mean number of outpatient
visits per patient was 4.8, and the sample
standard deviation was 2. Can it be concluded
from these data that the population mean is less
than four visits per patient? Let the probability of
committing a type I error be 0.05.
• Solution
1. State null and alternative
hypothesis H0: μ = 4 vs H1: μ <
4
2.Find the test statistic because population
standard deviation is unknown in this case we
use t-distribution 32
Example 2
•𝑡 𝑥̅ −𝜇0 4.8−4
cot… 0.8
𝑐𝑎𝑙 = = =
0.
𝑠2 22
4
𝑛 25
= 2
3. Then find the tabulated values from the t-
distribution i.e.

𝑡 𝛼,𝑛−1 = 𝑡0.05,24 =1.711


𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝑡 𝑐𝑎𝑙 <
4. 𝑛𝑜𝑡 𝑡ℎ𝑒 𝑟𝑒𝑗𝑒𝑐𝑡
Decision:
𝑤𝑒 𝑑𝑜 𝑡ℎ𝑒 𝑛𝑢𝑙𝑙 ℎ𝑦𝑝𝑜𝑡ℎ𝑒𝑠𝑖𝑠
reject the null hypothesis if: since
in this case 2
−𝑡𝛼,𝑛−1
≻ −1.711, so failed to reject the null
hypothesis
Conclusion: the mean number of visits per
5.
patient is not less than 4 visits per patient at
95% level of significance.
33
Exerci
se
• Nine laboratory animals were infected with a certain
bacterium and then immunosuppressed. The mean
number of organisms later recovered from tissue
specimens was 6.5 (coded data) with a standard
deviation of 0.6. Can one conclude from these data that
the population mean is greater than 6? Let =0.05. What
assumptions are necessary?

34
Exerci
se
• A study examined a sample of 16 subjects with open-
angle glaucoma and unilateral hemifield defects. The
ages (years) of the subjects were:
• 62 62 68 48 51 60 51 57 57 41 62 50 53 34 62 61

Can we conclude that the mean age of the population from


which the sample may be presumed to have been drawn is less
than 60 years? Let 𝛼 = 0.05

35
Proportions
• Involves categorical variables
• Fraction or % of population in a category
• If two categorical outcomes, binomial distribution
• Either possesses or doesn’t possess the
characteristic
• Sample proportion (ps)

ps X n u m be r o f
 
s u cce s s e s n sample
size
36
Hypothesis testing for single population
proportions
• A hypothesis test involving a population proportion
can be considered as a binomial experiment when
there are only two outcomes
State the hypothesis
• State the null hypothesis, Ho: P = Po vs H1: P ≠ Po

Ho: P = Po vs

H1: P > Po Ho: P = Po


vs

H1: P < Po 37
H.T for single
population
• Find cot…
the critical value and compute

•𝑍
the test statistics
𝑝−𝑝

=
0𝑃 (1−
𝑃 )𝑛

= 𝑍 𝛼 other wise we do not reject the


• Decision: reject the null hypothesis if:

• 𝑍𝑐𝑎𝑙 > 2

𝑍 𝑡𝑎𝑏
null hypothesis

38
Exam
ple abuse in psychiatry
• In the study of childhood
patients, a researcher found that 166 in a sample
of 947 patients reported histories of physical or
sexual abuse. Test the hypothesis that the true
population proportion is 30%?, use α = 0.05
Solution
Po=0.3
To test the hypothesis we need to follow the steps
Step 1: State the hypothesis
• Ho: P= 0.3 vs H1: P ≠ 0.3
Step 2: Fix the level of significant
(α=0.05)
Step 3: Compute the calculated and tabulated
value of the test statistic 39
Example
•𝑍𝑐𝑎𝑙 =
𝑝−𝑝cot…
0
0.175−0.3
=
𝑝(1−𝑝)
0.175(1−0.175)
𝑛
947
−0.143
=0.01233 =
−11.60of the calculated and
•Decision: Comparison
tabulated

> 𝑍𝛼 = −11.60 >


values of the test statistic
𝑍𝑐
1.962
= 11.6 > 1.96
𝑎𝑙
So reject the null hypothesis
• Hence we concluded that the proportion of
childhood abuse in psychiatry patients is 40
different from 0.3
Exercis
e1
• A survey conducted to study the dental health
practices and attitudes of certain adult
population. Of the 300 adults interviewed, 123
said that they regularly had a dental check-up
twice a year. Can we conclude that the
population proportion, Po=0.5?

41
Exercis
e2
• In a sample of 150 hospital emergency
admissions with a certain diagnosis, 128 listed
vomiting as a presenting symptom. Do these
data provide sufficient evidence to indicate, at
the 0.01 level of significance, that the
population proportion is less than 0.92?

42
P-
value
• Probability of Obtaining a Test Statistic More Extreme (£ or
) than Actual Sample Value Given H0 Is True
• The P-value (or probability value) is the
probability of getting a sample statistic (such as
the mean) or a more extreme sample statistic in
the direction of the alternative hypothesis when
the null hypothesis is true.

• If the p-value < α-value, then we say the


difference is significant and hence reject the
null hypothesis of no difference.

• While if p-value > α-value, then the difference


is not significant and hence do not reject the
null hypothesis. 43
Chi-squared
The Chi-squared test measures the disparity between
test

observed frequencies (data from the sample) and


expected frequencies.
Helps to check association between categorical
variables.
The Chi-squared test is valid
 If no observed cell is 0
 And no 20% of expected cell is less than 5

02/08/2025 [email protected] 44
Chi-square test (x2)…
Chi square test is used for nominal or ordinal
explanatory and response variables
Variables can have any number of distinct levels
If the two variables have two level each, the resulting
contingency table will be 2X2
Variable 1
Variable 2 Diseased Not diseased N ( ad  bc ) 2
 2
cal 
( a  c )( b  d )( a  b )( c  d )
Exposed A B A+B

Not exposed C D C+D


A+C B+D N

02/08/2025 [email protected] 45
Chi-square test (x2)
Hypothesis testing steps in chi square test

1. State Hypotheses:
 Null hypothesis (Ho): The classification variables are independent

 Alternative hypothesis (Ha): There is relationship between the variables

2. Compute test statistic: Get calculated 2 value


3. Determine critical values: Find the table value of 2 at a given df
4. Decision: Reject H0 if calculated 2 > critical value of 2 from the table.

02/08/2025 [email protected] 46
Example 1

Consider the following 2X2 table. Is there association between wearing Helmet and head injury??
Use 95% confidence level.
Head injury Wearing helmet
Yes No Total
Yes 17 218 235

No 130 428 558

Total 147 646 793

02/08/2025 [email protected] 47
Example 1…

Step 1: hypothesis

 HO : There is no association between wearing


helmet and head injury
HA : There is an association between wearing helmet

and head injury


 Step 2: Test statistics
χ2 = __N (ad-bc)2__= (17*428-218*130)2*793= 28.26
 nD nND nE nNE 235*559*147*646
Step 3: critical value χ2 = 3.84
Step 4: Decision reject the null hypothesis
02/08/2025 [email protected] 48
Example 2
A sample of 263 students who bought lunch at a
school canteen were asked whether or not they
developed gastroenteritis. The response is given
below Gastroenteritis
Yes No Total
Ate sandwich
Yes 109 116 225

No 4 34 38

Total 113 150 263

02/08/2025 [email protected] 49
Example 2…
Step 1: hypothesis
HO : There is no association between eating sandwich and

gastroenteritis
Ha : There is an association between eating sandwich and

gastroenteritis
Step 2. Test statistics χ2 = 17.6
Step 3: Critical value of χ21(0.05)= 3.84
Step 4: decision: since 17.6>3.84 then reject the null
hypothesis and decide as there is association between eating
sandwich and gastrointestinal pain
02/08/2025 [email protected] 50
THE END OF THE COURSE

THANKS!!!

HAVE A NICE TIME!!!

02/08/2025 [email protected]

You might also like