SampleSize: Sample Plot Allocation

View source: R/SampleSize.R

SampleSizeR Documentation

Sample Plot Allocation

Description

This function calculates the number of samples that should be assigned to a particular strata. Designed for forestry applications. This function utilizes area, variance, and a particular value of interest to determine sample plot allocations.

Usage

SampleSize(Strata, Area, CV, Value, TotalSamples)

Arguments

Strata

A vector of Strata names or IDs. Each value will be treated as a unique strata even if names are repeated.

Area

The area of each strata. This can be in any unit desired by the user.

CV

The estimated coefficent of variation for each Strata of the value of interest.

Value

The value of significance that will be used as a weight for sample size suggestions

TotalSamples

A single number that equals the total number of samples you wish to take.

Details

The weighted value can be anything the user decides is of the most value ex: Basal area, Volume, Percentage Hardwood, etc. The estimated variance of this value within each strata can also be used for weighting sample plot allocations. The user can choose to ignore any of the inputs by entering the value 1. See examples for and example where no particular value of interest is used, for an example where the CV within each strata is not estimated, and an example where both a value of interest and the CV are ignored.

Value

A dataframe with the strata and suggested number of samples for each strata

The minimum number of samples that will be assigned to a strata is 3. This allows the calculation of a mean, sd, etc. This will sometimes lead to a sum of the total samples suggested to be slightly larger than the TotalSamples value entered by the user. When this occurs a warning will be printed along with the dataframe output.

Examples


Strata <- c("MA", "f",  "g",  "pr", "tw", "fr")
Area <- runif(6, min = 100, max = 1000)
CV <- runif(6, min = 20, max = 80)
Volume <- runif(6, min = 8, max = 42)
TotalSamples <- 100


SampleSize(Strata, Area, CV, Volume, TotalSamples)
SampleSize(Strata, Area, CV, 1, TotalSamples) # no value of interest is included. TotalSamples is a vector of length 1.
SampleSize(Strata, Area, 1, 1, 120) # no value of interest and no estimate of variance, area only value utilized.
SampleSize(Strata, Area, 1, Volume, 25) # No estimate of variance is used.
Samples <- SampleSize(Strata, Area, CV, Volume, TotalSamples) # Strata names and samples can be saved to a dataframe.

ryanmismith/inventoryfunctions documentation built on Aug. 5, 2022, 2:22 a.m.