0% found this document useful (0 votes)
19 views86 pages

Stats for Health Researchers

Uploaded by

yybhy9gwtp
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)
19 views86 pages

Stats for Health Researchers

Uploaded by

yybhy9gwtp
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
You are on page 1/ 86

5. The difference between two means.

The difference between two proportions.


Dr. Ioannis Alatsathianos, PhD
Molecular Biology & Genetics DUTH, MSc & PhD
Medical Faculty of Athens NKUA, Hygiene,
Epidemiology & Medical Statistics
Where we’ve been.. Recap
• Explored two methods for making statistical inferences: confidence intervals and
tests of hypotheses.

• Studied confidence intervals and tests for a single population mean μ, a single
populations proportion and a single population variance σ2 .

• Learned how to select the sample size necessary to estimate a population


parameter with a specified margin of error.
General Formula
• The general formula for all confidence intervals is:

Point Estimate ± (Critical Value)(Standard Error)


Where:
•Point Estimate is the sample statistic estimating the population
parameter of interest

•Critical Value is a table value based on the sampling distribution


of the point estimate and the desired confidence level

•Standard Error is the standard deviation of the point estimate


Finding the Critical Value, Zα/2
Zα/2 = 1.96
• Consider a 95% confidence interval:
1 − α = 0.95 so α = 0.05

α α
= 0.025 = 0.025
2 2

Z units: Zα/2 = -1.96 0 Zα/2 = 1.96


Lower Upper
X units: Confidence Point Estimate Confidence
Limit Limit
Intervals and Level of Confidence
Sampling Distribution of the Mean
/2 11–– /2

x
Intervals μx = μ
extend from ‾
𝑋1
x1
σ ‾
x2 𝑋2 (1-)100%
X − Zα / 2 of intervals
n
to constructed
σ contain μ;
X + Zα / 2
n ()100% do
not.
Confidence Intervals
Student 𝑡 Distribution
If a population has a normal distribution, then the distribution of
𝑥‾ − 𝜇
𝑡= 𝑠
𝑛

• is a Student 𝑡 distribution for all samples of size 𝑛. A Student 𝑡 distribution


is commonly referred to as a 𝑡 distribution.
Confidence Interval for μ (σ Unknown)
• Use Student’s t Distribution
• Confidence Interval Estimate:

(where tα/2 is the critical value of the t distribution with n -1 degrees of freedom
and an area of α/2 in each tail)

S
X  tα / 2
n
Student’s t Distribution
Note: t Z as n increases

Standard
Normal
(t with df = ∞)

t (df = 13)
t-distributions are bell-
shaped and symmetric, but
have ‘fatter’ tails than the t (df = 5)
normal

0 t
The Null Hypothesis, H0
▪ Begin with the assumption that the null Verdict Defendant
hypothesis is true Χ of Jury Innocent Guilty
• Similar to the notion of innocent until
Not Guilty Correct Incorrect
proven guilty
Guilty Incorrect Correct
▪ Refers to the status quo or historical value
▪ Always contains “=“, or “≤”, or “≥” sign Population
Result of Test
▪ May or may not be rejected 𝜇 = 𝜇0 𝜇 ≠ 𝜇0

Do Not Reject Correct Incorrect

Reject Incorrect Correct


The Test Statistic and Critical Values
Sampling Distribution of the test statistic

Region of Region of
Rejection Rejection
Region of
Non-Rejection

Critical Values

“Too Far Away” From Mean of Sampling Distribution


Level of Significance and the Rejection Region

Level of significance = 
H0: μ = 211
H1: μ ≠ 211
 /2  /2

211
Critical values

Rejection Region
This is a two-tail test because there is a rejection region in both tails
Z Test of Hypothesis for the Mean (σ Known)
• Convert sample statistic (X ) to a ZSTAT test statistic

Hypothesis
Tests for 

σ Known
Large sample σ Unknown
Small sample
(Z test)  Unknown
The test statistic is: (t test)
X −μ
ZSTAT =
σ
n
p-Value Approach to Testing: Interpreting the
p-value
• Compare the p-value with 
• If p-value <  , reject H0
• If p-value >  , do not reject H0

• Remember

• If the p-value is low then H0 must go


