Title: Small Area Estimation with Measurement Error
Type: Package
Version: 1.3.1
Maintainer: Muhammad Rifqi Mubarak <rifqi.mubarak@bps.go.id>
Description: A set of functions and datasets implementation of small area estimation when auxiliary variable is measured with error. These functions provide a empirical best linear unbiased prediction (EBLUP) estimator and mean squared error (MSE) estimator of the EBLUP. These models were developed by Ybarra and Lohr (2008) <doi:10.1093/biomet/asn048>.
License: GPL-2
Depends: R (≥ 3.1.0)
Encoding: UTF-8
Imports: MASS, stats
LazyData: true
RoxygenNote: 7.2.3
NeedsCompilation: no
Packaged: 2023-08-21 01:06:32 UTC; user
Author: Azka Ubaidillah [aut], Muhammad Rifqi Mubarak [aut, cre]
Repository: CRAN
Date/Publication: 2023-08-21 04:10:02 UTC

saeME: Small Area Estimation with Measurement Error

Description

The sae with measurement error provides function for small area estimation when auxiliary variable is measured with error, and function for mean squared error estimation using jackknife method. This package implement model of Fay Herriot with Measurement Error developed by Ybarra and Lohr (2008).

Authors

Muhammad Rifqi Mubarak, Azka Ubaidillah

Email

Muhammad Rifqi Mubarak 16.9304@stis.ac.id

Functions

FHme

Gives the EBLUP for each domain based on Fay-Herriot with measurement error model.

mse_FHme

Gives the MSE for each domain using the jackknife method.

Author(s)

Maintainer: Muhammad Rifqi Mubarak rifqi.mubarak@bps.go.id

Authors:

References

Ybarra, L.M. and Lohr, S. L. (2008). Small area estimation when auxiliary information is measured with error. Biometrika 95, 919-931.


Fay-Herriot Model with Measurement Error

Description

This function gives the EBLUP estimator based on Fay-Herriot model with measurement error.

Usage

FHme(
  formula,
  vardir,
  var.x,
  type.x = "witherror",
  MAXITER = 1000,
  PRECISION = 1e-04,
  data
)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. The variables included formula must have a length equal to the number of domains m. This formula can provide auxiliary variable either measured with error or without error or combination between them. If the auxiliary variable are combination between noerror and witherror variable, input all witherror variable first then noerror variable.

vardir

vector containing the m sampling variances of direct estimators for each domain. The values must be sorted as the Y.

var.x

vector containing mean squared error of X . The values must be sorted as the X. if you use optional data, input this parameter use c(""), example: var.x = c("c1") or var.x = c("c1","c2").

type.x

type of auxiliary variable used in the model. Either source measured with noerror, witherror and mix. Default value is witherror.

MAXITER

maximum number of iterations allowed. Default value is 1000 iterations.

PRECISION

convergence tolerance limit. Default value is 0.0001.

data

optional data frame containing the variables named in formula, vardir, and var.x.

Details

A formula has an implied intercept term. To remove this use either y ~ x - 1 or y ~ 0 + x. See formula for more details of allowed formulae.

Value

The function returns a list with the following objects:

eblup

vector with the values of the estimators for the domains.

fit

a list containing the following objects:

See Also

mse_FHme

Examples

data(dataME)
data(datamix)
sae.me <- FHme(formula = y ~ x.hat, vardir = vardir, var.x = c("var.x"), data = dataME)
sae.mix <- FHme(formula = y ~ x.hat1 + x.hat2 + x3 + x4,
            vardir = vardir, var.x = c("var.x1", "var.x2"), type.x = "mix", data = datamix)


dataME

Description

This data generated by simulation based on Fay-Herriot with Measurement Error Model by following these steps:

  1. Generate x_{i} from a UNIF(5, 10) distribution, \psi_{i} = 3, c_{i} = 0.25, and \sigma_{v}^{2} = 2.

  2. Generate u_{i} from a N(0, c_{i}) distribution, e_{i} from a N(0, \psi_{i}) distribution, and v_{i} from a N(0, \sigma_{v}^{2}) distribution.

  3. Generate \hat{x}_{i} = x_{i} + u_{i}.

  4. Then for each iteration, we generated Y_{i} = 2 + 0.5 \hat{x}_{i} + v_{i} and y_{i} = Y_{i} + e_{i}.

