Skip to contents

Determine how many samples to allocate within strata.

Usage

calculate_allocation_existing(
  existing,
  nSamp,
  allocation = "prop",
  weights = NULL,
  metric = NULL,
  force = FALSE
)

Arguments

existing

sf 'POINT' or data.frame. Existing plot network.

nSamp

Numeric. Number of desired samples.

allocation

Character. Allocation algorithm to be used. Either prop (default) for proportional allocation, optim for optimal allocation (equal sampling cost), equal for equal number of samples (defined by nSamp) for each strata, or "manual" for user defined strata weights defined using weights.

weights

Numeric. Only applicable when allocation = "manual". Vector of weights where sum(weights) == 1. Vector length must be equal to the number of unique strata where the first numeric value corresponds to stratum 1, second stratum 2 etc.

force

Logical. Default = FALSE - force nSamp to be exactly the user defined value in cases where nSamp and sraster strata count are not equally divisible. Additional samples often need to be allocated or removed based on rounding differences resulting from proportional differences between nSamp and strata coverages in sraster. In these instances samples are either added to strata with the lowest number of samples or are removed from strata with the highest number of samples. Has no effect when existing is provided.

Value

Returns a data.frame of:

  • strata - Strata ID.

  • total - Number of samples to be allocated. Values correspond to under representation (samples needed; positive value) or over representation (too many samples; negative value) based on the nSamp provided.

  • need - Required samples per strata based on allocation method. Rounded.

References

Gregoire, T.G., & Valentine, H.T. (2007). Sampling Strategies for Natural Resources and the Environment (1st ed.). Chapman and Hall/CRC. https://doi.org/10.1201/9780203498880

Author

Tristan R.H. Goodbody