Description Usage Arguments Value References Examples
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.
1 2 3 4 5 6 7 8 9 | stratClust(
elementdf,
stratum,
cluster,
response,
sizedf,
stratum2 = stratum,
size
)
|
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 |
cluster |
A character scalar giving the name of the variable in |
response |
A character scalar giving the name of the variable in |
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 |
size |
A character scalar giving the name of the variable in |
A list of three data frames (tibbles, actually).
Cluster
has a row for each cluster with four variables:
h
= stratum (may be character, factor, or numeric)
i
= cluster (may be character, factor, or numeric)
m_hi
= number of elements in stratum h, cluster i (numeric)
y_hi
= sum of the response for stratum h, cluster i (numeric)
Stratum
has a row for each stratum with eight variables:
h
= stratum (may be a character, factor, or numeric)
m_h
= number of elements in stratum h (numeric)
y_h
= sum of response in stratum h (numeric)
n_h
= number of clusters in stratum h (numeric)
ybar_h
= mean response for stratum h (numeric)
s_ybar_h
= standard deviation of ybar_h (numeric)
A_h
= size of stratum h (numeric)
W_h
= relative size of stratum h (numeric)
Population
has one row with five numeric variables:
A
= total size of all strata in population
ybar_str
= mean response for population per unit of size
s_ybar_str
= standard deviation of ybar_str
ytot_str
= total response for population
s_ytot_str
= standard deviation of ytot_str
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.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.