t Test of Hypothesis for the Mean (σ Unknown)
Hypothesis
◼ Convert sample statistic ( X ) Tests for 
to a tSTAT test statistic
Large sample Small sample
σKnown
Known σUnknown
Unknown
( Known) ( Unknown)
(Z
(Z test)
test) (t(t test)
test)
The test statistic is:

X −μ
t STAT =
S
n
Exact Methods for Testing Claims About a
Population Proportion p
• Instead of using the normal distribution as an approximation to the binomial
distribution, we can get exact results by using the binomial probability distribution
itself. Binomial probabilities are a real nuisance to calculate manually, but
technology makes this approach quite simple. Also, this exact approach does not
require that np ≥ 5 and, so we have a method that applies when that requirement is
not satisfied.
Objectives
In this lecture, you learn:
• How to use hypothesis testing for comparing the difference between
• The means
• The proportions
Identifying the Target Parameter
• For instance, an epidemiologist might need to estimate the difference in mean life
expectancy between inner-city and suburban residents.

• Or an occupational physician might want to estimate the difference in the


proportions of occupant fatalities in two different train companies that they apply
and don’t apply safety measures in train transportation.

• Or a pediatrician might be interested in comparing the variability in the IQ score that


two groups of kids with substantially different birth weight have when they reach their
8th year.
Methods Used
• In this chapter, we consider techniques for using two samples to compare the
populations from which they were selected
• The same procedures that are used to estimate and test hypotheses about a single
population can be modified to make inferences about two populations.
Sample —> population
• We are working with a sample to infer about a population of interest
• e.g. Is the COVID-19 vaccine effective?
We do a study in a sample, and generalize about the population
• Sample quantities (e.g. sample mean, sample standard deviation)
are known, i.e. measured
• Population quantities (e.g. population mean)
are unknown and are being estimated
Population vs sample
• Every numeric variable in a population (e.g. body weight) has a frequency
distribution across the population
•Therefore is has a population mean and a population variance.
• These are symbolized 𝜇 and 𝜎 2 respectively
• These are unknown quantities, to be estimated from the sample
• If we take a sample of the population, the same variable will also have a
frequency distribution across the sample
• Therefore is also has a sample mean and a sample variance
• These are symbolized 𝑋‾ and 𝑆 2 respectively
• These are known quantities, measured in the sample!
Mean and Proportion:
• Mean: A measure of central tendency used with
continuous data (e.g., blood pressure, cholesterol levels).
• Proportion: Used with categorical data, representing the
frequency of an outcome in a group (e.g., proportion of
patients with diabetes).
So, Types of data to Notice
• As with inferences about a single population, the type of data (quantitative or
qualitative) collected on the two samples is also indicative of the target
parameter.
• With quantitative data, you are likely to be interested in comparing the
means or variances of the data.
• With qualitative data with two outcomes (success or failure), a comparison
of the proportions of successes is likely to be of interest.
Two-Sample Tests: Abundant
Two-Sample Tests

Population Population
Means, Means, Population Population
Independent Related Proportions Variances
Samples Samples
Examples:
Group 1 vs. Same group Proportion 1 vs. Variance 1 vs.
Group 2 before vs. after Proportion 2 Variance 2
treatment
Comparing two means
Comparing two (sub-)sample means
• For example: blood cholesterol levels between pre-menopausal and
post-menopausal women
• Another example: lung function (FEV1) between asthmatic and
non-asthmatic individuals
• Sample means will be different, even by little
Comparing two (sub-)sample means
• For example: blood cholesterol levels between pre-menopausal and post-
menopausal women
• Another example: lung function (FEV1) between asthmatic and non-
asthmatic individuals
• Sample means will be different, even by little

• Two possible cases:


• Both population means are the same, 𝜇1 = 𝜇2 , and any difference in
sample means is due to random error
• Population means are actually different 𝜇1 ≠ 𝜇2 , and that is the cause of
the difference in sample means
Comparing two (sub-)sample means
• For example: blood cholesterol levels between pre-menopausal and post-menopausal
women
• Another example: lung function (FEV1) between astmatic and non-asthmatic individuals
• Sample means will be different, even by little

• Two possible cases:


