ss4pLN {samplesize4surveys} | R Documentation |
The required sample size for estimating a single proportion based on a logaritmic transformation of the estimated proportion
Description
This function returns the minimum sample size required for estimating a single proportion subjecto to predefined errors.
Usage
ss4pLN(N, P, DEFF = 1, cve = 0.05, plot = FALSE)
Arguments
N |
The population size. |
P |
The value of the estimated proportion. |
DEFF |
The design effect of the sample design. By default |
cve |
The maximun coeficient of variation that can be allowed for the estimation. |
plot |
Optionally plot the errors (cve and margin of error) against the sample size. |
Details
As for low proportions, the coefficient of variation tends to infinity, it is customary to use
a simmetrycal transformation of this measure (based on the relative standard error RSE) to report
the uncertainity of the estimation. This way, if p \leq 0.5
, the transformed CV will be:
RSE(-ln(p))= \frac{SE(p)}{-ln(p)*p}
Otherwise, when p > 0.5
, the transformed CV will be:
RSE(-ln(1-p))= \frac{SE(p)}{-ln(1-p)*(1-p)}
Note that, when p \leq 0.5
the minimun sample size to achieve a particular coefficient of variation cve
is defined by:
n = \frac{S^2}{P^2cve^2+\frac{S^2}{N}}
When p > 0.5
the minimun sample size to achieve a particular coefficient of variation cve
is defined by:
n = \frac{S^2}{P^2cve^2+\frac{S^2}{N}}
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
ss4pLN(N=10000, P=0.8, cve=0.10)
ss4pLN(N=10000, P=0.2, cve=0.10)
ss4pLN(N=10000, P=0.7, cve=0.05, plot=TRUE)
ss4pLN(N=10000, P=0.3, cve=0.05, plot=TRUE)
ss4pLN(N=10000, P=0.05, DEFF=3.45, cve=0.03, plot=TRUE)
ss4pLN(N=10000, P=0.95, DEFF=3.45, cve=0.03, plot=TRUE)
##########################
# Example with Lucy data #
##########################
data(Lucy)
attach(Lucy)
N <- nrow(Lucy)
P <- prop.table(table(SPAM))[1]
# The minimum sample size for simple random sampling
ss4pLN(N, P, DEFF=1, cve=0.03, plot=TRUE)
# The minimum sample size for a complex sampling design
ss4pLN(N, P, DEFF=3.45, cve=0.03, plot=TRUE)