| spatial_car | R Documentation |
Constructs a conditional autoregressive spatial random effect from an
adjacency matrix. With proper = FALSE (the default) this is the
improper CAR / ICAR (type = "car"); with proper = TRUE it returns
the same object as spatial_car_proper().
spatial_car(
adjacency,
level = c("group", "obs"),
group_var = NULL,
proper = FALSE,
shared = NULL,
parameterization = c("standard", "collapsed")
)
adjacency |
Symmetric adjacency matrix ( |
level |
Either |
group_var |
Name of the grouping variable in the data; required
when |
proper |
If |
shared |
Optional shared-effect handle (see model docs). |
parameterization |
|
A tulpa_spatial object with type = "car" (or
"car_proper" when proper = TRUE).
spatial_car_proper(), spatial_bym2().
adj <- matrix(0, 10, 10)
for (i in 1:9) adj[i, i + 1] <- adj[i + 1, i] <- 1
spatial_car(adj, level = "group", group_var = "region")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.