Two-Proportions Z-Test

A survey revealed the following information on the prevalence of eye disease. Check if the difference in prevalence is statistically significant.

ResidenceEye DiseaseTotal
YesNo
Rural24276300
Urban15485500

z = \frac{p_1 - p_2}{\sqrt{p_1(1-p_1)/n_1 + p_2(1-p_2)/n_2}}

n1: sample size of population 1 = 300
n2: sample size of population 2 = 500
p1: sample proportion for population 1 = 24/300
p2: sample proportion for population 2 = 15/500

z = \frac{0.08 - 0.03}{\sqrt{0.08(1-0.08)/300 + 0.03(1-0.03)/500}} =  2.87

Critical z = 1.96 at a 5% confidence interval.
Therefore, z = 2.87 > critical z; the difference in prevalence of eye disease between urban and rural is significant.