powered by
This function computes the power for a (right tail) test of proportions.
b4p(N, n, P, D, DEFF = 1, conf = 0.95, plot = FALSE)
The population size.
The sample size.
The value of the first estimated proportion.
The value of the null effect. Note that D must be strictly greater than P.
D
P
The design effect of the sample design. By default DEFF = 1, which corresponds to a simple random sampling design.
DEFF = 1
The statistical confidence. By default conf = 0.95.
conf = 0.95
Optionally plot the power achieved for an specific sample size.
The power of the test.
We note that the power is defined as: $$1-\Phi(Z_{1-\alpha} - \frac{(D-P)}{\sqrt{\frac{DEFF}{n}(1-\frac{n}{N})(P (1-P))}})$$
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas
ss4p
# NOT RUN { b4p(N = 100000, n = 400, P = 0.5, D = 0.55) b4p(N = 100000, n = 400, P = 0.5, D = 0.9, plot = TRUE) b4p(N = 100000, n = 4000, P = 0.5, D = 0.55, DEFF = 2, conf = 0.99, plot = TRUE) # }
Run the code above in your browser using DataLab