calculate_sampsize {sgsR} | R Documentation |
Sample size determination
Description
Determine a samples size for simple random sampling using relative standard error
Usage
calculate_sampsize(
mraster,
rse = NULL,
start = 0.01,
end = 0.05,
increment = 0.001,
plot = FALSE
)
Arguments
mraster |
spatRaster. Metrics raster. All values must be numeric. |
rse |
Numeric. Desired relative standard error (coefficient of variation of the mean) threshold to determine sample size. |
start |
Numeric. First rse value to begin rse sequence. default = |
end |
Numeric. Final rse value to end rse sequence. default = |
increment |
Numeric. Value to increment between |
plot |
Logical. if |
Value
A data.frame of sample size and rse by raster variable.
Note
rse = (100 * SE) / mean)
Where:
-
SE
- Standard error of the mean -
s
- Standard deviation of the observations -
n
- Number of observations
Author(s)
Tristan R.H. Goodbody
References
Benedetti, R., Piersimoni, F., & Postiglione, P. (2015). Sampling spatial units for agricultural surveys. pp 202-203. Berlin: Springer.
See Also
Other calculate functions:
calculate_allocation()
,
calculate_allocation_existing()
,
calculate_coobs()
,
calculate_distance()
,
calculate_pcomp()
,
calculate_pop()
,
calculate_representation()
Examples
#--- Load raster ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
mr <- terra::rast(r)
calculate_sampsize(
mraster = mr,
rse = 0.01
)
calculate_sampsize(
mraster = mr
)
calculate_sampsize(
mraster = mr,
rse = 0.025,
start = 0.01,
end = 0.08,
increment = 0.01
)
#--- higher variance leads to need for more samples ---#