Package 'saeME'

Title: Small Area Estimation with Measurement Error
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>.
Authors: Azka Ubaidillah [aut], Muhammad Rifqi Mubarak [aut, cre]
Maintainer: Muhammad Rifqi Mubarak <[email protected]>
License: GPL-2
Version: 1.3.1
Built: 2024-12-13 06:32:09 UTC
Source: CRAN

Help Index


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 [email protected]

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 [email protected]

Authors:

References

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


dataME

Description

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

  1. Generate xix_{i} from a UNIF(5, 10) distribution, ψi\psi_{i} = 3, cic_{i} = 0.25, and σv2\sigma_{v}^{2} = 2.

  2. Generate uiu_{i} from a N(0, cic_{i}) distribution, eie_{i} from a N(0, ψi\psi_{i}) distribution, and viv_{i} from a N(0, σv2\sigma_{v}^{2}) distribution.

  3. Generate x^i\hat{x}_{i} = xix_{i} + uiu_{i}.

  4. Then for each iteration, we generated YiY_{i} = 2+0.5x^i+vi2 + 0.5 \hat{x}_{i} + v_{i} and yiy_{i} = Yi+eiY_{i} + e_{i}.

Direct estimator y, auxiliary variable x^\hat{x}, sampling variance ψ\psi, and cc 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 x1ix_{1i} from a UNIF(5, 10) distribution, x2ix_{2i} from a UNIF(9, 11) distribution, ψi\psi_{i} = 3, c1ic_{1i} = c2ic_{2i} = 0.25, and σv2\sigma_{v}^{2} = 2.

  2. Generate u1iu_{1i} from a N(0, c1ic_{1i}) distribution, u2iu_{2i} from a N(0, c2ic_{2i}) distribution, eie_{i} from a N(0, ψi\psi_{i}) distribution, and viv_{i} from a N(0, σv2\sigma_{v}^{2}) distribution.

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

  4. Generate x^1i\hat{x}_{1i} = x1ix_{1i} + u1iu_{1i} and x^2i\hat{x}_{2i} = x2ix_{2i} + u2iu_{2i}.

  5. Then for each iteration, we generated YiY_{i} = 2+0.5x^1i+0.5x^2i+2x3i+0.5x4i+vi2 + 0.5 \hat{x}_{1i} + 0.5 \hat{x}_{2i} + 2 x_{3i} + 0.5 x_{4i} + v_{i} and yiy_{i} = Yi+eiY_{i} + e_{i}.

This data contain combination between auxiliary variable measured with error and without error. Direct estimator y, auxiliary variable x^1\hat{x}_{1} x^2\hat{x}_{2} x3x_{3} x4x_{4}, sampling variance ψ\psi, and c1c2c_{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


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:

  • method : type of fitting method.

  • convergence : a logical value of convergence when calculating estimated beta and estimated random effects.

  • iterations : number of iterations when calculating estimated beta and estimated random effects.

  • estcoef : a data frame with the estimated model coefficient (beta) in the first column, their standard error (std.error) in the second column, the t-statistics (t.statistics) in the third column, and the p-values of the significance of each coefficient (pvalue) in the last column.

  • refvar : a value of estimated random effects.

  • gamma : vector with values of the estimated gamma for each domains.

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)

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)