0% found this document useful (0 votes)
8 views47 pages

Hypothesis Testing in Public Health

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

Hypothesis Testing in Public Health

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

College of Health Sciences

Department of Public Health

Hypothesis Testing
By: Aysheshim B. (BSc. in PH, MPH in Biostatistics)

May, 2023
Debre Markos University, Ethiopia
1
Hypothesis testing
• A statistical hypothesis is an assumption or a statement which
may or may not be true concerning one or more population.

• Setting up and testing hypotheses is an essential part of statistical


inference.

• Examples of statistical hypothesis:


– The mean pulse rate among DMU students is 72bt/min.
– The prevalence of HIV in DM is 12%.
– The prevalence of Hypertension in US and British is the same.
– The mean blood cholesterol level is the same before and after
taking a drug.

2
Steps in hypothesis testing
Hypothesis testing involves the following steps:
1. Choose the hypothesis to be tested
2. Choose an alternative hypothesis which would be accepted if
the first hypothesis is rejected.
3. Decide on the appropriate test statistic for the hypothesis (Z, t,
X2)
4. Decide the level of significance and corresponding critical
value.
5. Obtain the value of the test statistic.
6. Make a decision and interpret it.

3
The null and alternative hypothesis

• In hypothesis testing two hypotheses are involved: The null


hypothesis and the alternative hypothesis.

• They are mutually exclusive and complementary events.

• Both hypotheses are about the parameter not about the statistic.

 The null hypothesis (H0 or H N):

– The first hypothesis to be set by the researcher.

– It commonly implies the meaning of “equals to”, “no effect”


or “no difference”, “no association” conclusions.

4
Hypothesis Cont.

Example;

• The mean pulse rate among DMU-M students is 72bt/min.

• Drug A has no effect on the blood glucose level of diabetic


patients.

• There is no difference in the prevalence of malaria in region A


and region B.

• There is no association between smoking and lung cancer.

5
Hypothesis Cont.

 The alternative hypothesis (HA or H1)

– The hypothesis that will be accepted if H0 is rejected.

– Implies conclusions like “is not equal”, “has effect”, “there is


difference” and “there is association”.

Example:
• The mean pulse rate among DMU-M students is not equal to
72/min.
• Drug A has effect on the blood glucose level of diabetic patients.
• There is difference in the prevalence of malaria in region A and
B.
• There is association between smoking and lung cancer.
6
Errors in hypothesis testing
• In testing hypothesis, two types of errors can be committed:
Type I and Type II errors.
Decision of the
hypothesis testing
Accept H0 Reject H0
Null H0 True Correct Type I error
Hypothesis H0 False Type II error Correct
• The probability of committing type I error is denoted as α. It is
also called the Level of significance. (1- confidence level)
• The probability of committing type two error is denoted as β. (1-
power of the study)

7
One and two tailed hypothesis

• Some hypotheses test whether one value is different


from another or not, without additionally predicting which
will be higher: Non-directional or two-tailed test

• At times some hypotheses not only test difference of one


value from the other but also direction of the difference.
i.e. it would be lower or higher: Directional or one-tailed
test.

8
Critical value
• In practice, the level of significance (α) is chosen arbitrarily.
• Three levels 0.01, 0.05, or 0.10. (depending on confidence level)
• The smaller the level of significance, the stronger the hypothesis test.
• The level of significance determines the values of the test statistic that
would cause us to reject the hypothesis.
• The corresponding test statistic values for the level of significance are
called the Critical Values.
• In a probability distribution the area which is left to the extreme right
or/and left of the critical value is called the Critical area (Rejection
area).
• The area between the two critical values is called the Acceptance Area.

9
Critical value cont.

10
Critical value cont.

• A level of significance has different critical values for one


and two tailed test,

• Level of significance of 0.05 has critical value of ±1.96 if


the test is two tailed.

• However if the test is one tailed the critical value would


be 1.64 to either of the tails.

• Note that critical values for a given level of significance


differ depending on the test statistic intended to be used.