• Both population means are the same, 𝜇1 = 𝜇2 , and any difference in sample means is
due to random error
• This is called the null hypothesis (𝐻0 )
• Population means are actually different 𝜇1 ≠ 𝜇2 , and that is the cause of the difference
in sample means
• This is called the alternative hypothesis (𝐻𝟏 )
• We need to decide between the two...
Key-Words to notice
• Words: difference and compare → two populations are to be compared
• Mean in mean life expectancy imply that the target parameter is the difference in
population means, μ1 – μ2.
Difference Between Two Means
Population means,
independent samples * Goal: Test hypothesis or form a
confidence interval for the difference
between two population means, μ1 – μ2

The point estimate for the


difference is
X1 – X2

This value helps us understand if one group’s


average outcome is significantly different from
another’s.
Example
• This is used to compare the means of one variable for two groups of cases.
• Find out the effect of a new drug on blood pressure
• Patients with high blood pressure would be randomly assigned into two groups, a
placebo group and a treatment group.
• The placebo group would receive conventional treatment while the treatment
group would receive a new drug that is expected to lower blood pressure.
• After treatment for a couple of months, the two-sample t-test is used to compare
the average blood pressure of the two groups. Note that each patient is measured
once and belongs to one group.
Difference Between Two Means: Independent
Samples • Different data sources
• Unrelated
Population means,
• Independent
independent samples * • Sample selected from one population has no effect
on the sample selected from the other population

σ1 and σ2 unknown,
Use Sp to estimate unknown σ.
assumed equal
Use a Pooled-Variance t test.

σ1 and σ2 unknown, Use S1 and S2 to estimate


not assumed equal unknown σ1 and σ2. Use a
Separate-variance t test
Hypothesis Tests for Two Population Means
Two Population Means, Independent Samples

Two-tail test:

H0: μ1 = μ2
H1: μ1 ≠ μ2
i.e.,
H0: μ1 – μ2 = 0
H1: μ1 – μ2 ≠ 0
Choose the Appropriate Test
• Use a t-test if variances are unknown and sample size is small.
• Consider if the test should be paired or unpaired based on study design.
Hypothesis tests for μ1 – μ2
Two Population Means, Independent Samples

Lower-tail test: Upper-tail test: Two-tail test:


H0: μ1 – μ2  0 H0: μ1 – μ2 ≤ 0 H0: μ1 – μ2 = 0
H1: μ1 – μ2 < 0 H1: μ1 – μ2 > 0 H1: μ1 – μ2 ≠ 0

  /2 /2

-t t -t/2 t/2


Reject H0 if tSTAT < -t Reject H0 if tSTAT > t Reject H0 if tSTAT < -t/2
or tSTAT > t/2
Hypothesis tests for µ1 - µ2 with σ1 and σ2 unknown
and assumed equal Assumptions:
▪ Samples are randomly and
Population means, independently drawn
independent samples
▪ Populations are normally

σ1 and σ2 unknown,
* distributed or both sample
sizes are at least 30
assumed equal If in doubt, you may test normality
(Q-Q plots, Shapiro-Wilk test)
σ1 and σ2 unknown,
not assumed equal ▪ Population variances are
unknown but assumed equal
Hypothesis tests for µ1 - µ2 with σ1 and σ2 unknown
and assumed equal If these assumptions do not hold:
...then we can perform a non-parametric test
Population means, called the
independent samples Wilcoxon-Mann-Whitney (or Mann-Whitney)
test

σ1 and σ2 unknown,
* • Assesses whether the two samples come from
the same distribution
assumed equal • Non-parametric = it does not assume
normality of the samples
• The Mann-Whitney test is the non-
σ1 and σ2 unknown,
parametric “brother” of the two-sample t-
not assumed equal
test
Hypothesis tests for µ1 - µ2 with σ1 and σ2 unknown
and assumed equal
Population means, • The pooled variance is:
independent samples S 2
=
(n1 − 1)S1 + (n2 − 1)S2
2 2

(n1 − 1) + (n2 − 1)
p

• The test statistic is:


σ1 and σ2 unknown,
assumed equal
*
t STAT =
( X1 − X 2 ) − ( μ 1 − μ 2 )

2 1 1 
S p  + 

σ1 and σ2 unknown,  n1 n 2 
not assumed equal
• Where tSTAT has d.f. = (n1 + n2 – 2)
Confidence interval for µ1 - µ2 with σ1 and σ2 unknown
and assumed equal
Population means, The confidence interval for
independent samples μ1 – μ2 is:

