
cpr dataset we explored in Ch. 14, available here| group | died | survived | total |
|---|---|---|---|
| control | 39 | 11 | 50 |
| treatment | 26 | 14 | 40 |
| total | 65 | 25 | 90 |
Difference in proportions of “survived”: \[\hat{p}_T-\hat{p}_C=\frac{14}{40}-\frac{11}{50}=0.13\]

Sampling distribution of \(\hat{p}_1-\hat{p}_2\)
The sampling distribution of \(\hat{p}_1-\hat{p}_2\) based on samples of size \(n_1\) and \(n_2\) and population proportions \(p_1\) and \(p_2\) will be approximately normal with mean \(p_1-p_2\) and standard error \[SE(\hat{p}_1-\hat{p}_2)=\sqrt{\frac{p_1(1-p_1)}{n_1}+\frac{p_2(1-p_2)}{n_2}}\]
if the following technical conditions are met:
| group | died | survived | total |
|---|---|---|---|
| control | 39 | 11 | 50 |
| treatment | 26 | 14 | 40 |
| total | 65 | 25 | 90 |
cpr study Treatment group
cpr study Control group
The hypothesis test using a normal approximation uses the \(Z\) score as the test statistic \[Z = \frac{(\hat{p}_1-\hat{p}_2) - 0}{\sqrt{\hat{p}_{pool}(1-\hat{p}_{pool})\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}}\]
For the cpr example the Z score is \[Z=\frac{(\hat{p}_T-\hat{p}_C)-0}{SE}=\frac{0.13-0}{0.095}=1.37\]
Note that the denominator is the SE estimate we saw in the previous slide
When the conditions are met, \(Z\) will have a standard normal distribution \(N(0,1)\)
The 2-sided p-value is the area under the density curve for \(N(0,1)\) that is more extreme than the observed difference (\(\leq-1.37\) or \(\geq1.37\))
Using Jamovi calculator, the p-value is 0.171
cpr data.0.13)

Another way to compute a confidence interval is to use the differences in bootstrapped proportions to estimate the standard error
For the CPR data this gives us the estimate SE \(\approx\) 0.0964
This gives us a 95% Bootstrap SE Confidence Interval of \[0.13\pm 1.96\cdot 0.0964\]
Thus, the 95% confidence interval is between -0.059 and 0.319
| group | died | survived | total |
|---|---|---|---|
| control | 39 | 11 | 50 |
| treatment | 26 | 14 | 40 |
| total | 65 | 25 | 90 |
| Type | Interval |
|---|---|
| Bootstrap Percentile | (-0.063, 0.315) |
| Bootstrap SE | (-0.059, 0.319) |
| Normal Approximation | (-0.057, 0.317) |