11
Critical value cont.

α (level of Two tailed One tailed One tailed


significance) test test, < test, >
0.10 ±1.64 -1.28 1.28
0.05 ±1.96 -1.64 1.64
0.01 ±2.58 -2.33 2.33
12
Test statistic
• In hypothesis testing we accept or reject the hypothesis
through calculating the probability of getting the estimated
sample value (or more extreme values) given the
hypothesized population value is true.

• If the probability is very low we will reject the null hypothesis.

• The probability is calculated using test statistic (z, t, …)

• The general formula to calculate test statistic is:

(estimate)  (hypothesized value)


test statistic 
SE

13
Test statistic cont.
• The use of z-test statistic requires a knowledge of the
variance of the population from which the sample is taken.

• In statistics as long as sample size is large enough, most


datasets can be explained by standard normal distribution.

• But when the sample size is small and population SD is not


known, statisticians rely on the distribution of the t-test statistic.

14
Interpretation and Conclusion
• Decision is made based on comparisons between:

1. Test statistic calculated versus critical value.

• Reject the null hypothesis if test statistic calculated is greater than


|critical value|.

• Accept the null hypothesis if test statistic calculated is less than


|critical value|.

2. P-value versus significance level.

• Reject the null hypothesis if P < α.

• Accept the null hypothesis if P≥α

 P-value is the probability of getting a sample statistic at least as extreme as


the calculated statistic if the null hypothesis is true.

• Conclusion (i.e. accepting or rejecting the null hypothesis) should be made


at the given level of confidence. 15
Hypothesis testing about a single population mean
(normally distributed)

• Shows how to test the null hypothesis that the population


mean is equal to some hypothesized value.

• One begins with a statement that claims a particular value


for the unknown population mean.

• The hypothesis testing for single population mean either


accepts or rejects this statement.

16
a) Known variance

• The test statistic is:

17
Example

Researchers are interested in the mean level of an enzyme


in a certain population. They took a sample of 36
individuals, and computed a sample mean = 22. The
variable of interest is approximately normally distributed
with a standard deviation of 10. From this scenario: Can
we conclude that the mean enzyme level in this
population is less than 25?

18
Solution:

• Step 1 and 2: Define the H0 and H1:

H o :   25

H 1 :   25

• Step 3: Decide approprate test statistic:


– Z test

19
• Step 4: Decide the level of significance and critical
value:
– α value of 0.05.
– -1.645 is the critical value.

• Step 5: Obtain the value of the test statistic:


X  22  25 3
Z Z Z Z   1.80
/ n 10 / 36 1.67

• Step 6: Make a decision and interpret it.


– Reject the H0 with 95% confidence level
– Test statistic -1.80 is with in the rejection region.
– P value of 0.036 is less than the α value of 0.05.

20
b) Unknown variance

• If the population variance is unknown and sample size is


small t-statistic is the appropriate one

21
Example

• Serum Amylase level determination was made on a


sample of 15 apparently health subjects. The
sample yielded the mean of 96 units/100 ml and a
standard deviation of 35 units /100 ml. The variance
of the population was unknown. We want to know
wheter we can conclude that the mean of the
population is different from 120 units/100 ml.

22
• Step 1 and 2: Define the H0 and H1.
H o :   120 H 1 :   120
• Step 3: Decide approprate test statistic.
– t test
• Step 4: Decide level of significance and critical value.
– α value of 0.05.
– t value for α of 0.0025 at df of 14: ±2.145
• Step 5: Obtain the value of the test statistic.
X  96  120
t t t   2.65
S/ n 35 / 15

23
• Step 6: Make a decision and interpret it.

• We reject the null hypothesis b/c

– The cal test statistic -2.65 is in the rejection area

– The corrspoinding P value of -2.65 (b/n 0.01 and


0.005) is less than the α/2 value of 0.025.