σ1 and σ2 unknown,
assumed equal * ( X1 − X 2 )  tα/2 2 
Sp 
1
+
1 


 n1 n 2 
σ1 and σ2 unknown,
not assumed equal Where tα/2 has d.f. = n1 + n2 – 2
Pooled-Variance t Test Example
You are a pneumonologist and investigate the effect of second-hand smoke. Is
there a difference in absorbed nicotine (indicated by cotinine) between smokers
and passive smokers listed on the Smoke & Environmental Smokers? You
collect the following data:
SMOK ENV.SMOK
Number 21 25
Sample mean 3.27 2.53
Sample std dev 1.30 1.16
Assuming both populations are
approximately normal with equal
variances, is there a difference in
mean yield ( = 0.05)?
Pooled-Variance t Test Example: Calculating the
Test Statistic
H0: μ1 - μ2 = 0 i.e. (μ1 = μ2)
The test statistic is: H1: μ1 - μ2 ≠ 0 i.e. (μ1 ≠ μ2)

t=
(X1 − X 2 ) − (μ1 − μ 2 )
=
(3.27 − 2.53) − 0 = 2.040
2  1 1 

 1
1.5021 + 
1 
Sp  + 
 n1 n 2   21 25 

S =
2 (n1 − 1)S1
2
+ (n 2 − 1)S 2
2
=
(21 − 1)1.30 2 + (25 − 1)1.16 2
= 1.5021
(n1 − 1) + (n2 − 1) (21 - 1) + (25 − 1)
p
Interpret Results
• If p < 0.05, we reject the null hypothesis, concluding that the means are
significantly different.
• The p-value measures the probability that the observed difference between groups
could have occurred by random chance. A smaller p-value (typically < 0.05)
suggests a statistically significant result.
Pooled-Variance t Test Example: Hypothesis Test
Solution Reject H Reject H 0 0

H0: μ1 - μ2 = 0 i.e. (μ1 = μ2) .025 .025


H1: μ1 - μ2 ≠ 0 i.e. (μ1 ≠ μ2)
 = 0.05
-2.0154 0 2.0154 t
df = 21 + 25 - 2 = 44 2.040
Critical Values: t = ± 2.0154 Decision:
Test Statistic: Reject H0 at a = 0.05
3.27 − 2.53
t= = 2.040 Conclusion:
 1 1 
1.5021  +  There is evidence of a
 21 25 
difference in means.
Pooled-Variance t Test Example: Confidence Interval
for µ1 - µ2
It gives a range of plausible values for the mean difference
Since we rejected H0 can we be 95% confident that µSmoke > µENV.SMOKE?
95% Confidence Interval for µSmoke - µEnv.Smoke

(X − X )  t
1 2 /2
2
p
1 1 
S  +  = 0.74  2.0154  0.3628 = (0.009, 1.471)

 n1 n 2 

Since 0 is less than the entire interval, we can be 95% confident that µSMOKE > µENV-
SMOKE

A confidence interval provides a range within which the true difference between two
means or proportions is likely to fall, with a certain level of confidence (usually 95%).
Self-Assessment Exercises
Comparing Two Methods of Teaching
Suppose you wish to compare a new method of teaching reading to "learners"
with the current standard method. You decide to base your comparison on the
results of a reading test given at the end of a learning period of six months. Of a
random sample of 22 "learners," 10 are taught by the new method and 12 are
taught by the standard method. All 22 students are taught by qualified instructors
under similar conditions for the designated six-month period. The results of the
reading test at the end of this period are given in Table.
Reading Test Scores for Learners
New Method Standard Method
80 80 79 81 79 62 70 68
76 66 71 76 73 76 86 73
70 85 72 68 75 66
Cystic fibrosis-iron in blood
• Consider the distribution of serum iron levels for the population of healthy
children and the population of children with cystic fibrosis.
• A random sample is selected from each population. The sample of n1 = 9 healthy
children has mean serum iron level x1 = 18.9μmol/l and standard deviation s1 =
5.9μmol/l; the sample of n2 = 13 children with cystic fibrosis has mean iron level
x2 = 11.9μmol/1 and standard deviation s2 = 6.3μmol/1. Is it likely that the
observed difference in sample means 18.9 versus 11.9μmol/l is the result of
chance variation, or should we conclude that the discrepancy is due to a true
difference in population means?
Intervals

