saeHB.twofold

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).

Author

Reyhan Saadi, Azka Ubaidillah

Maintaner

Reyhan Saadi 221810557@stis.ac.id or aansum99@gmail.com

Function

Installation

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

# install.packages("devtools")
devtools::install_github("reymath99/saeHB.twofold")

Example

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

model$coefficient

Extract estimation of subarea random effect variance (^2_u) and area random effect variance (^2_v)

model$refVar

Calculate relative standard error or CV

CV=(model$Est_sub$SD)/(model$Est_sub$Mean)*100
#cv summaries
summary(CV)

References