ss4pLN: The required sample size for estimating a single proportion...

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/ss4pLN.R

Description

This function returns the minimum sample size required for estimating a single proportion subjecto to predefined errors.

Usage

1
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 DEFF = 1, which corresponds to a simple random sampling design.

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 ≤q 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 ≤q 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

ss4p

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)

samplesize4surveys documentation built on Jan. 18, 2020, 1:11 a.m.