95% confidence intervals for the mean serum iron levels


of healthy children and children with cystic fibrosis
Unequal Variances
What is this Welch’s t-test we saw in R?
• In R, the t.test function can compute the t-statistic using either the equal variances
(pooled) or the unequal variances (Welch’s) formula, depending on the parameters
specified by the user.

• Welch’s t-test (Unequal Variances) :


• By default, t.test in R assumes unequal variances and uses Welch’s t-test.
• This method does not assume equal variances and is more robust in cases where
the two groups have different variances. The formula for the Welch’s t-test statistic
is:
Unequal Variances
• Instead of using 𝑠𝑝2 as an estimate of the common
variance σ2, we substitute 𝑠12 for 𝜎12 and 𝑠22 for
𝜎22 .
• Therefore, the appropriate test statistic is • This case is unlike the one in
which we had equal
variances, in that the exact
distribution of t is difficult to
derive.
• Therefore, it is necessary to
𝟐 𝟐
𝑺𝟐𝟏 𝑺𝟐 use an approximation. We
+
𝒏𝟏 𝒏𝟐
𝒅𝒇 = begin by calculating the
𝟐 𝟐 𝟐 𝟐
𝒔𝟏 𝑺𝟐 quantity.
𝒏𝟏 𝒏𝟐
+
𝒏𝟏 − 𝟏 𝒏𝟐 − 𝟏
Self-assessment Exercises on Unequal Variances

For you to practice. Only…


Effects of an antihypertensive drug treatment on
persons over the age of 60 who suffer from isolated
systolic hypertension
• Subjects who had been randomly selected to take the active drug and those
chosen to receive a placebo were compared with respect to systolic blood
pressure. We begin by selecting a random sample from each of the two groups.
The sample of 𝑛1 = 2308 individuals receiving the active drug treatment has
mean systolic blood pressure 𝑥‾1 = 142.5mmHg and standard deviation 𝑠1 =
15.7mmHg; the sample of 𝑛2 = 2293 persons receiving the placebo has mean 𝑥‾2 =
156.5mmHg and standard deviation 𝑠2 = 17.3mmHg. We are interested in
detecting differences that could occur in either direction, and thus conduct a two-
sided test at the 𝛼 = 0.05 level of significance.
Unequal variances - Risk factors (BMI) for heart
disease among patients suffering from diabetes
• A random sample is selected from each population. The 𝑛1 = 207 male
diabetics have mean body mass index 𝑥‾1 = 26.4 kg/m2 and standard
deviation 𝑠1 = 3.3 kg/m2 ; the 𝑛2 = 127 female diabetics have mean body
mass index 𝑥‾2 = 25.4 kg/m2 and standard deviation 𝑠2 = 5.2 kg/m2 . Will
we reject the null hypothesis at the 0.10 level of significance?
Related Population: Paired Difference Test
Related Populations-
The Paired Difference Test
Tests Means of 2 Related Populations
Related
• Paired or matched samples
samples • Repeated measures (before/after)
(Paired samples) • Use difference between paired values:

Di = X1i - X2i
• Eliminates Variation Among Subjects
• Assumptions:
• Differences are normally distributed
• Or, if not Normal, use large samples
Related Populations
The Paired Difference Test-FYI…only
The ith paired difference is Di , where Di = X1i - X2i
Related
samples The point estimate for the n
(Paired samples) paired difference population D i
mean μD is D : D= i =1
n
n

 i
The sample standard
(D − D ) 2
deviation is SD
SD = i=1
n −1
n is the number of pairs in the paired sample
The Paired Difference Test:
Finding tSTAT
• The test statistic for μD is:
Related D − μD
samples t STAT =
SD
(Paired samples)
n

• Where tSTAT has n - 1 d.f.


The Paired Difference Confidence Interval

Related The confidence interval for μD is


samples
SD
(Paired samples)
D  t / 2
n
n

 (D − D)
i
2

