Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Concept of hypothesis testing

Kurnia Wahyudi

Department of Public Health


Faculty of Medicine Universitas Padjadjaran
2023 – 2024
Recommended reference

• Rosner, B. (2015). Fundamentals of biostatistics (8th ed.).


Boston, MA: Cengage Learning.
• White, S. E. (2020). Basic and clinical biostatistics (5th
ed.). New York: Lange/McGraw-Hill.

September 2, 2023 2
Statistical inference

• Estimation
• Estimating values of specific population parameters
• Method:
• Point estimation: mean, median, proportion
• Interval estimation: lower and upper limit
• Hypothesis testing
• Testing whether the value of population parameter is equal to
some value (one group)
• Testing whether there is a difference between population means
(two or more groups)
• Testing whether there is a difference between population
proportions (two groups)
• Testing whether there is a correlation between two variables

September 2, 2023 3
Example

September 2, 2023 4
Example

Research question:
Is the mean dietary energy intake of 2-year-olds
significantly different from the population value (based on
National Health and Nutrition Examination Survey III)?

September 2, 2023 5
Example

Result:
From sample, the observed mean dietary energy intake of
2-year-olds was 1242 kcal. From NHANES III, the reported
value was 1286 kcal.

Question:
• Could they conclude that there is a significant mean difference?
• What else is needed to conclude that there is a mean difference and
not just a random occurrence?

September 2, 2023 6
Concept of hypothesis testing

• Why is hypothesis testing so important?


• Provides an objective framework for making decisions using
probabilistic methods, rather than relying on subjective
impressions.
• Provides uniform and consistent decision-making criterion for
all people

September 2, 2023 7
Concept of hypothesis testing

If any of the following terms appear in the research


question, then a study is not simply descriptive  research
hypothesis should be formulated:
Greater than, less than, more likely than, associated with,
compared with, related to, correlated with, causes, and
leads to

September 2, 2023 8
Concept of hypothesis testing

• Steps in hypothesis testing:


1. Research question (chap 1)  research hypothesis (chap 2)
 statistical hypothesis
2. Select the appropriate test statistic
3. Select the level of significance () for the statistical test
4. Determine value of the test statistic must be attained to
declare significant result (critical value)
5. Perform the calculation
6. Drawing and stating the conclusion

September 2, 2023 9
Step 1

• H0 (null hypothesis)
• Example: there is no difference between assumed/hypothesized
value and the population mean
• 1 = 0 (using Greek letter;  for proportion,  for correlation
coefficient, etc.)
• The statistical test is performed whether we reject or do not
reject the H0

September 2, 2023 10
Step 1

• H1 or HA (alternative hypothesis)
• Example 1:
• There is a difference between assumed/hypothesized value and
the population mean
• 1  0 (two-sided or two-tailed)
• Example 2:
• The assumed/hypothesized value is larger or smaller that the
population mean
• 1 > 0 or 1 < 0 (one-sided or one-tailed)

September 2, 2023 11
Step 1

• A two-sided test is appropriate when the investigators do


not have an a priori expectation for the value in the
sample (conservative)
• A one-sided test is can be performed when the
investigators have an expectation for the value in the
sample, and they want to test only whether it is larger or
smaller than the mean of the population (has more
power or it is easier to reject H0)

September 2, 2023 12
Step 1

• It is important to decide which test is performed before


data collection begins or before data analysis
• In particular, do not change from a two-sided to a one-
sided test after looking at the data

September 2, 2023 13
Step 1

Research question:
Is the mean dietary energy intake of 2-year-olds
significantly different from the population value (based on
National Health and Nutrition Examination Survey III)?

H0?

H1?

September 2, 2023 14
Step 2

• Parametric methods
• Data come from some underlying distribution (normal, or
binomial), whose general form was assumed known
• Non-parametric methods
• Assumption about the shape of the distribution are not made
• And/or small sample size

September 2, 2023 15
Step 2

September 2, 2023 16
Step 3

Errors in hypothesis testing


