survsamp.strat: A function for surveys using stratified random sampling

Description Usage Arguments Examples

View source: R/survsamp.R

Description

This function allows you to make estimation or sample size determinations for surveys using stratified random sampling.

Usage

1
2
3
4
survsamp.strat(y = NULL, B = NULL, N = NULL, n = NULL, Ni = NULL,
  ni = NULL, pi = NULL, sig2 = NULL, sample.size.det = FALSE,
  budget = NULL, ss.det.cost = NULL, ss.det.a = NULL, estimate = "mean",
  alpha = 0.05)

Arguments

y

The data to be used for estimation. Must be a list with length equal to the number of strata.

B

The desired bound on the estimation. Required for sample size determination.

N

The total population size.

n

The total sample size.

Ni

The population size per strata.

ni

The sample size per strata.

pi

The population proportion per strata.

sig2

The population variance per strata unless equal variance across strata.

sample.size.det

Logical statement indicating if the action should be sample size determination. If false, estimation occurs.

budget

The budget for sample collection. Can be included in sample size determination.

ss.det.cost

A vector pf cost to collect samples in a given strata. Can be included in sample size determination.

ss.det.a

A vector of the allocation which indicates the proportion to be collected for each strats. Can be included in sample size determination.

estimate

Indicate the desired statistic to be estimated. Options include: mean, total, and proportion.

alpha

Significance level.

Examples

1
2
3
4
5
survsamp.strat(B=50,N=100,
   Ni=c(46,54),sig2=c(1,2),
   estimate="total",sample.size.det = TRUE)
survsamp.strat(y=list(rnorm(25,5,1),rnorm(25,6,2)),
   N=100,n=50,ni=c(25,25),Ni=c(46,54),estimate="mean")

carrollrm/survsamp documentation built on April 28, 2020, 4:04 a.m.