Direct estimator y, auxiliary variable \hat{x}, sampling variance \psi, and c are arranged in a dataframe called dataME.

Usage

data(dataME)

Format

A data frame with 100 observations on the following 4 variables.

small_area

areas of interest.

y

direct estimator for each domain.

x.hat

auxiliary variable for each domain.

vardir

sampling variances for each domain.

var.x

mean squared error of auxiliary variable and sorted as x.hat


datamix

Description

This data generated by simulation based on Fay-Herriot with Measurement Error Model by following these steps:

  1. Generate x_{1i} from a UNIF(5, 10) distribution, x_{2i} from a UNIF(9, 11) distribution, \psi_{i} = 3, c_{1i} = c_{2i} = 0.25, and \sigma_{v}^{2} = 2.

  2. Generate u_{1i} from a N(0, c_{1i}) distribution, u_{2i} from a N(0, c_{2i}) distribution, e_{i} from a N(0, \psi_{i}) distribution, and v_{i} from a N(0, \sigma_{v}^{2}) distribution.

  3. Generate x_{3i} from a UNIF(1, 5) distribution and x_{4i} from a UNIF(10, 14) distribution.

  4. Generate \hat{x}_{1i} = x_{1i} + u_{1i} and \hat{x}_{2i} = x_{2i} + u_{2i}.

  5. Then for each iteration, we generated Y_{i} = 2 + 0.5 \hat{x}_{1i} + 0.5 \hat{x}_{2i} + 2 x_{3i} + 0.5 x_{4i} + v_{i} and y_{i} = Y_{i} + e_{i}.

This data contain combination between auxiliary variable measured with error and without error. Direct estimator y, auxiliary variable \hat{x}_{1} \hat{x}_{2} x_{3} x_{4}, sampling variance \psi, and c_{1} c_{2} are arranged in a dataframe called datamix.

Usage

data(datamix)

Format

A data frame with 100 observations on the following 8 variables.

small_area

areas of interest.

y

direct estimator for each domain.

x.hat1

auxiliary variable (measured with error) for each domain.

x.hat2

auxiliary variable (measured with error) for each domain.

x3

auxiliary variable (measured without error) for each domain.

x4

auxiliary variable (measured without error) for each domain.

vardir

sampling variances for each domain.

var.x1

mean squared error of auxiliary variable and sorted as x.hat1

var.x2

mean squared error of auxiliary variable and sorted as x.hat2


Mean Squared Error Estimator of the EBLUP under a Fay-Herriot Model with Measurement Error

Description

This function gives the mean squared error estimator of the EBLUP based on Fay-Herriot model with measurement error using jackknife method.

Usage

mse_FHme(
  formula,
  vardir,
  var.x,
  type.x = "witherror",
  MAXITER = 1000,
  PRECISION = 1e-04,
  data
)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. The variables included formula must have a length equal to the number of domains m. This formula can provide auxiliary variable either measured with error or without error or combination between them. If the auxiliary variable are combination between noerror and witherror variable, input all witherror variable first then noerror variable.

vardir

vector containing the m sampling variances of direct estimators for each domain. The values must be sorted as the Y.

var.x

vector containing mean squared error of X . The values must be sorted as the X. if you use optional data, input this parameter use c(""), example: var.x = c("c1") or var.x = c("c1","c2").

type.x

type of auxiliary variable used in the model. Either source measured with noerror, witherror and mix. Default value is witherror.

MAXITER

maximum number of iterations allowed. Default value is 1000 iterations.

PRECISION

convergence tolerance limit. Default value is 0.0001.

data

optional data frame containing the variables named in formula, vardir, and var.x.

Details

A formula has an implied intercept term. To remove this use either y ~ x - 1 or y ~ 0 + x. See formula for more details of allowed formulae.

Value

The function returns a list with the following objects:

mse

vector with the values of the mean squared errors of the EBLUPs for each domain.

Examples

data(dataME)
data(datamix)

mse.sae.me <- mse_FHme(formula = y ~ x.hat, vardir = vardir, var.x = c("var.x"), data = dataME)
mse.sae.mix <- mse_FHme(formula = y ~ x.hat1 + x.hat2 + x3 + x4,
                vardir = vardir, var.x = c("var.x1", "var.x2"), type.x = "mix", data = datamix)