Title: | Multivariate Fay Herriot Models for Small Area Estimation |
---|---|
Description: | Implements multivariate Fay-Herriot models for small area estimation. It uses empirical best linear unbiased prediction (EBLUP) estimator. Multivariate models consider the correlation of several target variables and borrow strength from auxiliary variables to improve the effectiveness of a domain sample size. Models which accommodated by this package are univariate model with several target variables (model 0), multivariate model (model 1), autoregressive multivariate model (model 2), and heteroscedastic autoregressive multivariate model (model 3). Functions provide EBLUP estimators and mean squared error (MSE) estimator for each model. These models were developed by Roberto Benavent and Domingo Morales (2015) <doi:10.1016/j.csda.2015.07.013>. |
Authors: | Novia Permatasari, Azka Ubaidillah |
Maintainer: | Novia Permatasari <[email protected]> |
License: | GPL-2 |
Version: | 0.1.5 |
Built: | 2024-11-23 06:43:42 UTC |
Source: | CRAN |
This data is generated based on multivariate Fay-Herriot model (model 1) by these following steps:
Generate sampling error e
, random effect u
, and auxiliary variables X1 X2
.
For sampling error e
, we set ~
, where
, with
~
,
~
,
~
, and
= 0.5.
For random effect u
, we set ~
, where
= 0.2 ,
= 0.4 , and
= 1.2.
For auxiliary variables X1 and X2
, we set ~
and
~
.
Calculate direct estimation Y1 Y2 and Y3
, where =
. We take
and
.
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 datasae1.
datasae1
datasae1
A data frame with 50 rows and 11 variables:
Auxiliary variable of X1
Auxiliary variable of X2
Direct Estimation of Y1
Direct Estimation of Y2
Direct Estimation of Y3
Sampling Variance of Y1
Sampling Covariance of Y1 and Y2
Sampling Covariance of Y1 and Y3
Sampling Variance of Y2
Sampling Covariance of Y2 and Y3
Sampling Variance of Y3
Benavent, Roberto & Morales, Domingo. (2015). Multivariate Fay-Herriot models for small area estimation. Computational Statistics & Data Analysis. 100. 372-390. DOI: 10.1016/j.csda.2015.07.013.
This data is generated based on autoregressive multivariate Fay-Herriot model (model 2) by following these steps:
Generate sampling error e
, random effect u
, and auxiliary variables X1 X2
.
For sampling error e
, we set ~
, where
, with
= 0.1 ,
= 0.2 ,
= 0.3 , and
= 0.5.
For random effect u
, we set ~
, where
= 0.4, and
= 0.8.
For auxiliary variables X1 and X2
, we set ~
and
~
.
Calculate direct estimation Y1 Y2 and Y3
, where =
. We take
and
.
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 datasae2.
datasae2
datasae2
A data frame with 50 rows and 11 variables:
Auxiliary variable of X1
Auxiliary variable of X2
Direct Estimation of Y1
Direct Estimation of Y2
Direct Estimation of Y3
Sampling Variance of Y1
Sampling Covariance of Y1 and Y2
Sampling Covariance of Y1 and Y3
Sampling Variance of Y2
Sampling Covariance of Y2 and Y3
Sampling Variance of Y3
Benavent, Roberto & Morales, Domingo. (2015). Multivariate Fay-Herriot models for small area estimation. Computational Statistics & Data Analysis. 100. 372-390. DOI: 10.1016/j.csda.2015.07.013.
This data is generated based on heteroscedastic autoregressive multivariate Fay-Herriot model (model 3) by following these steps:
Generate sampling error e
, random effect u
, and auxiliary variables X1 X2
.
For sampling error e
, we set ~
, where
, with
= 0.1 ,
= 0.2 ,
= 0.3 , and
= 0.5.
For random effect u
, we set ~
, where
= 0.2 ,
= 0.4 ,
= 1.2, and
= 0.8.
For auxiliary variables X1 and X2
, we set ~
and
~
.
Calculate direct estimation Y1 Y2 and Y3
, where =
. We take
and
.
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 datasae3.
datasae3
datasae3
A data frame with 50 rows and 11 variables:
Auxiliary variable of X1
Auxiliary variable of X2
Direct Estimation of Y1
Direct Estimation of Y2
Direct Estimation of Y3
Sampling Variance of Y1
Sampling Covariance of Y1 and Y2
Sampling Covariance of Y1 and Y3
Sampling Variance of Y2
Sampling Covariance of Y2 and Y3
Sampling Variance of Y3
Benavent, Roberto & Morales, Domingo. (2015). Multivariate Fay-Herriot models for small area estimation. Computational Statistics & Data Analysis. 100. 372-390. DOI: 10.1016/j.csda.2015.07.013.
This function transforms dataframe contains sampling variance to block diagonal matrix R
df2matR(var.df, r)
df2matR(var.df, r)
var.df |
dataframe of sampling variances of direct estimators. |
r |
number of variables |
Block diagonal matrix R
NULL
NULL
This function gives the EBLUP and MSE based on a multivariate Fay-Herriot model (model 1)
eblupMFH1( formula, vardir, samevar = FALSE, MAXITER = 100, PRECISION = 1e-04, data )
eblupMFH1( formula, vardir, samevar = FALSE, MAXITER = 100, PRECISION = 1e-04, data )
formula |
an object of class list of formula, describe the model to be fitted |
vardir |
if data is available, it is vector containing name of sampling variances of direct estimators. if not, it is data frame of sampling variances of direct estimators. The order is : |
samevar |
logical input, true if variances of the data are same, Default: |
MAXITER |
maximum number of iterations allowed in the Fisher-scoring algorithm, Default: |
PRECISION |
convergence tolerance limit for the Fisher-scoring algorithm, Default: |
data |
dataframe containing the variables named in |
The function returns a list with the following objects:
a dataframe with the values of the EBLUP estimators
a dataframe with the estimated mean squared errors of the EBLUPs for the small domains
a dataframe with the values of the random effect estimators
a block diagonal matrix composed of sampling errors
a list containing the following objects:
method : type of fitting method, named "REML"
convergence : a logical value of convergence of Fisher Scoring algorithm
iterations : number of iterations performed by Fisher-Scoring algorithm
estcoef : a dataframe with the estimated model coefficient in the first column, their standard error in the second column, the t statistics in the third column, and the p-values of the significance of each coefficient in the last column
refvar : a dataframe with the estimated random effect variance
informationFisher : a matrix of information Fisher of Fisher-Scoring algorithm
## Load dataset data(datasae1) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 1 # using auxiliary variables X1 and X2 for each dependent variable ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") m1 <- eblupMFH1(Fo, vardir, data=datasae1) ## Without parameter 'data' Fo <- list(f1=datasae1$Y1~datasae1$X1+datasae1$X2, f2=datasae1$Y2~datasae1$X1+datasae1$X2, f3=datasae1$Y3~datasae1$X1+datasae1$X2) vardir <- datasae1[,c("v1", "v2", "v3", "v12", "v13", "v23")] m1 <- eblupMFH1(Fo, vardir) m1$eblup # see the EBLUP estimators m1$MSE # see MSE of EBLUP estimators
## Load dataset data(datasae1) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 1 # using auxiliary variables X1 and X2 for each dependent variable ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") m1 <- eblupMFH1(Fo, vardir, data=datasae1) ## Without parameter 'data' Fo <- list(f1=datasae1$Y1~datasae1$X1+datasae1$X2, f2=datasae1$Y2~datasae1$X1+datasae1$X2, f3=datasae1$Y3~datasae1$X1+datasae1$X2) vardir <- datasae1[,c("v1", "v2", "v3", "v12", "v13", "v23")] m1 <- eblupMFH1(Fo, vardir) m1$eblup # see the EBLUP estimators m1$MSE # see MSE of EBLUP estimators
This function gives the EBLUP and MSE based on a autoregressive multivariate Fay-Herriot model (model 2).
eblupMFH2(formula, vardir, MAXITER = 100, PRECISION = 1e-04, data)
eblupMFH2(formula, vardir, MAXITER = 100, PRECISION = 1e-04, data)
formula |
an object of class list of formula, describe the model to be fitted |
vardir |
if data is available, it is vector containing name of sampling variances of direct estimators. if not, it is data frame of sampling variances of direct estimators. The order is : |
MAXITER |
maximum number of iterations allowed in the Fisher-scoring algorithm, Default: |
PRECISION |
convergence tolerance limit for the Fisher-scoring algorithm, Default: |
data |
dataframe containing the variables named in |
The function returns a list with the following objects:
a dataframe with the values of the EBLUP estimators
a dataframe with the estimated mean squared errors of the EBLUPs for the small domains
a dataframe with the values of the random effect estimators
a block diagonal matrix composed of sampling errors
a list containing the following objects:
method : type of fitting method, named "REML"
convergence : a logical value of convergence of Fisher Scoring algorithm
iterations : number of iterations performed by Fisher-Scoring algorithm
estcoef : a dataframe with the estimated model coefficient in the first column, their standard error in the second column, the t statistics in the third column, and the p-values of the significance of each coefficient in the last column
refvar : a dataframe with the estimated random effect variance
rho : a dataframe with the estimated rho of random effect variance and their rho parameter test based on Model 2
informationFisher : a matrix of information Fisher of Fisher-Scoring algorithm
## Load dataset data(datasae2) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 2 # using auxiliary variables X1 and X2 for each dependent variable ## Without parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") m2 <- eblupMFH2(Fo, vardir, data=datasae2) ## Without parameter 'data' Fo <- list(f1=datasae2$Y1~datasae2$X1+datasae2$X2, f2=datasae2$Y2~datasae2$X1+datasae2$X2, f3=datasae2$Y3~datasae2$X1+datasae2$X2) vardir <- datasae2[,c("v1", "v2", "v3", "v12", "v13", "v23")] m2 <- eblupMFH2(Fo, vardir) m2$eblup # see the EBLUP estimators m2$MSE # see MSE of EBLUP estimators
## Load dataset data(datasae2) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 2 # using auxiliary variables X1 and X2 for each dependent variable ## Without parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") m2 <- eblupMFH2(Fo, vardir, data=datasae2) ## Without parameter 'data' Fo <- list(f1=datasae2$Y1~datasae2$X1+datasae2$X2, f2=datasae2$Y2~datasae2$X1+datasae2$X2, f3=datasae2$Y3~datasae2$X1+datasae2$X2) vardir <- datasae2[,c("v1", "v2", "v3", "v12", "v13", "v23")] m2 <- eblupMFH2(Fo, vardir) m2$eblup # see the EBLUP estimators m2$MSE # see MSE of EBLUP estimators
This function gives the EBLUP and MSE based on a heteroscedastic autoregressive multivariate Fay-Herriot model (model 3).
eblupMFH3(formula, vardir, MAXITER = 100, PRECISION = 1e-04, data)
eblupMFH3(formula, vardir, MAXITER = 100, PRECISION = 1e-04, data)
formula |
an object of class list of formula, describe the model to be fitted |
vardir |
if data is available, it is vector containing name of sampling variances of direct estimators. if not, it is data frame of sampling variances of direct estimators. The order is : |
MAXITER |
maximum number of iterations allowed in the Fisher-scoring algorithm, Default: |
PRECISION |
convergence tolerance limit for the Fisher-scoring algorithm, Default: |
data |
dataframe containing the variables named in |
The function returns a list with the following objects:
a dataframe with the values of the EBLUP estimators
a dataframe with the estimated mean squared errors of the EBLUPs for the small domains
a dataframe with the values of the random effect estimators
a block diagonal matrix composed of sampling errors
a list containing the following objects:
method : type of fitting method, named "REML"
convergence : a logical value of convergence of Fisher Scoring algorithm
iterations : number of iterations performed by Fisher-Scoring algorithm
estcoef : a dataframe with the estimated model coefficient in the first column, their standard error in the second column, the t statistics in the third column, and the p-values of the significance of each coefficient in the last column
refvar : a dataframe with the estimated random effect variance
refvarTest : homogeneity of random effect variance test based on Model 3
rho : a dataframe with the estimated rho of random effect variance and their rho parameter test based on Model 2
informationFisher : a matrix of information Fisher of Fisher-Scoring algorithm
## Load dataset data(datasae3) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 3 # using auxiliary variables X1 and X2 for each dependent variable ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") m3 <- eblupMFH3(Fo, vardir, data=datasae3) ## Without parameter 'data' Fo <- list(f1=datasae3$Y1~datasae3$X1+datasae3$X2, f2=datasae3$Y2~datasae3$X1+datasae3$X2, f3=datasae3$Y3~datasae3$X1+datasae3$X2) vardir <- datasae3[,c("v1", "v2", "v3", "v12", "v13", "v23")] m3 <- eblupMFH3(Fo, vardir) m3$eblup # see the EBLUP estimators m3$MSE # see MSE of EBLUP estimators
## Load dataset data(datasae3) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 3 # using auxiliary variables X1 and X2 for each dependent variable ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") m3 <- eblupMFH3(Fo, vardir, data=datasae3) ## Without parameter 'data' Fo <- list(f1=datasae3$Y1~datasae3$X1+datasae3$X2, f2=datasae3$Y2~datasae3$X1+datasae3$X2, f3=datasae3$Y3~datasae3$X1+datasae3$X2) vardir <- datasae3[,c("v1", "v2", "v3", "v12", "v13", "v23")] m3 <- eblupMFH3(Fo, vardir) m3$eblup # see the EBLUP estimators m3$MSE # see MSE of EBLUP estimators
This function gives the EBLUP and MSE based on a univariate Fay Herriot model (model 0)
eblupUFH( formula, vardir, samevar = FALSE, MAXITER = 100, PRECISION = 1e-04, data )
eblupUFH( formula, vardir, samevar = FALSE, MAXITER = 100, PRECISION = 1e-04, data )
formula |
an object of class list of formula, describe the model to be fitted |
vardir |
if data is available, it is vector containing name of sampling variances of direct estimators. if not, it is data frame of sampling variances of direct estimators. The order is : |
samevar |
logical input, true if variance of the data is same, Default: |
MAXITER |
maximum number of iterations allowed in the Fisher-scoring algorithm, Default: |
PRECISION |
convergence tolerance limit for the Fisher-scoring algorithm, Default: |
data |
dataframe containing the variables named in |
The function returns a list with the following objects:
a dataframe with the values of the EBLUP estimators
a dataframe with the estimated mean squared errors of the EBLUPs for the small domains
a dataframe with the values of the random effect estimators
a block diagonal matrix composed of sampling errors
a list containing the following objects:
method : type of fitting method, named "REML"
convergence : a logical value of convergence of Fisher Scoring algorithm
iterations : number of iterations performed by Fisher-Scoring algorithm
estcoef : a dataframe with the estimated model coefficient in the first column, their standard error in the second column, the t statistics in the third column, and the p-values of the significance of each coefficient in the last column
refvar : a dataframe with the estimated random effect variance
informationFisher : a matrix of information Fisher of Fisher-Scoring algorithm
## Load dataset data(datasae1) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 0 # using auxiliary variables X1 and X2 for each dependent variable ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") un <- eblupUFH(Fo, vardir, data=datasae1) ## Without parameter 'data' Fo <- list(f1=datasae1$Y1~datasae1$X1+datasae1$X2, f2=datasae1$Y2~datasae1$X1+datasae1$X2, f3=datasae1$Y3~datasae1$X1+datasae1$X2) vardir <- datasae1[,c("v1", "v2", "v3", "v12", "v13", "v23")] un <- eblupUFH(Fo, vardir) un$eblup # see the EBLUP estimators un$MSE # see MSE of EBLUP estimators
## Load dataset data(datasae1) # Compute EBLUP and MSE of Y1 Y2 and Y3 based on Model 0 # using auxiliary variables X1 and X2 for each dependent variable ## Using parameter 'data' Fo <- list(f1=Y1~X1+X2, f2=Y2~X1+X2, f3=Y3~X1+X2) vardir <- c("v1", "v2", "v3", "v12", "v13", "v23") un <- eblupUFH(Fo, vardir, data=datasae1) ## Without parameter 'data' Fo <- list(f1=datasae1$Y1~datasae1$X1+datasae1$X2, f2=datasae1$Y2~datasae1$X1+datasae1$X2, f3=datasae1$Y3~datasae1$X1+datasae1$X2) vardir <- datasae1[,c("v1", "v2", "v3", "v12", "v13", "v23")] un <- eblupUFH(Fo, vardir) un$eblup # see the EBLUP estimators un$MSE # see MSE of EBLUP estimators
Implements multivariate Fay-Herriot models for small area estimation. It uses empirical best linear unbiased prediction (EBLUP) estimator. Multivariate models consider the correlation of several target variable and borrow strength from auxiliary variables to improve the effectiveness of a domain sample size. Models which accommodated by this package are univariate model with several target variables (model 0), multivariate model (model 1), autoregressive multivariate model (model 2), and heteroscedastic autoregressive multivariate model (model 3). Functions provide EBLUP estimators and mean squared error (MSE) estimator for each model. These models were developed by Roberto Benavent and Domingo Morales (2015) <doi:10.1016/j.csda.2015.07.013>.
Novia Permatasari, Azka Ubaidillah
Maintainer: Novia Permatasari [email protected]
eblupUFH
Gives the EBLUPs and MSE of Univariate SAE (Model 0)
eblupMFH1
Gives the EBLUPs and MSE of Multivariate SAE (Model 1)
eblupMFH2
Gives the EBLUPs and MSE of Autoregressive Multivariate SAE (Model 2)
eblupMFH3
Gives the EBLUPs and MSE of Heteroscedastics Autoregressive Multivariate SAE (Model 3)
Benavent, Roberto & Morales, Domingo. (2015). Multivariate Fay-Herriot models for small area estimation. Computational Statistics & Data Analysis. 100. 372-390. DOI: 10.1016/j.csda.2015.07.013.
Rao, J.N.K & Molina. (2015). Small Area Estimation 2nd Edition. New York: John Wiley and Sons, Inc.
Ubaidillah, Azka et al. (2019). Multivariate Fay-Herriot models for small area estimation with application to household consumption per capita expenditure in Indonesia. Journal of Applied Statistics. 46:15. 2845-2861. DOI: 10.1080/02664763.2019.1615420.