README.md

saeHB.spatial

Provides several functions and datasets for area level of Small Area Estimation under Spatial SAR Model using Hierarchical Bayesian (HB) Method. For the reference, see Rao and Molina (2015) .

Author

Arina Mana Sikana, Azka Ubaidillah

Maintaner

Arina Mana Sikana 221810195@stis.ac.id

Function

Installation

You can install the development version of saeHB.spatial from GitHub with:

# install.packages("devtools")
devtools::install_github("arinams/saeHB.spatial")

Example

This is a basic example of using spatial.normal() function to make an estimate based on synthetic data in this package

library(saeHB.spatial)

## For data without any non-sampled area
data(sp.norm)       # Load dataset
data(prox.mat)      # Load proximity Matrix

## For data with non-sampled area use sp.normNs

## Fitting model
result <- spatial.normal(y ~ x1 + x2, "vardir", prox.mat, data = sp.norm)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 64
#>    Unobserved stochastic nodes: 6
#>    Total graph size: 8989
#> 
#> Initializing model
#> 
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 64
#>    Unobserved stochastic nodes: 6
#>    Total graph size: 8989
#> 
#> Initializing model
#> 
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 64
#>    Unobserved stochastic nodes: 6
#>    Total graph size: 8989
#> 
#> Initializing model

Small Area mean Estimates

result$Est

Estimated model coefficient

result$coefficient

Estimated random effect variances

result$refVar
#>  [1] 3.446660 3.277981 2.942481 2.829723 2.829723 2.942481 3.277981 3.446660
#>  [9] 3.277981 3.004318 2.717549 2.623733 2.623733 2.717549 3.004318 3.277981
#> [17] 2.942481 2.717549 2.482897 2.408138 2.408138 2.482897 2.717549 2.942481
#> [25] 2.829723 2.623733 2.408138 2.341689 2.341689 2.408138 2.623733 2.829723
#> [33] 2.829723 2.623733 2.408138 2.341689 2.341689 2.408138 2.623733 2.829723
#> [41] 2.942481 2.717549 2.482897 2.408138 2.408138 2.482897 2.717549 2.942481
#> [49] 3.277981 3.004318 2.717549 2.623733 2.623733 2.717549 3.004318 3.277981
#> [57] 3.446660 3.277981 2.942481 2.829723 2.829723 2.942481 3.277981 3.446660

References

Rao, J.N.K & Molina. (2015). Small Area Estimation 2nd Edition. New York: John Wiley and Sons, Inc. .



arinams/spatial documentation built on Feb. 14, 2022, 12:44 a.m.