where SD = i=1
n −1
Paired Difference Test: Example
• Assume the University introduces the seminar “antimicrobial prescription” for young
doctors. Has the course made a difference in the number of antimicrobial tablets
prescribed? You collect the following data:

Number of tablets: (2) - (1)


Medical Doc Before (1) After (2) Difference, Di
‾ σ 𝑫𝒊
𝑫 =
𝒏
C.B. 6 4 - 2 = −𝟒. 𝟐
T.F. 20 6 -14
M.H.
R.K.
3
0
2
0
- 1
0 SD =
 i
(D − D ) 2

M.O. 4 0 - 4 n −1
-21 = 5.67
Paired Difference Test: Solution
• Has the training made a difference in the number of
Reject Reject
antimicrobial tablets (at the 0.01 level)?
H0: μD = 0 /2
/2
H1: μD  0
- 4.604 4.604
 = .01 D = - 4.2 - 1.66

t0.005 = ± 4.604
d.f. = n - 1 = 4 Decision: Do not reject H0
(tstat is not in the rejection region)
Test Statistic:
Conclusion: There is
D − μ D − 4.2 − 0 insufficient of a change in the
t STAT = = = −1.66
SD / n 5.67/ 5 number of antimicrobial
tablets.
The Paired Difference Confidence Interval -- Example

SD
The confidence interval for μD is: D  t / 2
n
D = -4.2, SD = 5.67

5.67
99% CI for  D : − 4.2  4.604
5
= (-15.87, 7.47)

Since this interval contains 0 you are 99% confident that μD = 0


Part II

The Difference Between


Two Proportions
Key-Words to notice
• The word proportions in proportions of occupant fatalities in two districts
indicates that the target parameter is the difference in proportions, P1 – P2.
What is a Proportion?
• Definition of Proportion:
• A proportion compares the count of individuals meeting a specific criterion to the total
count.
𝐴
• Formula: Proportion=
𝐴+𝐵
• Medical Applications:
• Proportions are commonly used to express prevalence, such as the rate of a disease in
a population.
• Examples:
• Prevalence of Type 2 Diabetes (T2DM) in the U.S. is approximately 11.3%.
• Prevalence of Multiple Sclerosis (MS) in Italy is 140 cases per 100,000 people.
• Key Point: A proportion ranges between 0 and 1, making it distinct from a ratio.
The Binomial Distribution - Basics
• Definition:
• A probability distribution for situations with two possible outcomes (e.g.,
disease/no disease, success/failure).
• Each trial is independent, with a constant probability of "success" 𝑝p.
• Parameters of Binomial Distribution:
• n: Total number of trials (e.g., patients observed). But note: “success”
• 𝑝: Probability of success in each trial. in our context often
• Examples in Medicine: means “disease”...
• Probability of getting a positive result in a diagnostic test.
• Number of smokers in a sample of 50 individuals.
Visualizing the Binomial Distribution
• Content:
• Probability of Success Distribution:
• The distribution shape depends on 𝑛 and 𝑝.
• For small 𝑛n or extreme 𝑝p, the distribution is skewed.
• Example Distributions:
• Example 1: 𝑛=5, 𝑝=0.167
• Example 2: 𝑛=50, 𝑝=0.113
• Example 3: 𝑛=200, 𝑝=0.001
• Medical Relevance: This helps in estimating the
probability of specific outcomes, such as the
likelihood of multiple patients in a trial showing adverse reactions.
Normal Approximation of the Binomial Distribution
Central Limit Theorem:
• For large 𝑛n, the binomial distribution can be approximated by a
normal distribution.
• Approximation holds when 𝑛𝑝 ≥ 5 and 𝑛(1−𝑝) ≥ 5n

Why Use Normal Approximation?


• It simplifies calculations and allows the use of z-tests.
• Useful in large sample sizes where exact calculations are complex.

Medical Example:
• When estimating the rate of a side effect in a large trial, normal
approximation can provide quick, reasonable estimates.
Two Population Proportions
Goal: test a hypothesis or form a
confidence interval for the difference
Population
proportions
between two population proportions,
p1 – p2

The point estimate for


the difference is
Two Population Proportions
In the null hypothesis we assume the null
Population hypothesis is true, so we assume p1 = p2 and
proportions pool the two sample estimates

The pooled estimate for the overall


proportion is:

