strata.samplesize {samplingR}R Documentation

Sample size estimation on stratified sampling

Description

Calculates the required sample size in order to achieve an absolute or relative sampling error less or equal to the specified for an specific estimator and an optional confidence interval in stratified sampling.

Usage

strata.samplesize(
  Nh,
  var,
  error,
  alpha,
  estimator = c("total", "mean", "proportion", "class total"),
  alloc = c("prop", "min", "optim"),
  ch,
  p,
  mean,
  replace = FALSE,
  relative = FALSE
)

Arguments

Nh

Vector of population strata sizes.

var

Vector of estimated strata variances.

error

Sampling error.

alpha

Significance level to obtain confidence intervals.

estimator

The estimator to be estimated. Default is "total".

alloc

The allocation to be used when taking samples. Default is "prop".

ch

Vector of cost per strata to select an individual for the sample.

p

Estimated population proportion. If estimator is not "proportion" or "class total" it will be ignored.

mean

Estimated population mean. If relative=FALSE it will be ignored.

replace

Whether the samples to be taken can have repeated instances or not.

relative

Whether the specified error is relative or not.

Details

With "proportion" and "class total" estimators variance vector must contain var return values equal to \frac{Nh}{(Nh-1)}p*(1-p) values.

Value

Number of instances of the sample to be taken.

Examples

strata.samplesize(c(120,100,110,50), c(458, 313,407,364), error=5, alpha=0.05, "mean", "prop")


[Package samplingR version 1.0.1 Index]