24
2) Hypothesis testing about the difference
between two population means
(normally distributed)
i) Known variance (2 independent samples)
• Example: In a large hospital for the treatment of mentally
retarded, a sample of 12 individuals with mongolism
yielded a mean serum uric acid value of =4.5 mg/100 ml.
In a general hospital a sample of 15 normal of the same
age and sex were found to have a mean value of =3.4. If
it is reasonable to assume that the two populations of
values are normally distributed with variance equal to 1,
do these data provide sufficient evidence to indicate a
difference in mean serum uric acid levels between
normal individuals and individuals with mongolism?

25
Solution

• H0: μ1 = μ2 H1: μ1 ≠ μ2
• 𝑥1 = 4.5 𝑥2 = 3.4
• n1 = 12 n2 = 15
• σ1 = 1 σ2 = 1
• Z ‐ test is the appropriate one

26
Let significance level (alpha) is 5%

27
4.5−3.4)−0
Z= = 2.82
1 1
+
12 15

Since 2.82 > 1.96 reject the null hypothesis, i.e.,


there is an indication that the means are not equal.

28
ii) Unknown variances

a) Equal variances (2 independent samples)


• Example: Serum amylase determinations were made
on a sample of 15 apparently healthy subjects and 22
hospitalized subjects. Suppose the samples yielded
• 𝑥1 = 96 units/100 ml 𝑥2 = 120 units/100 ml
• S1 = 35 units/100 ml S2 = 40 units/100 ml
• The populations are approximately normally distributed.
Would we be justified in concluding that the population
means are different.

29
Solution
(x1 − x2 ) − (μ1 − μ2 )
t=
• H0: μ1 = μ2 Sp2 Sp2
+
n1 n2
• H1: μ1 ≠ μ2
• t‐test is the appropriate one,
(𝑛1 −1)𝑆12 + (𝑛2 −1)𝑆22
with d.f. = n1 + n2 ‐ 2. 𝑆𝑝 =
𝑛1 + 𝑛2 − 2
• α = 0 05 ⇒ t0.025,35 = 2.0301

30
14∗352 +21∗402
𝑆𝑝 = =38.1
15+22−2

(96−120)−0
t= = -1.88
(38.1)2 (38.1)2
+
15 22

• Since ‐1.88 falls in the acceptance region, we accept the


null hypothesis. On the basis of these data we can not
conclude that, the two population means are different.

31
b) Unequal variances (2 independent samples)

x1 −x2 )−(μ1 −μ2 )


• The test statistic is t=
S2 S2
1+ 2
n1 n2

with degree of freedom

32
c) Paired sample

• Every observation in one sample has one matching


observation in the second sample.
• Commonly used in evaluation of interventions like new
treatment modalities.
• Hence pre and post intervention (treatment) results are
compared.
• Usually t test is used since individuals involved in the
trial are few.
• The null hypothesis: there is no significant difference
between the two tests.

33
• Procedures of hypothesis testing are the same. Except
the formula for the test statistic calculation.

d
t
SD
n
– d = mean of differences between the two samples.
– SD = is the standard deviation for the differences
between the two samples.
– n = the number of paired cases.
• Note that the calculated test statistic is compared at
degree of freedom of n-1.

34
Example

• A random sample of 10 young men was taken and the


pulse rate was measured before and after taking a cup
of coffee. The result is given as follows. Does the coffee
has any effect on the heart rate? (perform the hypothesis
testing with 95% CI)

35
Subject PR before PR after Difference
1 68 74 +6
2 64 68 +4
3 52 60 +8
4 76 72 -4
5 78 76 -2
6 62 68 +6
7 66 72 +6
8 76 76 0
9 78 80 +2
10 60 64 +4
Mean 68 71 +3
36
• Step 1 and 2: Define the H0 and H1.
• H0: Coffee intake has no effect on PR
• H1: Coffee intake has effect on PR
• Step 3: Decide approprate test statistic.
– t test (paired)
• Step 4: Decide level of significance and critical value.
– α value of 0.05.
– t value for α of 0.0025 at df of 9: ±2.262
• Step 5: Obtain the value of the test statistic.
– First calculate the SD then the test statistic:

 (di  d ) 2

 3.92 t
