summarize_stratified: Summarize stratified sample

Description Usage Arguments Value Author(s) Examples

View source: R/stratified.R

Description

Summarizes strata- and population-level statistics for stratified sample data. The calculations are derived from Chapter 5 in Gregoire and Valentine's (2008) Sampling Strategies for Natural Resources and the Environment. The variance terms refer to the variance of the mean, hence the n terms in the denominators. This function has two options: (1) stratified and (2) post-stratified.

Usage

1
2
summarize_stratified(trainingData, attribute, stratumTab, 
                            desiredConfidence = 0.95, post = T)

Arguments

trainingData

data frame containing observations of variable of interest, and stratum assignment for each plot

attribute

character name of attribute to be summarized

stratumTab

data frame containing acreages for each stratum

desiredConfidence

numeric desired confidence level (e.g. 0.9)

post

logical true if post-stratification was used

Value

a data frame of population mean, variance, standard error, and high and low confidence limits.

Author(s)

Henry Rodman

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

# See Forest Sampling vignette for more details

# Data can be expressed as:

trainingData <- data.frame(bapa = c(120, 140, 160, 110, 100, 90),
                           stratum = c(1, 1, 1, 2, 2, 2))
stratumTab <- data.frame(stratum = c(1, 2), acres = c(200, 50))
attribute = 'bapa'
desiredConfidence = 0.9


## End(Not run)

SilviaTerra/forestsamplr documentation built on Jan. 3, 2020, 2:33 p.m.