The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Type: Package
Title: Multivariate Small Area Estimation using Hierarchical Bayesian Method
Version: 0.1.0
Author: Azka Ubaidillah [aut], Novia Permatasari [aut, cre]
Maintainer: Novia Permatasari <novia.permatasari@bps.go.id>
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>.
License: GPL-3
Imports: rjags,coda
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
Depends: R (≥ 2.10)
NeedsCompilation: no
Packaged: 2022-03-09 18:07:07 UTC; Novia
Repository: CRAN
Date/Publication: 2022-03-11 09:50:05 UTC

Sample Data for Small Area Estimation using Hierarchical Bayesian Method under Multivariate Normal distribution

Description

Dataset to simulate Small Area Estimation using Hierarchical Bayesian Method under Multivariate Normal distribution

This data is generated by these following steps:

  1. Generate sampling error e, random effect u, and auxiliary variables X1 X2.

    • For sampling error e, we set e_{d} ~ N_{3}(0, V_{ed}) , where V_{ed} = (\sigma_{dij})_{i,j=1,2,3}, with \sigma_{ii} ~ InvGamma(a, b) and \rho_{e} = 0.5.

    • For random effect u, we set u ~ N_{3}(0, V_{u}).

    • For auxiliary variables X1 and X2, we set X1 ~ UNIF(1,2) and X2 ~ UNIF(1, 10).

  2. Calculate direct estimation Y1 Y2 and Y3 , where Y_{i} = X * \beta + u_{i} + e_{i}. We take \beta_{1} = 1 and \beta_{2} = 1.

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

Usage

datasaeNorm

Format

A data frame with 30 rows and 11 variables:

X1

Auxiliary variable of X1

X2

Auxiliary variable of X2

Y1

Direct Estimation of Y1

Y2

Direct Estimation of Y2

Y3

Direct Estimation of Y3

v1

Sampling Variance of Y1

v12

Sampling Covariance of Y1 and Y2

v13

Sampling Covariance of Y1 and Y3

v2

Sampling Variance of Y2

v23

Sampling Covariance of Y2 and Y3

v3

Sampling Variance of Y3


Sample Data for Small Area Estimation using Hierarchical Bayesian Method under Multivariate T distribution

Description

Dataset to simulate Small Area Estimation using Hierarchical Bayesian Method under Multivariate T distribution

This data is generated by these following steps:

  1. Generate sampling error e, random effect u, and auxiliary variables X1 X2.

    • For sampling error e, we set e_{d} is multivariate T distributed where the vector of noncentrality parameters is zero, scale matrix V_{ed} = (\sigma_{dij})_{i,j=1,2,3}, with \sigma_{ii} ~ InvGamma(a, b) and \rho_{e} = 0.5, and degree of freedom df ~ InvGamma(a, b).

    • For random effect u, we set u ~ N_{3}(0, V_{u}).

    • For auxiliary variables X1 and X2, we set X1 ~ UNIF(1,2) and X2 ~ UNIF(1, 10).

  2. Calculate direct estimation Y1 Y2 and Y3 , where Y_{i} = X * \beta + u_{i} + e_{i}. We take \beta_{1} = 1 and \beta_{2} = 1.

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

Usage

datasaeT

Format

A data frame with 30 rows and 11 variables:

X1

Auxiliary variable of X1

X2

Auxiliary variable of X2

Y1

Direct Estimation of Y1

Y2

Direct Estimation of Y2

Y3

Direct Estimation of Y3

v1

Sampling Variance of Y1

v12

Sampling Covariance of Y1 and Y2

v13

Sampling Covariance of Y1 and Y3

v2

Sampling Variance of Y2

v23

Sampling Covariance of Y2 and Y3

v3

Sampling Variance of Y3


Transform Dataframe to Matrix R

Description

This function transforms dataframe contains sampling variance to a diagonal matrix R

Usage

df2R(R, r)

Arguments

R

dataframe of sampling variances of direct estimators.

r

number of variables

Value

Block diagonal matrix R

Examples

NULL

Multivariate Small Area Estimation using Hierarchical Bayesian under Normal Distribution

Description

This function implements small area estimation using hierarchical bayesian to variable of interest that assumed to be a multivariate normal distribution.

Usage

mHBNormal(
  formula,
  vardir,
  iter.update = 3,
  iter.mcmc = 10000,
  thin = 2,
  burn.in = 2000,
  data
)

Arguments

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 : var1, var2, . , var(k) , cov12, . cov1k, cov23, . , cov(k-1)(k)

iter.update

number of updates with default 3

iter.mcmc

number of total iterations per chain with default 10000

thin

thinning rate, must be a positive integer with default 2

burn.in

number of iterations to discard at the beginning with default 2000

data

dataframe containing the variables named in formula and vardir

Value

The function returns a list with the following objects:

Est

A vector with the values of Small Area mean Estimates using Hierarchical bayesian method

coefficient

A dataframe with the estimated model coefficient

plot

Trace, Density, Autocorrelation Function Plot of MCMC samples

Examples

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


Multivariate Small Area Estimation using Hierarchical Bayesian under T Distribution

Description

This function implements small area estimation using hierarchical bayesian to variable of interest that assumed to be a multivariate T distribution.

Usage

mHBT(
  formula,
  vardir,
  iter.update = 3,
  iter.mcmc = 10000,
  thin = 2,
  burn.in = 2000,
  data
)

Arguments

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 : var1, var2, . , var(k) , cov12, . cov1k, cov23, . , cov(k-1)(k)

iter.update

number of updates with default 3

iter.mcmc

number of total iterations per chain with default 10000

thin

thinning rate, must be a positive integer with default 2

burn.in

number of iterations to discard at the beginning with default 2000

data

dataframe containing the variables named in formula and vardir

Value

The function returns a list with the following objects:

Est

A vector with the values of Small Area mean Estimates using Hierarchical bayesian method

coefficient

A dataframe with the estimated model coefficient

plot

Trace, Density, Autocorrelation Function Plot of MCMC samples

Examples

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


msaeHB : Multivariate Small Area Estimation using Hierarchical Bayesian Method

Description

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

Author(s)

Azka Ubaidillah azka@stis.ac.id and Novia Permatasari novia.permatasari@bps.go.id

Maintainer: Novia Permatasari novia.permatasari@bps.go.id

Functions

mHBNormal

Estimate multivariate small area estimation under normal distribution

mHBT

Estimate multivariate small area estimation under normal distribution

Reference

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.