User:Smaines/quantile-table-study

Standard deviation and standard error
According to the 68-95-98.5 rule, we would expect that 95% of the results $$p_1,p_2,\ldots$$ to fall within about two standard deviations ($$\plusmn2\sigma_{P}$$) either side of the true mean $$\overline{p}$$. This interval is called the confidence interval, and the radius (half the interval) is called the margin of error, corresponding to a 95% confidence level.

We would expect the normally distributed values $$p_1,p_2,\ldots$$ to have a standard deviation which varies with $$n$$. This is called the standard error $$\sigma_\overline{p}$$.

For the single result from our survey, we assume that $$p = \overline{p}$$, and that all subsequent results $$p_1,p_2,\ldots$$ together would have a variance $$\sigma_{P}^2=P(1-P)$$.


 * $$ \text{Standard error} = \sigma_\overline{p} \approx \sqrt{\frac{\sigma_{P}^2}{n}} \approx \sqrt{\frac{p(1-p)}{n}}$$

Note that $$p(1-p)$$ corresponds to the variance of a Bernoulli distribution.

Maximum margin of error at different confidence levels
For a confidence level $$\gamma$$, there is a corresponding confidence interval about the mean $$\mu\plusmn z_\gamma\sigma$$, that is, the interval $$(\mu-z_\gamma\sigma,\mu+z_\gamma\sigma)$$ within which values of $$P$$ should fall with probability $$\gamma$$. Precise values of $$z_\gamma$$ are given by the quantile function of the normal distribution (which the 68-95-99.7 rule approximates).

Since $$\max \sigma_P^2 = \max P(1-P) = 0.25$$ at $$p = 0.5$$, we can arbitrarily set $$p=\overline{p} = 0.5$$, calculate $$\sigma_{P}$$, $$\sigma_\overline{p}$$, and $$z_\gamma\sigma_\overline{p}$$ to obtain the maximum margin of error for $$P$$ at a given confidence level $$\gamma$$ and sample size $$n$$, even before having actual results. With $$p=0.5,n=1013$$


 * $$MOE_{95}(0.5) \approx z_{0.95}\sigma_\overline{p} \approx z_{0.95}\sqrt{\frac{\sigma_{P}^2}{n}} = 1.96\sqrt{\frac{.25}{n}} = 0.98/\sqrt{n}=\plusmn3.1%$$
 * $$MOE_{99}(0.5) \approx z_{0.99}\sigma_\overline{p} \approx z_{0.99}\sqrt{\frac{\sigma_{P}^2}{n}} = 2.58\sqrt{\frac{.25}{n}} = 1.29/\sqrt{n}=\plusmn4.1%$$

Also, usefully, for any reported $$MOE_{95}$$


 * $$MOE_{99} = \frac{z_{0.99}}{z_{0.95}}MOE_{95} \approx 1.3 \times MOE_{95}$$