Provides several functions for area and subarea level of small area estimation under Twofold Subarea Level Model using hierarchical Bayesian (HB) method with Univariate Normal distribution for variables of interest. Some dataset simulated by a data generation are also provided. The ‘rjags’ package is employed to obtain parameter estimates using Gibbs Sampling algorithm. Model-based estimators involves the HB estimators which include the mean, the variation of mean, and the quantile. For the reference, see Rao and Molina (2015), Torabi (2014), Leyla Mohadjer et.al. (2007), and Erciulescu et al. (2018).
Reyhan Saadi, Azka Ubaidillah
Reyhan Saadi 221810557@stis.ac.id or aansum99@gmail.com
NormalTF() This function gives estimation of subarea and area
means simultaneously under Twofold Subarea Small Area Estimation
Model Using Hierarchical Bayesian Method with Normal distribution
based on model in Torabi (2014)You can install the development version of saeHB.twofold from GitHub with:
# install.packages("devtools")
# devtools::install_github("reymath99/saeHB.twofold")
install.packages("saeHB.twofold", repos = c('https://reymath99.r-universe.dev', 'https://cloud.r-project.org'))
This is a basic example of using NormalTF function to make an estimate based on sample data in this package
library(saeHB.twofold)
data(dataTwofold)
#for dataset with nonsampled subarea use dataTwofoldNS
#fitting model
model=NormalTF(y~x1+x2,vardir="vardir",area = "codearea",weight = "w",data=dataTwofold)
Extract subarea mean estimation
model$Est_sub
Extract area mean estimation
model$Est_area
Extract coefficient estimation (\beta)
model$coefficient
Extract estimation of subarea random effect variance (\sigma^2_u) and area random effect variance (\sigma^2_v)
model$refVar
Calculate relative standard error or CV
CV=(model$Est_sub$SD)/(model$Est_sub$Mean)*100
#cv summaries
summary(CV)