| Title: | Geoadditive Small Area Estimation for Area-Level Model |
|---|---|
| Description: | Fits area-level geoadditive small area estimation (SAE) models by extending the Fay-Herriot area-level model with linear, nonlinear, and spatial effects. The Fay-Herriot model is described by Fay and Herriot (1979) <doi:10.1080/01621459.1979.10482505>. Geoadditive models combine nonlinear covariate effects and spatial variation as described by Kammann and Wand (2003) <doi:10.1111/1467-9876.00385>, while their application to small area estimation is discussed by Pusponegoro et al. (2019) <doi:10.21108/JDSA.2019.2.15>. Nonlinear covariate effects are represented using penalized splines, while spatial effects are represented using a smooth function of geographic coordinates. Models are estimated using restricted maximum likelihood (REML), and mean squared error (MSE) is estimated using a parametric bootstrap. The package also provides comparisons with the Fay-Herriot and spatial Fay-Herriot (SFH) models. |
| Authors: | Amalyah Rizky Khairunnisa Sutarto [aut, cre], Novi Hidayat Pusponegoro [aut, ths] |
| Maintainer: | Amalyah Rizky Khairunnisa Sutarto <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.2 |
| Built: | 2026-10-15 23:29:46 UTC |
| Source: | https://github.com/cran/geoaddSAE2 |
Fits area-level Geoadditive Small Area Estimation (SAE) models, an extension of the Fay-Herriot model that incorporates linear covariate effects, nonlinear covariate effects represented by penalized splines, and spatial variation represented by a bivariate thin plate regression spline.
geosae( data, formula, vardir, nonlinear, spatial, knots = NULL, spatial_k = NULL, method = c("REML"), compare = FALSE, proxmat = NULL, proxmat_k = 4, B = 100, seed = NULL )geosae( data, formula, vardir, nonlinear, spatial, knots = NULL, spatial_k = NULL, method = c("REML"), compare = FALSE, proxmat = NULL, proxmat_k = 4, B = 100, seed = NULL )
data |
A data frame containing the direct estimates, known sampling variances, covariates, and spatial coordinates. |
formula |
A model formula giving the response variable on the left-hand side and covariates to be modelled linearly on the right-hand side. Use |
vardir |
Unquoted name of the column containing the known sampling variances of the direct estimates. |
nonlinear |
Character vector containing the names of covariates to be modelled nonlinearly using P-splines. |
spatial |
Character vector of length two containing the names of the spatial coordinate variables, for example |
knots |
Optional basis dimension for the nonlinear P-spline terms. If |
spatial_k |
Optional basis dimension for the spatial thin plate regression spline. If |
method |
Smoothing-parameter estimation method passed to |
compare |
Logical. If |
proxmat |
Optional spatial proximity matrix used by the Spatial Fay-Herriot comparison model. |
proxmat_k |
Number of nearest neighbours used when constructing the spatial proximity matrix automatically. Default is 4. |
B |
Number of parametric bootstrap replications used to estimate the MSE. Default is 100. |
seed |
Optional integer seed for reproducibility. |
Model parameters and smoothing parameters are estimated by Restricted Maximum Likelihood (REML) within a linear mixed model framework using mgcv. The Mean Squared Error (MSE) of the Geoadditive SAE estimates is estimated using parametric bootstrap.
When compare = TRUE, the function also fits the classical Fay-Herriot and Spatial Fay-Herriot models using implementations provided by the optional sae package. The sae package is not required when compare = FALSE.
An object of class "geosae". The returned list contains area-level estimates, model diagnostics, fixed-effect parameter estimates, model comparisons when requested, and the underlying fitted model objects.
data(simulated_sae) fit <- geosae( data = simulated_sae, formula = y ~ x1 + x2, vardir = vardir, nonlinear = "x3", spatial = c("lat", "lon"), B = 10, seed = 1 ) fit summary(fit) head(fit$estimation) ## Not run: fit_cmp <- geosae( data = simulated_sae, formula = y ~ x1 + x2, vardir = vardir, nonlinear = "x3", spatial = c("lat", "lon"), compare = TRUE, B = 100, seed = 1 ) fit_cmp$comparison ## End(Not run)data(simulated_sae) fit <- geosae( data = simulated_sae, formula = y ~ x1 + x2, vardir = vardir, nonlinear = "x3", spatial = c("lat", "lon"), B = 10, seed = 1 ) fit summary(fit) head(fit$estimation) ## Not run: fit_cmp <- geosae( data = simulated_sae, formula = y ~ x1 + x2, vardir = vardir, nonlinear = "x3", spatial = c("lat", "lon"), compare = TRUE, B = 100, seed = 1 ) fit_cmp$comparison ## End(Not run)
Print method for geosae object
## S3 method for class 'geosae' print(x, digits = 4, ...)## S3 method for class 'geosae' print(x, digits = 4, ...)
x |
An object of class |
digits |
Number of decimal digits to print. Default 4. |
... |
Additional arguments passed to other methods. |
Invisibly returns the input object of class "geosae".
The method prints the main model settings and area-level estimation
results to the console.
A synthetic area-level small area estimation dataset used in package examples, demonstrations, and tests.
The data are generated using the following steps:
The population consists of 100 small areas, and a seed is set to ensure reproducibility of the simulated data.
Two-dimensional spatial coordinates are generated for each area, where latitude is generated from and longitude is generated from .
Two linear auxiliary variables are generated for each area: and . A nonlinear auxiliary variable is also generated.
The model parameters are set deterministically as , , and .
The nonlinear covariate effect is generated using .
A continuous spatial effect is generated from the spatial coordinates using the smooth function .
The true small area parameter is calculated as .
The number of sampled units in each area is generated from . The sampling error variance is then defined as , where .
The direct estimator is generated according to the sampling model , where .
The area identifier, direct estimator, auxiliary variables, spatial coordinates, sampling variance, and true small area parameter are combined into a data frame called simulated_sae.
simulated_saesimulated_sae
A data frame with 100 rows and 9 columns:
Area identifier.
Direct estimator (response).
Binary auxiliary variable with a linear effect on the response.
Continuous auxiliary variable with a linear effect on the response.
Continuous auxiliary variable with a nonlinear effect on the response.
Latitude-like spatial coordinate.
Longitude-like spatial coordinate.
Known sampling variance of the direct estimator.
True small area parameter used to generate the direct estimator.
data(simulated_sae) head(simulated_sae)data(simulated_sae) head(simulated_sae)
Summary method for geosae object
## S3 method for class 'geosae' summary(object, ...)## S3 method for class 'geosae' summary(object, ...)
object |
An object of class |
... |
Additional arguments passed to other methods. |
Invisibly returns the input object of class "geosae".
The method prints model diagnostics, fixed-effect parameter estimates,
smooth-term information, MSE and RMSE summaries, and model comparison
results when available.