This function measures the spatial balance (with respect to the sampling frame) of design sites using Voronoi polygons (Dirichlet tessellations).
sp_balance(
object,
sframe,
stratum_var = NULL,
ip = NULL,
metrics = "pielou",
extents = FALSE
)
An sf
object containing some design sites.
The sampling frame as an sf
object. The coordinate
system for sframe
must be one where distance for coordinates is meaningful.
The name of the stratum variable in object
and sframe
. If NULL
(the default), no strata is assumed.
If a single character vector is provided, it is assumed this is the
name of the stratum variable in object
and sframe
. If
a two-dimensional character vector is provided, one element must be
named "object" and corresponds to the name of the stratum variable
in object
, while the other element must be named "sframe" and
corresponds to the name of the stratum variable in sframe
.
Inclusion probabilities associated with each row of sframe
.
If these are not provided, an equal probability design is assumed (within
strata).
A character vector of spatial balance metrics:
pielou
Pielou's Evenness Index (the default). This statistic can take on a value between zero and one.
simpsons
Simpsons Evenness Index. This statistic can take on a value between zero and logarithm of the sample size.
rmse
Root-Mean-Squared Error. This statistic can take on a value between zero and infinity.
mse
Mean-Squared Error. This statistic can take on a value between zero and infinity.
mae
Median-Absolute Error. This statistic can take on a value between zero and infinity.
medae
Mean-Absolute Error. This statistic can take on a value between zero and infinity.
chisq
Chi-Squared Loss. This statistic can take on a value between zero and infinity.
All spatial balance metrics have a lower bound of zero, which indicates perfect spatial balance. As the metric value increases, the spatial balance decreases.
Should the extent (total units) within each Voronoi polygon
be returned? Defaults to FALSE
.
A data frame with columns providing the stratum (stratum
),
spatial balance metric (metric
), and spatial balance (value
).