HT For PHO
HT For PHO
5/22/2023 Zenebe A. 2
HYPOTHESIS TESTING
Hypothesis is a testable statement that describes the nature
of the proposed relationship between two or more variables
of interest.
5/22/2023 Zenebe A. 4
Type of Hypotheses
• Null hypothesis (represented by HO) is the statement about the value of the
population parameter. That is the null hypothesis postulates that ‘there is no
difference between factor and outcome’ or ‘there is no an intervention effect’.
• Alternative hypothesis (represented by HA) states the ‘opposing’ view that
‘there is a difference between factor and outcome’ or ‘there is an intervention
effect’.
5/22/2023 Zenebe A. 5
Methods of hypothesis testing
• Hypotheses concerning about parameters which may or may
not be true
• Examples
5/22/2023 Zenebe A. 6
Steps in hypothesis testing
3. Select the test statistic and 4. Compare the observed value of the
determine its value from the statistic to the critical value obtained for
sample data. This value is called the chosen a.
the observed value of the test
statistic. Remember that t
statistic is usually appropriate
for a small number of samples; 5
for larger number of samples, a Make a decision.
z statistic can work well if data 6
are normally distributed. Conclusion
5/22/2023 Zenebe A. 7
Test Statistics
Because of random variation, even an unbiased sample may not accurately
represent the population as a whole.
Observed _ Hypothesized
Standard error
5/22/2023 Zenebe A. 9
Decision making in hypothesis test
• Accept or Reject the null hypothesis
• There are 2 types of errors
Type of
H0 true H0 false
decision
Correct decision (1-
Reject H0 Type I error (a)
β)
H0: m = m0 a/2
H1: m m0
0
Two tailed test
5/22/2023 Zenebe A. 14
• Hypothesis test for different scenarios
5/22/2023 Zenebe A. 15
1. Hypothesis testing about a Population mean
(μ)
Two Tailed Test:
The large sample (n > = 30) test of hypothesis about a population
mean μ is as follows
1 H 0 : m = m 0 ( = 0 )
H A : m1 m 0 ( 0 )
x m0
zcal =
n
ztabulated = z a for two tailed test
2
5/22/2023 Zenebe A. 21
P-value and confidence interval
• Confidence intervals and p-values are based upon the same
theory and mathematics and will lead to the same conclusion
about whether a population difference exists.
5/22/2023 Zenebe A. 22
The P- Value …..
• But for what values of p-value should we reject the null
hypothesis?
• When the p-value is less than to 0.05, we often say that the
result is statistically significant.
5/22/2023 Zenebe A. 23
Hypothesis testing for single population mean…..
5/22/2023 Zenebe A. 24
Example: 2
Suppose that we have a population mean 3.1 and n=20
people x = 4.5 and s = 5.5 found and , our test statistic is
1. Ho: m = 3.1
HA: m 3.1
2. α = 0.5 at 95% CI t 0.05,19 = 2.09
3. x m 4.5 3.1
t= = = 1.14
s 5 .5
n 20
4. the observed value of the test statistic falls with in the range
of the critical values
5. we accept Ho and conclude that there is no enough
evidence to reject the null hypothesis.
5/22/2023 Zenebe A. 25
Hypothesis testing for single proportions
Example : In the study of childhood abuse in psychiatry patients, brown
found that 166 in a sample of 947 patients reported histories of physical or sexual
abuse.
a) constructs 95% confidence interval
b) test the hypothesis that the true population proportion is 30%?
• Solution (a)
– The 95% CI for P is given by
p (1 p )
p za
2 n
0.175 0.825
0.175 1.96
947
0.175 1.96 0.0124
[0.151 ; 0.2]
5/22/2023 Zenebe A. 26
Example……
• To the hypothesis we need to follow the steps
Step 1: State the hypothesis
Ho: P=Po=0.3
Ha: P≠Po ≠0.3
Step 2: Fix the level of significant (α=0.05)
Step 3: Compute the calculated and tabulated value of the test statistic
p Po 0.175 0.3 0.125
zcal = = = = 8.39
p (1 p ) 0.3(0.7) 0.0149
n 947
ztab = 1.96
5/22/2023 Zenebe A. 27
Example……
• Step 4: Comparison of the calculated and tabulated values
of the test statistic
• Step 6: Conclusion
• If the sample size is small (if np<5 and n(1-p)<5) then use
student‟s t- statistic for the tabulated value of the test
statistic.
5/22/2023 Zenebe A. 28
Statistical Inferences Based on Two Samples
Paired/matched/repeated sampling
5/22/2023 Zenebe A. 29
Case-1: Independent Samples, Variances Known
5/22/2023 Zenebe A. 30
Comparing Two Population Means;
Independent Samples, Vars Known cont’d…
12 22
x x =
1 2
n1 n2
5/22/2023 Zenebe A. 31
Comparing Two Population Means;
Ind’t Samples, Vars Known cont’d…
z =
x1 x2 D0
12 22
n1 n2
5/22/2023 Zenebe A. 32
Hypothesis testing for two sample means
• The steps to test the hypothesis for difference of means is the
same with the single mean
Step 1: state the hypothesis
Ho: µ1-µ2 =0
VS
HA: µ1-µ2 ≠0, HA: µ1-µ2 <0, HA: µ1-µ2 >0
Step 2: Significance level (α)
Step 3: Test statistic
( x y ) ( m1 m 2 )
zcal =
12 22
n1 n2
5/22/2023 Zenebe A. 33
Hypothesis …
ztabulated = z a for two tailed test
2
H O : m1 m 2 = 0
5/22/2023 Zenebe A.
H A : m1 m 2 0 35
SOLUTION
( x y ) ( m1 m 2 ) ( 4 .5 3 .4 ) 0
z cal = =
2
2
2 .9 2 3 .5 2
1
2
n1 n2 12 15
1 .6 1 .1
= = = 0.90
1.5178 1.23
z a = z 0.025 = 1.96
2
5/22/2023 Zenebe A. 36
case-2: Independent Samples, Variances Unknown
5/22/2023 Zenebe A. 37
Comparing Two Population Means;
Ind’t Samples, Vars Unknown cont’d…
s 2p =
n1 1s12 n2 1s22
n1 n 2 2
z =
x1 x2 D0
1 1 where Do = (µ1 – µ2)o
s 2p
n
1 n2
5/22/2023 Zenebe A. 39
Comparing Two Population Means;
Ind’t Samples, Vars Unknown cont’d…
t =
x1 x2 D0
1 1
s
n n
2
p
1 2
5/22/2023 Zenebe A. 40
Comparing Two Population Means;
Ind’t Samples, Vars Unknown cont’d…
z =
x1 x2 D0
s12 s 22
n1 n2
x1 x2 D0 df =
s 2
1 /n1 s /n2
2
2
2
t =
s12
s22 s
2
1 /n1
2
s /n2 2
2
2
n1 1 n 2 141
n1 n2
5/22/2023 Zenebe A.
Case-3: Paired/matched/repeated sampling
• Rises from two different processes on same study units (e.g.
"before” and “after” treatments) or two different processes on
paired/matched study units ( e.g. Pair matched case control
studies).
5/22/2023 Zenebe A. 42
Paired sampling cont’d…
5/22/2023 Zenebe A. 43
Paired sampling cont’d…
5/22/2023 Zenebe A. 44
Paired sampling cont’d…
5/22/2023 Zenebe A. 45
Paired sampling cont’d…
5/22/2023 Zenebe A. 46
Hypothesis testing for two proportions
5/22/2023 Zenebe A. 47
Hypothesis testing for two proportions
( p1 p2 ) ( 1 2 )
zcal =
p1 (1 p1 ) p2 (1 p2 )
n1 n2
5/22/2023 Zenebe A. 48
Small sample size
5/22/2023 Zenebe A. 49
Comparing Two Population Proportions cont’d…
5/22/2023 Zenebe A. 51
Chi-Square Test
• The Chi-squared test measures the disparity
between observed frequencies (data from the
sample) and expected frequencies (probability
distribution)
5/22/2023 Zenebe A. 52
The Chi-squared test (2-test with d.f. = (r-1)x(c-1))
nad bc
2
=
2
for 2 x 2 table
(a c)(b d )(a b)(c d )
2 =
O
ij Eij
2
5/22/2023 Zenebe A. 53
Assumptions of the 2 - test
No expected value in the table is <1, and
5/22/2023 Zenebe A. 54
Assumptions…
If some numbers are too small,
• row or column variables categories can sometimes be
combined to make the expected frequencies larger or
use Yates correction,
• the Fisher‟s exact test should be used instead.
5/22/2023 Zenebe A. 56
Testing hypothesis
5/22/2023 Zenebe A. 57
Testing hypothesis ...
5/22/2023 Zenebe A. 58
Testing hypothesis ...
• Calculate p value (the p value is the actual
probability of obtaining a test statistic equal to or
greater than the calculated χ2).
5/22/2023 Zenebe A. 59
Characteristics of chi-square test
5/22/2023 Zenebe A. 60
• If the value of χ2 is zero, then there is a perfect
agreement between the observed and the expected
frequencies.
5/22/2023 Zenebe A. 61
Example…
• In an experiment with peas one observed 360 round
and yellow, 130 round and green, 118 wrinkled and
yellow and 32 wrinkled and green. According to the
Mendelian theory of heredity the numbers should be in
the ratio 9:3:3:1. Is there any evidence of difference
from the plants at 5% level of significance?
5/22/2023 Zenebe A. 62
Example…
5/22/2023 Zenebe A. 63
5/22/2023 Zenebe A. 64
Sample size determination…
• How Big is Big Enough?
• Generally the larger the better, but that takes more time and
money
5/22/2023 Zenebe A. 65
Sample size determination…
The prevalence/incidence of the problem
Number of predictors
• If too few sample size : It may fail to detect an important
effect
• Estimates of effect may be too imprecise (wide CI‟s)
• Both too small and too large sample may be unethical
5/22/2023 Zenebe A. 66
Sample size calculation for qualitative
studies
5/22/2023 Zenebe A. 67
Sample size determination for quantitative
study
• An adequate minimum sample size can be determined using:
• Thumb rule,
5/22/2023 Zenebe A. 68
Sample size determination…
5/22/2023 Zenebe A. 69
1. Rules of thumb approach
1. For smaller samples (N ‹ 100), there is little point in
sampling. Survey the entire population.
5/22/2023 Zenebe A. 71
Statistical approach: precision approach
5/22/2023 Zenebe A. 72
Precision approach (Single population)
• In proportion estimation, p can be obtained from:
• Previous studies
• Take 50%,
• Previous study, or
5/22/2023 Zenebe A. 73
Example
• Assume that a researcher wants to estimate
the prevalence of gestational DM among
pregnant women in Debre Birhan Town.
• According to previous studies the prevalence
of GDM was 32%. The researcher wants to
calculate his sample size at 95% level of
confidence.
• Based on the above information, what is the
minimum adequate sample size needed to
answer his research objective?
5/22/2023 Zenebe A. 74
Example…
• Assume you are interested in knowing the mean
systolic blood pressure among pregnant women
with danger signs of pregnancy admitted at
Hakim gizaw hospital. Based on previous studies
done, the SD was 25 mmHg and level of precision
of 5 mmHg of either side.
• The researcher wants to calculate his sample size
at 95 percent level of confidence.
• Based on the above information, what is the
minimum adequate sample size needed to
answer his research objective?
5/22/2023 Zenebe A. 75
Power approach analytic or two population approach
for proportion estimation
5/22/2023 Zenebe A. 76
Power approach…
• The inputs to calculate sample size are confidence level,
power, p1 , p2 , or measure of association (OR or RR)
• Two examples are the relative risk and the odds ratio
5/22/2023 Zenebe A. 77
Power approach …
• For means estimation
5/22/2023 Zenebe A. 79
Example
• A study is being planned to test whether a dietary
supplement for pregnant women will bring change to
the birth weight of babies.
• One group of women will receive the new supplement
and the other group which has a double size of the first
group will receive the usual nutritional consultation.
• From a pilot study, the standard deviation in birth
weight is estimated as 500g and is assumed to be the
same in both groups.
• The hypothesis of no difference is to be tested at 5%
level of significance. It is desired to have 80% power of
detecting an increase of 100g
5/22/2023 Zenebe A. 80
Solution
Thus sample of 294 and 588 will be taken from group one and two respectively
5/22/2023 Zenebe A. 81
Points to be considered
5/22/2023 Zenebe A. 82
Design effects
• The loss of effectiveness by the use of cluster sampling instead
of simple random sampling is design effect.
5/22/2023 Zenebe A. 83
Sample size calculation for survival
Where:
m= number of events
HR= exp (θ)
π = Fraction of subjects in the first group
With equal allocation (m1 = m2), then
5/22/2023 Zenebe A. 85
For comparative cross-sectional study
5/22/2023 Zenebe A. 86
For cohort study
5/22/2023 Zenebe A. 87
Reading assignment
• Sample size calculation for continuous
outcome comparative cross-sectional study??
• Sample size calculation for independent-t
test?
• Sample size calculation for chi-square test??
5/22/2023 Zenebe A. 88
5/22/2023 Zenebe A. 89