Package 'saeHB.spatial'

Title: 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>.
Authors: Arina Mana Sikana [aut, cre], Azka Ubaidillah [aut]
Maintainer: Arina Mana Sikana <[email protected]>
License: GPL-3
Version: 0.1.1
Built: 2024-11-25 16:30:51 UTC
Source: CRAN

Help Index


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 [email protected]

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 (<y<)(-\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 (<y<)(-\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

D*D proximity matrix with values in the interval [0,1] containing the proximities between the row and column domains. The rows add up to 1.

iter.update

number of updates with default 3.

iter.mcmc

number of total iterations per chain with default 2000.

thin

thinning rate, must be a positive integer with default 1.

burn.in

number of iterations to discard at the beginning with default 1000.

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:

  1. Generate sampling random area effect v=(IρW)1uv = (I - \rho W)^{-1}u with u N(0,I)u ~ N(0, I), II is an identity matrix, and WW is proximity matrix. The auxiliary variables are generated by x1 U(0,1)x1 ~ U(0, 1) and x2 N(10,1)x2 ~ N(10, 1). The parameters β0,β1,β2\beta_{0}, \beta_{1}, \beta_{2} are set as 1 and ρ\rho as 0.7

  2. Generate variance of the direct estimators σe2\sigma^{2}_{e} with σe2 InvGamma(a,b)\sigma^{2}_{e} ~ InvGamma(a, b). Sampling error ee is generated by e N(0,σe2)e ~ N(0, \sigma^{2}_{e})

  3. Calculate μ=β0+β1x1+β2x2+u\mu = \beta_{0} + \beta_{1}x1 + \beta_{2}x2 + u. Calculate the direct estimators of μ\mu, i.e y=μ+ey = \mu + e

  4. Direct estimators yy, auxiliary variables x1,x2x1, x2, and variance of the direct estimators are combined in a data frame called sp.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