X1 + X2
p=
n1 + n2
where X1 and X2 are the number of
items of interest in samples 1 and 2
Two Population Proportions
The test statistic for
Population p1 – p2 is a Z statistic:
proportions

X1 + X 2 X1 X2
where p= , p1 = , p2 =
n1 + n 2 n1 n2
Hypothesis Tests for Two Population Proportions

Population proportions

Two-tail test:

H0: p1 = p2
H1: p1 ≠ p2
i.e.,
H0: p1 – p2 = 0
H1: p1 – p2 ≠ 0
Hypothesis Tests for Two Population Proportions
Population proportions
Lower-tail test: Upper-tail test: Two-tail test:
H0: p1 – p2  0 H0: p1 – p2 ≤ 0 H0: p1 – p2 = 0
H1: p1 – p2 < 0 H1: p1 – p2 > 0 H1: p1 – p2 ≠ 0

  /2 /2

-z z -z/2 z/2


Reject H0 if ZSTAT < -Z Reject H0 if ZSTAT > Z Reject H0 if ZSTAT < -Z
or ZSTAT > Z
Hypothesis Test Example:
Two population Proportions
Is there a significant difference between the proportion of men
and the proportion of women who will choose female-gender
related specialties (e.g. obstetrics and
gynecology/dermatology?

• In a random sample, 36 of 72 men and 35 of 50 women


indicated they would choose these specialties

• Test at the .05 level of significance


Hypothesis Test Example:
Two population Proportions
• The hypothesis test is:
H0: p1 – p2 = 0 (the two proportions are equal)
H1: p1 – p2 ≠ 0 (there is a significant difference between proportions)
The sample proportions are:
Men 𝑃෠1 = 36/72 = 0.50
Women 𝑃෠2 = 35/50 = 0.70

The pooled estimate for the overall proportion is:


X1 + X 2 36 + 35 71
p= = = = .582
n1 + n 2 72 + 50 122
Hypothesis Test Example: Reject H0 Reject H0
Two Population Proportions
The test statistic for p1 – p2 is: .025 .025

-1.96 1.96
-2.20

Decision: Reject H0
Conclusion: There is evidence
of a significant difference in
Critical Values = ±1.96
For  = .05 the proportion of men and
women who will choose
women-gender related
specialties.
Confidence Interval for
Two Population Proportions

Population The confidence interval for


proportions p1 – p2 is:
Confidence Interval for Two Population Proportions
-- Example

The 95% confidence interval for p1 – p2 is:

( 0.50 − 0.70)  1.96


0.50(0.50) 0.70(0.30)
+
72 50
= (-0.37, - 0.03)

Since this interval does not contain 0 can be 95% confident the two
proportions are different.
Clinical Significance vs. Statistical Significance

• What is Statistical Significance? What is Clinical Significance?


•Definition: Clinical significance refers
• Definition: Statistical significance
tells us whether an observed effect to the practical importance of a result —
is likely due to chance, based on a whether it makes a meaningful difference
p-value (e.g., p < 0.05). in patient outcomes or treatment
• Example: In a study comparing decisions.
two blood pressure medications, a •Example: Even if a new medication
difference in average reduction of lowers blood pressure by 2 mmHg with
2 mmHg with a p-value < 0.05 statistical significance, this reduction may
may be statistically significant not meaningfully impact patient health.
Self-Assessment Exercise
Do Airbags Save Lives?
Airbag Available No Airbag Available
Occupant Fatalities 41 52
Total number of
11,541 9,853
occupants

a. Use a 0.05 significance level to test the claim that the fatality rate of occupants
is lower for those in cars equipped with airbags.
b. Construct a 90% confidence interval estimate of the difference between the two
population proportions. What does the result suggest about the claim that “the
fatality rate of occupants is lower for those in cars equipped with airbags”?
Recap - what we learned today
• Getting a 95% CI for a sample mean (one-sample t-test) and comparing two
sample means (two-sample t-test) by getting a 95% for their difference

• Getting a 95% CI for a sample proportion (approximate or exact) and


comparing two proportions by getting a 95% for their difference

• If the 95% for the difference does not include the null value (=zero) then the
difference is described as “statistically significant”
• If the 95% includes the null value, then the difference is described as
statistically non-significant
• Thank you!

You might also like