eblupfh_cluster {saens} | R Documentation |
EBLUPs based on a Fay-Herriot Model with Cluster Information.
Description
This function gives the Empirical Best Linear Unbiased Prediction (EBLUP) or Empirical Best (EB) predictor based on a Fay-Herriot model with cluster information for non-sampled areas.
Usage
eblupfh_cluster(
formula,
data,
vardir,
cluster,
method = "REML",
maxiter = 100,
precision = 1e-04,
scale = FALSE,
print_result = TRUE
)
Arguments
formula |
an object of class formula that contains a description of the model to be fitted. The variables included in the formula must be contained in the data. |
data |
a data frame or a data frame extension (e.g. a tibble). |
vardir |
vector or column names from data that contain variance sampling from the direct estimator for each area. |
cluster |
vector or column name from data that contain cluster information. |
method |
Fitting method can be chosen between 'ML' and 'REML' |
maxiter |
maximum number of iterations allowed in the Fisher-scoring algorithm. Default is 100 iterations. |
precision |
convergence tolerance limit for the Fisher-scoring algorithm. Default value is 0.0001. |
scale |
scaling auxiliary variable or not, default value is FALSE. |
print_result |
print coefficient or not, default value is TRUE. |
Details
The model has a form that is response ~ auxiliary variables. where numeric type response variables can contain NA. When the response variable contains NA it will be estimated with cluster information.
Value
The function returns a list with the following objects df_res
and fit
:
df_res
a data frame that contains the following columns:
-
y
variable response
-
eblup
estimated results for each area
-
random_effect
random effect for each area
-
vardir
variance sampling from the direct estimator for each area
-
mse
Mean Square Error
-
cluster
cluster information for each area
-
rse
Relative Standart Error (%)
fit
a list containing the following objects:
-
estcoef
a data frame with the estimated model coefficients in the first column (beta), their asymptotic standard errors in the second column (std.error), the t-statistics in the third column (tvalue) and the p-values of the significance of each coefficient in last column (pvalue)
-
model_formula
model formula applied
-
method
type of fitting method applied (ML
orREML
)
-
random_effect_var
estimated random effect variance
-
convergence
logical value that indicates the Fisher-scoring algorithm has converged or not
-
n_iter
number of iterations performed by the Fisher-scoring algorithm.
-
goodness
vector containing several goodness-of-fit measures: loglikehood, AIC, and BIC
References
Rao, J. N., & Molina, I. (2015). Small area estimation. John Wiley & Sons.
Anisa, R., Kurnia, A., & Indahwati, I. (2013). Cluster information of non-sampled area in small area estimation. E-Prosiding Internasional| Departemen Statistika FMIPA Universitas Padjadjaran, 1(1), 69-76.
Examples
library(saens)
m1 <- eblupfh_cluster(y ~ x1 + x2 + x3, data = mys, vardir = "var", cluster = "clust")
m1 <- eblupfh_cluster(y ~ x1 + x2 + x3, data = mys, vardir = ~var, cluster = ~clust)