3.92
3
 2 .4
n 1 10
37
• Step 6: Make a decision and interpret it.

• We reject the null hypothesis (at 95% confidence level)


b/c

– The cal test statistic 2.4 is in the rejection area

– The corrspoinding P value of 2.4 is less than the α/2


value of 0.025.

• Coffee intake has effect on PR.

38
3) hypothesis testing about a single population
proportion
• The null hypothesis that the population proportion is
equal to some hypothesized value.

• One begins with a statement that claims a particular


value for the unknown population proportion.

• The hypothesis testing for single population proportion


either accepts or rejects this statement.

• Here Z test statistic is used. The formula is given as:


p 
Z
 (1   )
n

39
Population proportion cont.
Example: A survey was conducted to determine the prevalence
of protein energy malnutrition(PEM) in a rural kebele. Of 300
under five children assessed, 123 were stunted. Can we
conclude that the prevalence of PEM in the population is
50%?
• Step 1 and 2: Define the H0 and H1
H o :   0. 5 H 1 :   0 .5
• Step 3: Approprate test statistic:
Z statistic
• Step 4: Decide the level of significance and the
corresponding critical value:
– Let’s take α value of 0.1. Hence ±1.645 is the critical value.
40
Population proportion cont.
• Step 5: Obtain the value of the test statistic:
p  0.41  0.5 0.09
Z     3.11
 (1   ) 0.5(0.5) 0.25
n 300 300

• Step 6: Make a decision and interpret it.


• At 90% confidence level we reject the null hypothesis
that π=0.5.
– The calculated test statistic -3.11 is in the rejection
region.
– The corrspoinding P value of -3.11 (i.e. 0.0009) is less
than the α value of 0.05.
41
4) Hypothesis testing about the difference
between two population proportions
• The null hypothesis that a population proportion is equal
to another population proportion.
• Here Z test statistic is used. The formula is given as:
p1  p 2
Z
1 1 
P(1  p)  
 n1 n2 
• We use a pooled sample estimate(P) for the common
hypothesized proportion, which is a weighted average of
the sample proportions, with the sample size as weights.

n1 p1  n2 p 2
P
n1  n2

42
Example

• The prevalence of malaria among two malaria endemic


kebeles X and Y was compared. In kebele X among 120
samples 15 were positive. In kebele B among 100
samples 20 were positive. Is there any significant
difference between the prevalence of malaria kebele X
and Y?

43
• Step 1 and 2: Define the H0 and H1:
H o : P1  P2 H1 : P1  P2
• Step 3: Decide approprate test statistic:
– Z statistic
• Step 4: Decide α value & the critical value:
– Let’s take α value of 0.05. Hence ±1.96 is the critical
value.
• Step 5: Obtain the value of the test statistic:
– First calculate the proportions & the pooled proportion
– P1 = 15/120 = 0.125, P2 = 20/100 = 0.2

44
n1 p1  n2 p 2 120(0.125)  100(0.2) 15  20
P P P  0.159
n1  n2 120  100 220

• Then we calculate the test statistic:


0.125  0.2
Z
 1 1   0.075
0.159(1  0.159)   Z  1.51
 120 100  0.13370.0183
• Step 6: Make a decision and interpret it.
At 95% confidence level we accept the H0 P1=P2 b/c:
– -1.51 is in the acceptance region.
– - 0.0655 is greater than the α/2 value of 0.025.

45
Summary
• The interpretation of the hypothesis test is dependent on the
confidence level at which the test is conducted.

• A hypothesis which is accepted at a lower level of confidence


can not be rejected at a higher level of confidence.

• A hypothesis which is rejected at a lower level of confidence


can be accepted at a higher level of confidence.

• A hypothesis which is rejected at a higher level of confidence


can not be accepted at a lower level of confidence.

• A hypothesis which is accepted at a higher level of confidence


can be rejected at lower level of confidence.
46
I Thank You ALL!

47

You might also like