Title: | Multivariate Small Area Estimation using Hierarchical Bayesian Method |
---|---|
Description: | Implements area level of multivariate small area estimation using Hierarchical Bayesian method under Normal and T distribution. The 'rjags' package is employed to obtain parameter estimates. For the reference, see Rao and Molina (2015) <doi:10.1002/9781118735855>. |
Authors: | Azka Ubaidillah [aut], Novia Permatasari [aut, cre] |
Maintainer: | Novia Permatasari <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-12-25 06:32:03 UTC |
Source: | CRAN |
Dataset to simulate Small Area Estimation using Hierarchical Bayesian Method under Multivariate Normal distribution
This data is generated by these following steps:
Generate sampling error e
, random effect u
, and auxiliary variables X1 X2
.
For sampling error e
, we set ~
, where
, with
~
and
= 0.5.
For random effect u
, we set ~
.
For auxiliary variables X1 and X2
, we set ~
and
~
.
Calculate direct estimation Y1 Y2 and Y3
, where =
. We take
and
.
Auxiliary variables X1 X2
, direct estimation Y1 Y2 Y3
, and sampling variance-covariance v1 v2 v3 v12 v13 v23
are combined into a dataframe called datasaeNorm
datasaeNorm
datasaeNorm
A data frame with 30 rows and 11 variables:
Auxiliary variable of X1
Auxiliary variable of X2
Direct Estimation of Y1
Direct Estimation of Y2
Direct Estimation of Y3
Sampling Variance of Y1
Sampling Covariance of Y1 and Y2
Sampling Covariance of Y1 and Y3
Sampling Variance of Y2
Sampling Covariance of Y2 and Y3
Sampling Variance of Y3
Dataset to simulate Small Area Estimation using Hierarchical Bayesian Method under Multivariate T distribution
This data is generated by these following steps:
Generate sampling error e
, random effect u
, and auxiliary variables X1 X2
.
For sampling error e
, we set is multivariate T distributed where the vector of noncentrality parameters is zero, scale matrix
, with
~
and
= 0.5, and degree of freedom
~
.
For random effect u
, we set ~
.
For auxiliary variables X1 and X2
, we set ~
and
~
.
Calculate direct estimation Y1 Y2 and Y3
, where =
. We take
and
.
Auxiliary variables X1 X2
, direct estimation Y1 Y2 Y3
, and sampling variance-covariance v1 v2 v3 v12 v13 v23
are combined into a dataframe called datasaeT
datasaeT
datasaeT
A data frame with 30 rows and 11 variables:
Auxiliary variable of X1
Auxiliary variable of X2
Direct Estimation of Y1
Direct Estimation of Y2
Direct Estimation of Y3
Sampling Variance of Y1
Sampling Covariance of Y1 and Y2
Sampling Covariance of Y1 and Y3
Sampling Variance of Y2
Sampling Covariance of Y2 and Y3
Sampling Variance of Y3
This function transforms dataframe contains sampling variance to a diagonal matrix R
df2R(R, r)
df2R(R, r)
R |
dataframe of sampling variances of direct estimators. |
r |
number of variables |
Block diagonal matrix R
NULL
NULL
This function implements small area estimation using hierarchical bayesian to variable of interest that assumed to be a multivariate normal distribution.
mHBNormal( formula, vardir, iter.update = 3, iter.mcmc = 10000, thin = 2, burn.in = 2000, data )
mHBNormal( formula, vardir, iter.update = 3, iter.mcmc = 10000, thin = 2, burn.in = 2000, data )
formula |
an object of class list of formula, describe the model to be fitted |
vardir |
vector containing name of sampling variances of direct estimators in the following order : |
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 |
burn.in |
number of iterations to discard at the beginning with default |
data |
dataframe containing the variables named in |
The function returns a list with the following objects:
A vector with the values of Small Area mean Estimates using Hierarchical bayesian method
A dataframe with the estimated model coefficient
Trace, Density, Autocorrelation Function Plot of MCMC samples
## Load dataset data(datasaeNorm) ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2) vardir <- c("v1", "v2", "v12") m1 <- mHBNormal(formula=Fo, vardir=vardir, iter.update = 1, iter.mcmc = 1000, thin = 2, burn.in = 200, data=datasaeNorm)
## Load dataset data(datasaeNorm) ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2) vardir <- c("v1", "v2", "v12") m1 <- mHBNormal(formula=Fo, vardir=vardir, iter.update = 1, iter.mcmc = 1000, thin = 2, burn.in = 200, data=datasaeNorm)
This function implements small area estimation using hierarchical bayesian to variable of interest that assumed to be a multivariate T distribution.
mHBT( formula, vardir, iter.update = 3, iter.mcmc = 10000, thin = 2, burn.in = 2000, data )
mHBT( formula, vardir, iter.update = 3, iter.mcmc = 10000, thin = 2, burn.in = 2000, data )
formula |
an object of class list of formula, describe the model to be fitted |
vardir |
vector containing name of sampling variances of direct estimators in the following order : |
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 |
burn.in |
number of iterations to discard at the beginning with default |
data |
dataframe containing the variables named in |
The function returns a list with the following objects:
A vector with the values of Small Area mean Estimates using Hierarchical bayesian method
A dataframe with the estimated model coefficient
Trace, Density, Autocorrelation Function Plot of MCMC samples
## Load dataset data(datasaeT) ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2) vardir <- c("v1", "v2", "v12") m1 <- mHBT(formula=Fo, vardir=vardir, iter.update = 1, iter.mcmc = 1000, thin = 2, burn.in = 200, data=datasaeT)
## Load dataset data(datasaeT) ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2) vardir <- c("v1", "v2", "v12") m1 <- mHBT(formula=Fo, vardir=vardir, iter.update = 1, iter.mcmc = 1000, thin = 2, burn.in = 200, data=datasaeT)
Implements area level of multivariate small area estimation using hierarchical Bayesian (HB) method under Normal and T distribution. The 'rjags' package is employed to obtain parameter estimates. For the reference, see Rao and Molina (2015) <doi:10.1002/9781118735855>.
Azka Ubaidillah [email protected] and Novia Permatasari [email protected]
Maintainer: Novia Permatasari [email protected]
mHBNormal
Estimate multivariate small area estimation under normal distribution
mHBT
Estimate multivariate small area estimation under normal distribution
Rao, J.N.K & Molina. (2015). Small Area Estimation 2nd Edition. New York: John Wiley and Sons, Inc. <doi:10.1002/9781118735855>.