e4dp {samplesize4surveys} | R Documentation |
Statistical errors for the estimation of a difference of proportions
Description
This function computes the cofficient of variation and the standard error when estimating a difference of proportions under a complex sample design.
Usage
e4dp(N, n, P1, P2, DEFF = 1, T = 0, R = 1, conf = 0.95, plot = FALSE)
Arguments
N |
The population size. |
n |
The sample size. |
P1 |
The value of the first estimated proportion. |
P2 |
The value of the second estimated proportion. |
DEFF |
The design effect of the sample design. By default |
T |
The overlap between waves. By default |
R |
The correlation between waves. By default |
conf |
The statistical confidence. By default |
plot |
Optionally plot the errors (cve and margin of error) against the sample size. |
Details
We note that the margin of error is defined as:
cve = \frac{\sqrt{Var(\hat{P}_1 - \hat{P}_2) }}{\hat{P}_1 - \hat{P}_2}
Also, note that the magin of error is defined as:
\varepsilon = z_{1-\frac{\alpha}{2}}\sqrt{Var(\hat{P}_1 - \hat{P}_2)}
Value
The coefficient of variation and the margin of error for a predefined sample size.
Author(s)
Hugo Andres Gutierrez Rojas <hagutierrezro at gmail.com>
References
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas
See Also
Examples
e4dp(N=10000, n=400, P1=0.5, P2=0.6)
e4dp(N=10000, n=400, P1=0.5, P2=0.6, plot=TRUE)
e4dp(N=10000, n=400, P1=0.5, P2=0.6, DEFF=3.45, conf=0.99, plot=TRUE)
e4dp(N=10000, n=400, P1=0.5, P2=0.6, T=0.5, R=0.5, DEFF=3.45, conf=0.99, plot=TRUE)