Title: | SAE with Measurement Error using HB under Beta Distribution |
---|---|
Description: | Implementation of Small Area Estimation (SAE) using Hierarchical Bayesian (HB) Method when auxiliary variable measured with error under Beta Distribution. The 'rjags' package is employed to obtain parameter estimates. For the references, see J.N.K & Molina (2015) <doi:10.1002/9781118735855>, Ybarra and Sharon (2008) <doi:10.1093/biomet/asn048>, and Ntzoufras (2009, ISBN-10: 1118210352). |
Authors: | Azka Ubaidillah [aut], Ratih Rodliyah [aut, cre] |
Maintainer: | Ratih Rodliyah <[email protected]> |
License: | GPL-3 |
Version: | 1.1.0 |
Built: | 2024-12-24 06:46:30 UTC |
Source: | CRAN |
This data generated by simulation based on Hierarchical Bayesian Method under Normal Distribution with Measurement Error by following these steps:
Generate ~ UNIF(0, 1),
~ UNIF(0, 1),
~ UNIF(0, 1), and
~ UNIF(0, 1)
Generate ~ Gamma(2,1) and
~ Gamma(2,5)
Generate ~ N(
, sqrt(
)) and
~ N(
, sqrt(
))
Set Coefficient =
=
=
=
=
Generate ~ N(0,1) and
~ Gamma(1,0.5)
Calculate
Calculate =
and
= (1-
)
Generate ~ UNIF(A,B)
Calculate Mean of Variable Y with
Calculate Variance of Variable Y with
Direct estimation Y
, auxiliary variables x1 x2 x3 x4
, sampling variance v
, and mean squared error of auxiliary variables v.x1 v.x2
are arranged in a dataframe called dataHBMEbeta
.
data(dataHBMEbeta)
data(dataHBMEbeta)
A data frame with 30 rows and 8 variables:
Y
direct estimation of Y.
x1
auxiliary variable of x1.
x2
auxiliary variable of x2.
x3
auxiliary variable of x3.
x4
auxiliary variable of x4.
vardir
sampling variances of Y.
v.x1
mean squared error of x1.
v.x2
mean squared error of x2.
This data to simulate Small Area Estimation using Hierarchical Bayesian Method with Measurement Error under Beta Distribution with non-sampled areas
This data contains NA values that indicates no sampled at one or more small areas. It uses the dataHBMEbeta with the direct estimates and the related variances in 5 small areas are missing.
data(dataHBMEbetaNS)
data(dataHBMEbetaNS)
A data frame with 30 rows and 8 variables:
Y
direct estimation of Y.
x1
auxiliary variable of x1.
x2
auxiliary variable of x2.
x3
auxiliary variable of x3.
x4
auxiliary variable of x4.
vardir
sampling variances of Y.
v.x1
mean squared error of x1.
v.x2
mean squared error of x2.
This function is implemented to variable of interest that assumed to be a Beta Distribution when auxiliary variable is measured with error. The range of data must be
. The data proportion is supposed to be implemented with this function.
meHBbeta( formula, var.x, coef, var.coef, iter.update = 3, iter.mcmc = 10000, thin = 2, tau.u = 1, burn.in = 2000, data )
meHBbeta( formula, var.x, coef, var.coef, iter.update = 3, iter.mcmc = 10000, thin = 2, tau.u = 1, burn.in = 2000, data )
formula |
an object of class |
var.x |
vector containing mean squared error of |
coef |
a vector contains prior initial value of Coefficient of Regression Model for fixed effect with default vector of |
var.coef |
a vector contains prior initial value of variance of Coefficient of Regression Model with default vector of |
iter.update |
number of updates with default |
iter.mcmc |
number of total iterations per chain with default |
thin |
thinning rate, must be a positive integer with default |
tau.u |
prior initial value of inverse of Variance of area random effect with default |
burn.in |
burn.in number of iterations to discard at the beginning with default |
data |
the data frame. |
This function returns a list with the following objects:
Est |
A vector with the values of Small Area mean Estimates using Hierarchical bayesian method |
refvar |
Estimated random effect variances |
coefficient |
A data frame with the estimated model coefficient |
plot |
Trace, Dencity, Autocorrelation Function Plot of MCMC samples |
## it may take time ## Load dataset data(dataHBMEbeta) ## Auxiliary variables only contains variable with error in aux variable example <- meHBbeta(Y~x1+x2, var.x = c("v.x1","v.x2"), iter.update = 3, iter.mcmc = 1010, thin = 1, burn.in = 1000, data = dataHBMEbeta) ## you can use dataHBMEbetaNS for using dataset with non-sampled area ## and you can use this function for aux variables contains variable with error and without error
## it may take time ## Load dataset data(dataHBMEbeta) ## Auxiliary variables only contains variable with error in aux variable example <- meHBbeta(Y~x1+x2, var.x = c("v.x1","v.x2"), iter.update = 3, iter.mcmc = 1010, thin = 1, burn.in = 1000, data = dataHBMEbeta) ## you can use dataHBMEbetaNS for using dataset with non-sampled area ## and you can use this function for aux variables contains variable with error and without error
Implementation of small area estimation using Hierarchical Bayesian (HB) Method when auxiliary variable measured with error under Beta Distribution. The 'rjags' package is employed to obtain parameter estimates.
Azka Ubaidillah, Ratih Rodliyah
Ratih Rodliyah [email protected]
meHBbeta
Produces HB estimators, standard error, random effect variance, coefficient and plot under beta distribution.
Rao, J.N.K & Molina. (2015). Small Area Estimation 2nd Edition. New York: John Wiley and Sons, Inc doi:10.1002/9781118735855.
Ybarra, L.M. and Lohr, S. L. (2008). Small area estimation when auxiliary information is measured with error. Biometrika 95, 919-931 doi:10.1093/biomet/asn048.
Ntzoufras, I. (2009), Bayesian Modeling Using WinBUGS. 1st Edn., Wiley, New Jersey, ISBN-10: 1118210352.