survsamp.cluster: A function for surveys using cluster 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 cluster random sampling.

Usage

1
2
3
survsamp.cluster(y = NULL, B = NULL, a = NULL, N = NULL, m = NULL,
  M = NULL, p = NULL, sig2 = NULL, sample.size.det = FALSE,
  estimate = "mean", alpha = 0.05)

Arguments

y

The total of all observations in the sample needed for mean and total estimation.

B

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

a

The total number of elements in cluster with the characteristic of interest. Needed for estimating the proportion.

N

The number of clusters in the population. Required.

m

The number of elements per sampled cluster.

M

The number of elements in the population.

p

The population proportion.

sig2

The population variance.

sample.size.det

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

estimate

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

alpha

Significance level.

Examples

1
2
3
4
5
6
survsamp.cluster(N=12,M=100,sig2=35000,estimate="mean",
   B=9,sample.size.det=TRUE)
set.seed(123019)
m=rpois(9,10)
survsamp.cluster(y=rpois(9,100),m=m,N=12,M=100,estimate="total")
survsamp.cluster(a=m-rpois(9,3),m=m,N=12,M=100,estimate="proportion")

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