summarize_simple_random: Summarize simple random sample

Description Usage Arguments Value Author(s) Examples

View source: R/simple_random.R

Description

Summarizes population-level statistics for simple random 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, hence the sampleSize terms in the denominators.

Usage

1
2
summarize_simple_random(data, attribute = "attr", popSize = NA,
  desiredConfidence = 0.95, infiniteReplacement = F)

Arguments

data

data frame or vector containing observations of variable of interest. Variable of interest must already be expanded to the level of interest (e.g. stand-level).

attribute

character name of attribute to be summarized. Must be defined if data is input as a data frame.

popSize

numeric population size. Defaults to NA (unknown popSize).

desiredConfidence

numeric desired confidence level (e.g. 0.9).

infiniteReplacement

logical true if sample was done with replacement or from an infinite population. False if sampled without replacement, from a finite population. Defaults to False.

Value

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

Author(s)

Karin Wolken

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
#trainingDataFrame
data <- data.frame(bapa = c(120, 140, 160, 110, 100, 90),
  plots = c(1, 2, 3, 4, 5, 6))
#trainingVector
data <- c(120, 140, 160, 110, 100, 90)
attribute <- 'bapa'
desiredConfidence <- 0.9

## End(Not run)

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