Description Usage Arguments Value Author(s) Examples
Summarizes population-level statistics for two-stage sample data. The calculations are derived from Chapter 3 in Avery and Burkhart's (1967) Forest Measurements, Fifth Edition. The variance terms refer to the variance of the mean.
1 2 3 4 | summarize_two_stage(data, plot = TRUE, attribute = NA,
populationClusters = 0,
populationElementsPerCluster = 0,
desiredConfidence = 0.95)
|
data |
data frame containing observations of variable of interest for either cluster-level of plot-level data. |
plot |
logical TRUE if parameter data is plot-level, FALSE if parameter data is cluster-level. Default is TRUE. |
attribute |
character name of attribute to be summarized. |
populationClusters |
numeric total number of clusters in the population. |
populationElementsPerCluster |
numeric total number of elements in the population. |
desiredConfidence |
numeric desired confidence level (e.g. 0.9). |
data frame of stand-level statistics including standard error and confidence interval limits. All final values are on a 'per plot' basis.
Karin Wolken
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## Not run:
# See Forest Sampling vignette for more details
# Data can be input as either clusters or plots.
# Cluster level data can be expressed as:
dataCluster <- data.frame(clusterID = c(1, 2, 3, 4, 5),
totClusterElements = c(5, 2, 1, 6, 5),
sampledElements = c(2, 2, 2, 2, 2),
isUsed = c(T, T, T, T, F),
attrSumCluster = c(1000, 1250, 950,
900, 1005))
# Example:
summarize_two_stage(dataCluster, F, 'attr')
# Plot level data can be expressed as:
dataPlot <- data.framedata.frame(clusterID = c(1, 1, 1, 2, 2, 2,
3, 3, 3, 4, 4, 4,
5, 5, 5, 6, 6, 6),
volume = c(500, 650, 610, 490,
475, 505, 940, 825,
915, 210, 185, 170,
450, 300, 500, 960,
975, 890),
isUsed = c(T, T, T, T, T, T, T,
T, T, T, T, T, T, T,
T, T, T, T))
# Example:
summarize_two_stage(redData, T, 'volume', populationClusters = 16,
populationElementsPerCluster = 160)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.