Truth situation
No difference (H0) Difference exist (H1)
hypothesis testing

Do not reject H0 Correct Type II error or 


Conclusion from

Correct
Reject H0 Type I error or 
(Power or 1 - )

September 2, 2023 17
Step 3

• The probability of a type I error () is the probability of


rejecting the H0 when H0 is true
• Commonly referred to as the significance level of a statistical test
• The probability of a type II error () is the probability of
not rejecting the H0 when H1 is true
• Power of the test is defined as 1 -  or probability of rejecting H0
when H1 is true

September 2, 2023 18
Step 3

• The general aim in hypothesis testing is to use statistical


tests that make  and  as small as possible
• General strategy is to fix  at some specific level (0.1,
0.05, or 0.01, …) and to use the test that minimizes  or,
equivalently, maximized the power

September 2, 2023 19
Step 3

• Example:
• Efficacy of potentially dangerous medication  avoiding false-
positive  use a low 
• Reassuring the public that living near toxic waste dump is safe 
avoiding false-negative  use a low 

September 2, 2023 20
Step 4

September 2, 2023 21
Step 5

September 2, 2023 22
Step 6

• Critical value-method
• By applying the critical value approach it is determined, whether
or not the observed test statistic is more extreme than a defined
critical value.
• Therefore the observed test statistic (calculated on the basis of
sample data) is compared to the critical value, some kind of
cutoff value.

September 2, 2023 23
Step 6

September 2, 2023 24
Step 6

-1.99 +1.99

September 2, 2023 25
Step 6

September 2, 2023 26
Step 6

-1.67 +1.67

September 2, 2023 27
Step 6

Conclusion:
On average, the dietary energy intake values observed in 2-
year-olds by Dennison and colleagues are not significantly
different from those in the NHANES III.

September 2, 2023 28
Equivalence of confidence intervals and
hypothesis testing

September 2, 2023 29
Equivalence of confidence intervals and
hypothesis testing

September 2, 2023 30
Equivalence of confidence intervals and
hypothesis testing
The results for the first 7 observations were as follow:

Observation Mean Lower limit Upper limit


1 129.2523 126.0318 132.4729
2 128.5695 125.3490 131.7901
3 129.5739 126.3534 132.7945
4 130.4337 127.2132 133.6543
5 131.1520 127.9314 134.3725
6 128.7260 125.5054 131.9465
7 126.0655 122.8449 129.2860

September 2, 2023 31
Equivalence of confidence intervals and
hypothesis testing

September 2, 2023 32
Equivalence of confidence intervals and
hypothesis testing

September 2, 2023 33
Equivalence of confidence intervals and
hypothesis testing
• Inferences drawn from confidence intervals and
hypothesis testing are usually similar
• It is a good practice to compute and report both p-value
and a 95% CI for 

September 2, 2023 34
Scientific vs statistical significance

• Statistically significant but can still not be scientifically


(or clinically) important
• If a small difference but statistically significant was observed due
to large sample size
• Some statistically non-significant results can be
scientifically (or clinically) important
• Encouraging investigators to perform larger studies to confirm
the direction of the findings and possibly reject H0, with a larger
sample size

September 2, 2023 35
Pitfalls

• Statistical hypotheses, H0 and H1, were presented in


research hypothesis section.
• Proposing two-sided research question but one-sided
research hypothesis was constructed or vice versa.
• Research question was about association or relationship
but correlation was selected in research hypothesis
section or vice versa.

September 2, 2023 36
Pitfalls

• Double-barreled research hypothesis


• A is associated with the risk of B and having A increase the risk
of B, or A is associated with the risk of B and having A decrease
the risk of B.
• There is a mean difference of X between group A and B and the
mean of X of group A is higher than group B, or there is a mean
difference of X between group A and B and the mean of X of
group A is lower than group B.
• There is a correlation between X and Y and the correlation is
positive, or there is a correlation between X and Y and the
correlation is negative.

September 2, 2023 37

You might also like