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 |
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).
Muhammad Rifqi Mubarak, Azka Ubaidillah
Muhammad Rifqi Mubarak [email protected]
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.
Maintainer: Muhammad Rifqi Mubarak [email protected]
Authors:
Azka Ubaidillah [email protected]
Ybarra, L.M. and Lohr, S. L. (2008). Small area estimation when auxiliary information is measured with error. Biometrika 95, 919-931.
This data generated by simulation based on Fay-Herriot with Measurement Error Model by following these steps:
Generate from a UNIF(5, 10) distribution,
= 3,
= 0.25, and
= 2.
Generate from a N(0,
) distribution,
from a N(0,
) distribution, and
from a N(0,
) distribution.
Generate =
+
.
Then for each iteration, we generated =
and
=
.
Direct estimator y
, auxiliary variable , sampling variance
, and
are arranged in a dataframe called
dataME
.
data(dataME)
data(dataME)
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
This data generated by simulation based on Fay-Herriot with Measurement Error Model by following these steps:
Generate from a UNIF(5, 10) distribution,
from a UNIF(9, 11) distribution,
= 3,
=
= 0.25, and
= 2.
Generate from a N(0,
) distribution,
from a N(0,
) distribution,
from a N(0,
) distribution, and
from a N(0,
) distribution.
Generate from a UNIF(1, 5) distribution and
from a UNIF(10, 14) distribution.
Generate =
+
and
=
+
.
Then for each iteration, we generated =
and
=
.
This data contain combination between auxiliary variable measured with error and without error.
Direct estimator y
, auxiliary variable
, sampling variance
, and
are arranged in a dataframe called
datamix
.
data(datamix)
data(datamix)
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
This function gives the EBLUP estimator based on Fay-Herriot model with measurement error.
FHme( formula, vardir, var.x, type.x = "witherror", MAXITER = 1000, PRECISION = 1e-04, data )
FHme( formula, vardir, var.x, type.x = "witherror", MAXITER = 1000, PRECISION = 1e-04, data )
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. |
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.
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.
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)
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)
This function gives the mean squared error estimator of the EBLUP based on Fay-Herriot model with measurement error using jackknife method.
mse_FHme( formula, vardir, var.x, type.x = "witherror", MAXITER = 1000, PRECISION = 1e-04, data )
mse_FHme( formula, vardir, var.x, type.x = "witherror", MAXITER = 1000, PRECISION = 1e-04, data )
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. |
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.
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.
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)
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)