Convenience wrapper for spatial_car(..., proper = TRUE). Creates a
proper conditional autoregressive (CAR) spatial random effect with the
autocorrelation parameter rho estimated from the data.
Use this when you want spatial autocorrelation to be a parameter of the model rather than fixed at 1 (as in ICAR). rho ~= 0 collapses to IID, rho ~= 1 approaches ICAR.
Usage
spatial_car_proper(
adjacency,
level = c("group", "obs"),
group_var = NULL,
shared = NULL
)Arguments
- adjacency
Symmetric adjacency matrix (
[n_units x n_units]).- level
Either
"group"(one effect per level ofgroup_var) or"obs"(one effect per row of the data;nrow(data)must equalnrow(adjacency)).- group_var
Name of the grouping variable in the data; required when
level = "group".Optional shared-effect handle (see model docs).
See also
spatial_car() for ICAR (rho fixed at 1),
spatial_bym2() for the BYM2 decomposition.