Title: | Hierarchical Bayes Twofold Subarea Level Model SAE |
---|---|
Description: | We designed this package to 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) <doi:10.1002/9781118735855>, Torabi and Rao (2014) <doi:10.1016/j.jmva.2014.02.001>, Leyla Mohadjer et al.(2007) <http://www.asasrms.org/Proceedings/y2007/Files/JSM2007-000559.pdf>, and Erciulescu et al.(2019) <doi:10.1111/rssa.12390>. |
Authors: | Reyhan Saadi [aut, cre], Azka Ubaidillah [aut] |
Maintainer: | Reyhan Saadi <[email protected]> |
License: | GPL-3 |
Version: | 0.1.2 |
Built: | 2024-11-28 13:04:58 UTC |
Source: | CRAN |
A dataset to simulate Small Area Estimation using Hierarchical Bayesian method under Two Fold Subarea level model with Normal distribution on variabel interest.
This data is generated by these following steps:
Generate sampling error ,subarea random effect
, area random effect
, auxiliary variabel
, and weight or proportions of unit
Generate subarea random effect ~
Generate area random effect ~
Generate auxilary variabel on subarea level ~
Generate auxilary variabel on subarea level ~
Generate unit proportion on each subarea ~
Generate sampling error ~
where
~
is a variance of direct estimator
Setting coefficient
Calculate target parameter
Calculate direct estimator
Auxiliary variables ,
, direct estimation (
) ,vardir, and weight
are combined in a dataframe called dataTwofold
dataTwofold
dataTwofold
A data frame with 90 rows and 6 columns:
Direct estimation of subarea mean
Auxiliary variabel of
Auxiliary variabel of
Index that describes the code relating to warea for each subarea
Unit proportion on each subarea or weight
Sampling variance of direct estimator
A dataset to simulate Small Area Estimation using Hierarchical Bayesian method under Two Fold Subarea level model with Normal distribution and Non-sampled subarea
This data contains NA values that indicates no sampled at one or more Subareas. It uses the dataTwofold
with the direct estimates and the related variances in 10 subareas are missing.
dataTwofoldNS
dataTwofoldNS
A data frame with 90 rows and 6 columns:
Direct estimation of subarea mean
Auxiliary variabel of
Auxiliary variabel of
Index that describes the code relating to area for each subarea
Unit proportion on each subarea or weight
Sampling variance of direct estimator
This function is implemented to variable of interest that assumed to be a Normal Distribution. The range of data is
This function gives estimation of subarea and area means simultaneously under Twofold Subarea Level Small Area Estimation Model Using Hierarchical Bayesian Method with Normal distribution
NormalTF( formula, vardir, area, weight, iter.update = 3, iter.mcmc = 2000, thin = 1, burn.in = 1000, data, coef, var.coef )
NormalTF( formula, vardir, area, weight, iter.update = 3, iter.mcmc = 2000, thin = 1, burn.in = 1000, data, coef, var.coef )
formula |
Formula that describe the fitted model |
vardir |
Sampling variances of direct estimations on each subarea |
area |
Index that describes the code relating to area in each subarea.This should be defined for aggregation to get area estimator. Index start from 1 until m |
weight |
Vector contain proportion units or proportion of population on each subarea. |
iter.update |
Number of updates perform in Gibbs Sampling with default |
iter.mcmc |
Number of total iteration per chain perform in Gibbs Sampling with default |
thin |
Thinning rate perform in Gibbs Sampling and it must be a positive integer with default |
burn.in |
Number of burn in period in Gibbs Sampling with default |
data |
The data frame |
coef |
Vector contains initial value for mean on coefficient's prior distribution or |
var.coef |
Vector contains Initial value for varians on coefficient's prior distribution or |
This function returns a list with following objects:
A dataframe that contains the values, standar deviation, and quantile of Subarea mean Estimates using Twofold Subarea level model under Hierarchical Bayes method
A dataframe that contains the values, standar deviation, and quantile of Area mean Estimates using Twofold Subarea level model under Hierarchical Bayes method
A dataframe that contains estimated subarea and area random effect variance and
A dataframe that contains the estimated model coefficient
Trace, Density, Autocorrelation Function Plot of coefficient
##load dataset for data without any nonsampled subarea data(dataTwofold) #formula of fitted model formula=y~x1+x2 #model fitting mod=NormalTF(formula,vardir="vardir",area="codearea",weight="w",data=dataTwofold) #estimate mod$Est_sub #Subarea mean estimate mod$Est_area #area mean estimate mod$coefficient #coefficient estimate mod$refVar #random effect subarea and area estimates #Load Library 'coda' to execute the plot #autocorr.plot(mod$plot[[3]]) is used to generate ACF Plot #plot(mod$plot[[3]]) is used to generate Density and trace plot ##for dataset with nonsampled subarea use dataTwofoldNS
##load dataset for data without any nonsampled subarea data(dataTwofold) #formula of fitted model formula=y~x1+x2 #model fitting mod=NormalTF(formula,vardir="vardir",area="codearea",weight="w",data=dataTwofold) #estimate mod$Est_sub #Subarea mean estimate mod$Est_area #area mean estimate mod$coefficient #coefficient estimate mod$refVar #random effect subarea and area estimates #Load Library 'coda' to execute the plot #autocorr.plot(mod$plot[[3]]) is used to generate ACF Plot #plot(mod$plot[[3]]) is used to generate Density and trace plot ##for dataset with nonsampled subarea use dataTwofoldNS
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)
Reyhan Saadi, Azka Ubaidillah
Maintaner: Reyhan Saadi [email protected]
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) amd Erciulescu et al. (2018)
Mohadjer, L.K., Rao, J.N., Liu, B., Krenzke, T., & Kerckhove, W.V. (2007). Hierarchical Bayes Small Area Estimates of Adult Literacy Using Unmatched Sampling and Linking Models.
Torabi, M., & Rao, J.N. (2014). On small area estimation under a sub-area level model. J. Multivar. Anal., 127, 36-55. DOI:10.1016/j.jmva.2014.02.001
Rao, J.N.K & Molina. (2015). Small Area Estimation 2nd Edition. New York: John Wiley and Sons, Inc. DOI:10.1002/9781118735855
Erciulescu, A.L., Cruze, N.B. and Nandram, B. (2019), Model-based county level crop estimates incorporating auxiliary sources of information. J. R. Stat. Soc. A, 182: 283-303. DOI:10.1111/rssa.12390