e4p: Statistical errors for the estimation of a single proportion
Description
This function computes the cofficient of variation and the standard error when estimating a single proportion under a sample design.
Usage
e4p(N, n, P, DEFF = 1, conf = 0.95, plot = FALSE)
Arguments
N
The population size.
n
The sample size.
P
The value of the estimated proportion.
DEFF
The design effect of the sample design. By default DEFF = 1, which corresponds to a simple random sampling design.
conf
The statistical confidence. By default conf = 0.95.
plot
Optionally plot the errors (cve and margin of error) against the sample size.
Value
The coefficient of variation, the margin of error and the relative margin of error for a predefined sample size.
Details
We note that the coefficent of variation is defined as: $$cve = \frac{\sqrt{Var(\hat{p})}}{\hat{p}}$$
Also, note that the magin of error is defined as: $$\varepsilon = z_{1-\frac{\alpha}{2}}\sqrt{Var(\hat{p})}$$
References
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas