stratClust: Estimation from a Stratified Survey Design

Description Usage Arguments Value References Examples

View source: R/stratClust.R

Description

Estimate the population response from a stratified survey design in which single stage cluster samples were taken from each stratum, and the size of each stratum is known.

Usage

1
2
3
4
5
6
7
8
9
stratClust(
  elementdf,
  stratum,
  cluster,
  response,
  sizedf,
  stratum2 = stratum,
  size
)

Arguments

elementdf

A data frame with one row for each sample unit (element), containing variables identifying the stratum, cluster, and response value for each element.

stratum

A character scalar giving the name of the variable in elementdf that identifies the strata.

cluster

A character scalar giving the name of the variable in elementdf that identifies the clusters.

response

A character scalar giving the name of the variable in elementdf that contains the response values.

sizedf

A data frame with one row for each stratum. It should contain variables identifying the stratum and the size of each stratum.

stratum2

A character scalar giving the name of the variable in sizedf that identifies the strata, default is stratum, the same name as in elementdf.

size

A character scalar giving the name of the variable in sizedf that contains the sizes of the strata.

Value

A list of three data frames (tibbles, actually). Cluster has a row for each cluster with four variables:

Stratum has a row for each stratum with eight variables:

Population has one row with five numeric variables:

References

Cochran, W.G. 1977. [Sampling Techniques]. Wiley, New York. Scheaffer, R.L., Mendenhall III, W., Ott, R.L., Gerow, K., 2011. Elementary Survey Sampling, 7th ed. Brooks/Cole, Boston, MA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Example data from a stratified survey design in which
# single stage cluster sampling is used in each stratum.
# Strata are areal regions of a lake, and the response are counts of fish.
counts <- data.frame(
 Stratum=rep(c("A", "B", "C"), c(5, 8, 8)),
 Cluster=rep(1:8, c(3, 2, 3, 2, 3, 2, 3, 3)),
 Element=c(1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 3),
 Count = c(5:1, 6:21)
)
# Surface area (in hectares) corresponding to each lake stratum.
areas <- data.frame(
 Stratum=c("A", "B", "C"),
 A_h=c(10, 20, 40)
)
stratClust(elementdf=counts, stratum="Stratum", cluster="Cluster",
 response="Count", sizedf=areas, size="A_h")

JVAdams/EchoNet2Fish documentation built on Feb. 15, 2021, 4:27 a.m.