SpEED matrix by multiplying Jensen-Shannon divergence and geodesic distance (in km) – efficient version
Source:R/speedmat.r
speedmat.jsdist.m.Rd
Returns a SpEED matrix, which is the product of Jensen-Shannon divergence and geographic distance matrix
Usage
speedmat.jsdist.m(
data,
formula,
outcome = "outcome",
treatment = "treatment",
caliper_s = NULL,
caliper_jsd = NULL,
scale = FALSE,
zero_adjust = 1
)
Arguments
- data
sf object. Should include outcome, treatment, and coordinates
- formula
formula. in y ~ x form.
- outcome
character(1). Outcome variable name. default is 'outcome'
- treatment
character(1). Treatment variable name. Default is 'treatment'
- caliper_s
numeric(1). Caliper for distance
- caliper_jsd
numeric(1). Caliper for divergence value
- scale
logical(1). Min-max scaling for both distance and divergence, resulting in range [0,1]
- zero_adjust
numeric(1). The minimum after min-max scaling.