Professional Documents
Culture Documents
Lecture7 2019 PDF
Lecture7 2019 PDF
• X ~ Binomial (n , p)
^
• Point estimate: p =X/n sample proportion
^ ^ ^
• SE(point estimate): SE( p ) = p (1 p ) / n
^ ^
If n p ≥ 5 an n (1 - p ) ≥ 5, a 100(1-α)% CI for p
is:
^ ^
p ± zcrit SE( p)
p > p0
p ≠ p0
2. Test statistic:
np0 = 300(0.8)=240 ≥ 5
n(1-p0)=300(1-0.8)=60 ≥ 5
^
p p0
test statistic Z ~ N (0,1) under H0
p 0 (1 p0 )
n
NURS 203 Biostatistics for Nurses
13
Lecture 7 – Inference for Proportions
Single Sample: Hypothesis Testing for p
Ex (cont).
^
3. Observed statistic: p = 222/300 = 0.74
0.74 0.8
Z obs 2.61
0.8(1 0.8)
300
4. Rejection region
Reject H0 if |Zobs| ≥ Zcrit= 1.96
5. Conclusion
Reject H0 since |-2.61| = 2.61 ≥ 1.96 (or
equivalently p-value = 0.009 < 0.05). We have
significant evidence at α = 0.05 to show that the
modified protocol has a significantly different
detection rate than 80%
Test statistic:
If ^
^
n1 p1≥ 5, n1(1 - p1) ≥ 5
^ ^
n2 p 2 ≥ 5 n2 (1- p 2) ≥ 5
Then,
NURS 203 Biostatistics for Nurses
19
Lecture 7 – Inference for Proportions
Statistical Inference for p1 – p2
^ ^
p1 p 2
Then, Z ~ N(0,1)
^ 1
^
1
p (1 p )
n n
1 2
^ ^
Where p1 = X1/n1, p 2= X2/n2
^ X1 X 2
p
n1 n2
p1 > p2
p1 ≠ p2
1. Hypotheses
H0: p1=p2
H1: p1≠p2
2. Test statistic
^
p1= 28/50 = 0.56
^
p 2 = 34/50 = 0.68
NURS 203 Biostatistics for Nurses
23
Lecture 7 – Inference for Proportions
Statistical Inference for p1 – p2
Ex. New vs. existing drug
2. Test statistic
^
n1 p1 = 50(0.56) = 28 ≥ 5
^
n1 (1 - p1) = 50(1-0.56) = 22 ≥ 5
^
n2 p 2 = 50(0.68) = 34 ≥ 5
^
n2 (1 - p 2) = 50 (1-0.68) = 16 ≥ 5
2. Test statistic
So the appropriate test statistic is
^ ^
p1 p 2
Z
^ 1
^
1
p (1 p )
n n
1 2
4. Rejection region
^ ^
n2 p 2 ≥ 5 n2 (1- p 2) ≥ 5
n1 n2
0.12 0.189
( 0.309,0.069)
Interpretation:
• We are 95% confident that the true difference in
proportions of subjects reporting relief from headache pain
within 60 minutes between the true and existing drug is
between –0.309 and 0.069
H0: p1 – p2 = 0
H1: p1 – p2 ≠ 0
𝑛1 𝑝1 = 30 ≥ 5
𝑛1 1 − 𝑝1 = 70 − 30 = 40 ≥ 5
𝑛2 𝑝2 = 21 ≥ 5
𝑛2 1 − 𝑝2 = 60 − 21 = 39 ≥ 5
𝑋1 + 𝑋2 30 + 21 51
𝑝= = = = 0.39
𝑛1 + 𝑛2 70 + 60 130
0.43 − 0.35
𝑍= = 0.93
1 1
0.39(1 − 0.39) 70 + 60
Or p-value = ?
5. Conclusion?
Hypertensive Normotensive
Hypertensive 3 7
Computer device
Normotensive 1 9
• Note that:
– 3 people are measured as hypertensive by both the computer
device and trained observer
– 9 people are normotensive by both methods
– 7 people are hypertensive by the computer device and
normotensive by the trained observer
– 1 person is normotensive by the computer device and
hypertensive by the trained observer
NURS 203 Biostatistics for Nurses
39
Lecture 7 – Inference for Proportions
Inference for Proportions for Paired/Matched Data
McNemar Test
• In general the data look like
Condition 2
Yes No
Yes a b
Condition 1
No c d
Hypertensive Normotensive
Hypertensive 3 7
Computer device
Normotensive 1 9
• Conclusion?