summarize_all_srs: Summarize all simple random sample

Description Usage Arguments Value Author(s) Examples

View source: R/all_srs.R

Description

Summarizes population-level statistics for simple random sample data. This function has three options: (1) SRS of a finite population or sampled without replacement, (2) SRS of an infinite population or sampled with replacement, and (3) SRS with a Bernoulli distribution.

Usage

1
2
3
summarize_all_srs(data, attribute = 'attr',
                         popSize = NA, desiredConfidence = 0.95, 
                         infiniteReplacement = F, bernoulli = 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.

bernoulli

logical TRUE if data fitting the Bernoulli distribution is used.

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
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 

# See Forest Sampling vignette for more details

# Vector data example:

data <- c(120, 140, 160, 110, 100, 90)


# Data frame data example:

data <- data.frame(bapa = c(120, 140, 160, 110, 100, 90), 
                   plots = c(1, 2, 3, 4, 5, 6))
attribute <- 'bapa'


# Bernoulli data example:

data <- data.frame(alive = c(T, T, F, T, F, F), 
                   plots = c(1, 2, 3, 4, 5, 6))
attribute <- 'alive'


## End(Not run)

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