A confidence interval for \({p_1} - {p_2}\)with confidence level of approximately \(100(1 - \alpha )\% \) is
\({\hat p_1} - {\hat p_2} \pm {z_{\alpha /2}} \cdot \sqrt {\frac{{{{\hat p}_1}{{\hat q}_1}}}{m} + \frac{{{{\hat p}_2}{{\hat q}_2}}}{n}} \)
The confidence interval can be used when\(m \cdot {\hat p_1},m \cdot {\hat q_1},n \cdot {\hat p_1}\), and \(n \cdot {\hat q_1}\) are at least 10
There are \(m = 395\) elementary school teachers and \(n = 266\) high school teachers. There are 224 elementary school satisfied teachers with their job, thus
\({\hat p_1} = \frac{{224}}{{395}}\)
is the proportion, and 126 high school teachers satisfied with their job, thus
\({\hat p_2} = \frac{{126}}{{266}}\)
Therefore, the 95 % confidence interval is
\(\begin{array}{l}{{\hat p}_1} - {{\hat p}_2} - {z_{\alpha /2}} \cdot \sqrt {\frac{{{{\hat p}_1}{{\hat q}_1}}}{m} + \frac{{{{\hat p}_2}{{\hat q}_2}}}{n}} ,{{\hat p}_1} - {{\hat p}_2} + {z_{\alpha /2}} \cdot \sqrt {\frac{{{{\hat p}_1}{{\hat q}_1}}}{m} + \frac{{{{\hat p}_2}{{\hat q}_2}}}{n}} \\ = \frac{{224}}{{395}} - \frac{{126}}{{266}} - 1.96 \cdot \sqrt {\frac{{224}}{{395}} \cdot \frac{{171}}{{395}}} \;\;\;395 + \frac{{126}}{{266}} \cdot \frac{{140}}{{266}}\;\;\;266,\\ = \frac{{224}}{{395}} - \frac{{126}}{{266}} + 1.96 \cdot \sqrt {\frac{{224}}{{395}} \cdot \frac{{171}}{{395}}} \;\;\;395 + \frac{{126}}{{266}} \cdot \frac{{140}}{{266}}\;\;\;266\\ = (0.016,0.171).\end{array}\)