ref.analysis {ref.ICAR} | R Documentation |
MCMC Analysis and Summaries for Reference Prior on an Intrinsic Autoregressive Model for Areal Data
Description
Performs analysis on a geographical areal data set using the objective prior for intrinsic conditional autoregressive (ICAR) random effects (Keefe et al. 2019). It takes a shapefile, data, and region names to construct a neighborhood matrix and perform Markov chain Monte Carlo sampling on the unstructured and spatial random effects. Finally, the function obtains regional estimates and performs posterior inference on the model parameters.
Usage
ref.analysis(
shape.file,
X,
y,
x.reg.names,
y.reg.names,
shp.reg.names = NULL,
iters = 10000,
burnin = 5000,
verbose = TRUE,
tauc.start = 1,
beta.start = 1,
sigma2.start = 1,
step.tauc = 0.5,
step.sigma2 = 0.5
)
Arguments
shape.file |
A shapefile corresponding to the regions for analysis. |
X |
A matrix of covariates, which should include a column of 1's for models with a non-zero intercept |
y |
A vector of responses. |
x.reg.names |
A vector specifying the order of region names contained in |
y.reg.names |
A vector specifying the order of region names contained in |
shp.reg.names |
A vector specifying the order of region names contained in the shapefile, if there is not a NAME column in the file. |
iters |
Number of MCMC iterations to perform. Defaults to 10,000. |
burnin |
Number of MCMC iterations to discard as burn-in. Defaults to 5,000. |
verbose |
If FALSE, MCMC progress is not printed. |
tauc.start |
Starting MCMC value for the spatial dependence parameter. |
beta.start |
Starting MCMC value for the fixed effect regression coefficients. |
sigma2.start |
Starting MCMC value for the variance of the unstructured random effects. |
step.tauc |
Step size for the spatial dependence parameter. |
step.sigma2 |
Step size for the variance of the unstructured random effects. |
Value
A list containing H
, MCMC chains, parameter summaries, fitted regional values,
and regional summaries.
H |
The neighborhood matrix. |
MCMC |
Matrix of MCMC chains for all model parameters. |
beta.median |
Posterior medians of the fixed effect regression coefficients. |
beta.hpd |
Highest Posterior Density intervals for the fixed effect regression coefficients. |
tauc.median |
Posterior median of the spatial dependence parameter. |
tauc.hpd |
Highest Posterior Density interval for the spatial dependence parameter. |
sigma2.median |
Posterior median of the unstructured random effects variance. |
sigma2.hpd |
Highest Posterior Density interval for the unstructured random effects variance. |
tauc.accept |
Final acceptance rate for the spatial dependence parameter. |
sigma2.accept |
Final acceptance rate for the unstructured random effects variance. |
fit.dist |
Matrix of fitted posterior values for each region in the data. |
reg.medians |
Vector of posterior medians for fitted response by region. |
reg.hpd |
Data frame of Highest Posterior Density intervals by region. |
Author(s)
Erica M. Porter, Matthew J. Keefe, Christopher T. Franck, and Marco A.R. Ferreira
Examples
## Refer to the vignette attached to the package.