ss4stm: Sample Size for Estimation of Means in Stratified Sampling

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

View source: R/ss4stm.R

Description

This function computes the minimum sample size required for estimating a single mean, in a stratified sampling, subject to predefined errors.

Usage

1
ss4stm(Nh, muh, sigmah, DEFFh = 1, conf = 0.95, rme = 0.03)

Arguments

Nh

Vector. The population size for each stratum.

muh

Vector. The means of the variable of interest in each stratum.

sigmah

Vector. The standard deviation of the variable of interest in each stratum.

DEFFh

Vector. The design effect of the sample design in each stratum. By default DEFFh = 1, which corresponds to a stratified simple random sampling design.

conf

The statistical confidence. By default conf = 0.95.

rme

The maximun relative margin of error that can be allowed for the estimation.

Details

Let assume that the population U is partitioned in H strate. Under a stratified sampling, the neccesary sample size to achieve a relative margin of error \varepsilon is defined by:

n = \frac{(∑_{h=1}^H w_h S_h)^2}{\frac{\varepsilon^2}{z^2_{1-\frac{α}{2}}}+\frac{∑_{h=1}^H w_h S^2_h}{N}}

Where

S^2_h = DEFF_h σ^2_h

Then, the required sample size in each stratum is given by:

n_h = n \frac{w_h S_h}{∑_{h=1}^H w_h S_h}

Value

The required sample size for the sample and the required sample size per stratum.

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

ss4m

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Nh <- c(15000, 10000, 5000)
muh <- c(300, 200, 100)
sigmah <- c(200, 100, 20)
DEFFh <- c(1, 1.2, 1.5)

ss4stm(Nh, muh, sigmah, rme=0.03)
ss4stm(Nh, muh, sigmah, conf = 0.99, rme=0.03)
ss4stm(Nh, muh, sigmah, DEFFh, conf= 0.99, rme=0.03)

##########################
# Example with Lucy data #
##########################
data(Lucy)
attach(Lucy)

Strata <- as.factor(paste(Zone, Level))
levels(Strata)

Nh <- summary(Strata)
muh <- tapply(Income, Strata, mean)
sigmah <- tapply(Income, Strata, sd)

ss4stm(Nh, muh, sigmah, DEFFh=1, conf = 0.95, rme = 0.03)
ss4stm(Nh, muh, sigmah, DEFFh=1.5, conf = 0.95, rme = 0.03)

#############################
# Example with BigLucy data #
#############################
data(BigLucy)
attach(BigLucy)

Nh <- summary(Zone)
muh <- tapply(Income, Zone, mean)
sigmah <- tapply(Income, Zone, sd)

ss4stm(Nh, muh, sigmah, DEFFh=1, conf = 0.95, rme = 0.03)
ss4stm(Nh, muh, sigmah, DEFFh=1.5, conf = 0.95, rme = 0.03)

psirusteam/samplesize4surveys documentation built on Jan. 19, 2020, 10:30 a.m.