Type: | Package |
Title: | Small Area Estimation Hierarchical Bayes For Spatial Model |
Version: | 0.1.1 |
Description: | Provides several functions and datasets for area level of Small Area Estimation under Spatial Model using Hierarchical Bayesian (HB) Method. Model-based estimators include the HB estimators based on a Spatial Fay-Herriot model with univariate normal distribution for variable of interest.The 'rjags' package is employed to obtain parameter estimates. For the reference, see Rao and Molina (2015) <doi:10.1002/9781118735855>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.3 |
URL: | https://github.com/arinams/saeHB.spatial |
BugReports: | https://github.com/arinams/saeHB.spatial/issues |
Imports: | stringr, coda, rjags, stats, grDevices, graphics |
SystemRequirements: | JAGS (http://mcmc-jags.sourceforge.net) |
Suggests: | rmarkdown, knitr |
VignetteBuilder: | knitr |
Depends: | R (≥ 2.10) |
NeedsCompilation: | no |
Packaged: | 2024-11-22 08:41:08 UTC; User |
Author: | Arina Mana Sikana [aut, cre], Azka Ubaidillah [aut] |
Maintainer: | Arina Mana Sikana <sikanaradrianan@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-11-22 09:40:02 UTC |
Proximity Matrix for Small Area Estimation under Spatial Simultaneous Autoregressive (SAR) Model
Description
A data frame containing the proximity values for the 64 regions to simulate Small Area Estimation under Spatial SAR Model using Hierarchical Bayesian Method
Usage
data(prox.mat)
Format
The values are numbers in the interval [0,1] containing the proximity of the row and column domains. The sum of the values of each row is equal to 1.
saeHB.spatial : Small Area Estimation Hierarchical Bayes For Spatial Model
Description
Provides several functions and datasets for area level of Small Area Estimation under Spatial Model using Hierarchical Bayesian (HB) Method. Model-based estimators include the HB estimators based on a Spatial Fay-Herriot model with univariate normal distribution for variable of interest.The 'rjags' package is employed to obtain parameter estimates. For the reference, see Rao and Molina (2015) <doi:10.1002/9781118735855>.
Author(s)
Arina Mana Sikana, Azka Ubaidillah
Maintaner: Arina Mana Sikana sikanaradrianan@gmail.com
Functions
sar.normal
This function gives small area estimator under Spatial SAR Model and is implemented to variable of interest (y) that assumed to be a Normal Distribution. The range of data is
(-\infty < y < \infty)
.
Reference
Rao, J.N.K & Molina. (2015). Small Area Estimation 2nd Edition. New Jersey: John Wiley and Sons, Inc. <doi:10.1002/9781118735855>.
J. Kubacki and A. Jedrzejczak. (2016). Small Area Estimation of Income Under Spatial SAR Model. Statistics in Transition New Series, Vol. 17, No. 3, pp. 365–390. <doi: 10.21307/stattrans-2016-028>.
H. C. Chung and G. S. Datta. (2020). Bayesian Hierarchical Spatial Models for Small Area Estimation. Research Report Series. Washington, D.C.: U.S. Census Bureau.
Small Area Estimation under Spatial Simultaneous Autoregressive (SAR) Model and Normal Distribution using Hierarchical Bayesian Method
Description
This function gives small area estimator under Spatial SAR Model and is implemented to variable of interest (y) that assumed to be a Normal Distribution. The range of data is (-\infty < y < \infty)
.
Usage
sar.normal(
formula,
vardir,
proxmat,
iter.update = 3,
iter.mcmc = 2000,
thin = 1,
burn.in = 1000,
coef,
var.coef,
data
)
Arguments
formula |
formula that describe the fitted model. |
vardir |
sampling variances of direct estimations. |
proxmat |
|
iter.update |
number of updates with default |
iter.mcmc |
number of total iterations per chain with default |
thin |
thinning rate, must be a positive integer with default |
burn.in |
number of iterations to discard at the beginning with default |
coef |
optional vector containing the mean of the prior distribution of the regression model coefficients. |
var.coef |
optional vector containing the variances of the prior distribution of the regression model coefficients. |
data |
the data frame. |
Value
This function returns a list of the following objects:
Est |
A data frame of Small Area mean Estimates using Hierarchical Bayesian Method |
refVar |
Estimated random effect variances |
coefficient |
A data frame with estimated model coefficient |
plot |
Trace, Density, and Autocorrelation Function Plot of MCMC samples |
Examples
## For data without any non-sampled area
data(sp.norm) # Load dataset
data(prox.mat) # Load proximity Matrix
result <- sar.normal(y ~ x1 + x2, "vardir", prox.mat, data = sp.norm)
result$Est # Small Area mean Estimates
result$refVar # Estimated random effect variances
result$coefficient # Estimated model coefficient
# Load library 'coda' to execute the plot
# autocorr.plot(result$plot[[3]]) # Generate ACF Plot
# plot(result$plot[[3]]) # Generate Density and Trace plot
## For data with non-sampled area use sp.normNs
Synthetic Data for Small Area Estimation under Spatial Simultaneous Autoregressive (SAR) Model and Normal Distribution
Description
Synthetic data of 64 regions to simulate Small Area Estimation under Spatial SAR Model and Normal Distribution using Hierarchical Bayesian Method
This data is generated by these following steps:
Generate sampling random area effect
v = (I - \rho W)^{-1}u
withu ~ N(0, I)
,I
is an identity matrix, andW
is proximity matrix. The auxiliary variables are generated byx1 ~ U(0, 1)
andx2 ~ N(10, 1)
. The parameters\beta_{0}, \beta_{1}, \beta_{2}
are set as 1 and\rho
as 0.7Generate variance of the direct estimators
\sigma^{2}_{e}
with\sigma^{2}_{e} ~ InvGamma(a, b)
. Sampling errore
is generated bye ~ N(0, \sigma^{2}_{e})
Calculate
\mu = \beta_{0} + \beta_{1}x1 + \beta_{2}x2 + u
. Calculate the direct estimators of\mu
, i.ey = \mu + e
Direct estimators
y
, auxiliary variablesx1, x2
, and variance of the direct estimators are combined in a data frame calledsp.norm
Usage
data(sp.norm)
Format
A data frame with 64 observations on the following 4 variables:
- y
Direct estimators for each region
- x1
Auxiliary variable of x1
- x2
Auxiliary variable of x2
- vardir
Sampling variance of the direct estimators for each region
Synthetic Data for Small Area Estimation under Spatial Simultaneous Autoregressive (SAR) Model and Normal Distribution with non-sampled area
Description
Synthetic data of 64 regions to simulate Small Area Estimation under Spatial SAR Model and Normal Distribution with non-sampled area using Hierarchical Bayesian Method
This data contains NA
values that indicates no sampled at one or more regions. It uses the sp.norm
dataset with the direct estimators and the related variances of 5 regions are missing.
Usage
data(sp.normNs)
Format
A data frame with 64 observations on the following 4 variables:
- y
Direct estimators for each region
- x1
Auxiliary variable of x1
- x2
Auxiliary variable of x2
- vardir
Sampling variance of the direct estimators for each region