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
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:
Azka Ubaidillah azka@stis.ac.id
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 |
vardir |
vector containing the |
var.x |
vector containing mean squared error of |
type.x |
type of auxiliary variable used in the model. Either source measured with |
MAXITER |
maximum number of iterations allowed. Default value is |
PRECISION |
convergence tolerance limit. Default value is |
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
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:
Generate
x_{i}
from a UNIF(5, 10) distribution,\psi_{i}
= 3,c_{i}
= 0.25, and\sigma_{v}^{2}
= 2.Generate
u_{i}
from a N(0,c_{i}
) distribution,e_{i}
from a N(0,\psi_{i}
) distribution, andv_{i}
from a N(0,\sigma_{v}^{2}
) distribution.Generate
\hat{x}_{i}
=x_{i}
+u_{i}
.Then for each iteration, we generated
Y_{i}
=2 + 0.5 \hat{x}_{i} + v_{i}
andy_{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:
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.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, andv_{i}
from a N(0,\sigma_{v}^{2}
) distribution.Generate
x_{3i}
from a UNIF(1, 5) distribution andx_{4i}
from a UNIF(10, 14) distribution.Generate
\hat{x}_{1i}
=x_{1i}
+u_{1i}
and\hat{x}_{2i}
=x_{2i}
+u_{2i}
.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}
andy_{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 |
vardir |
vector containing the |
var.x |
vector containing mean squared error of |
type.x |
type of auxiliary variable used in the model. Either source measured with |
MAXITER |
maximum number of iterations allowed. Default value is |
PRECISION |
convergence tolerance limit. Default value is |
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)