| Type: | Package |
| Title: | Geoadditive Small Area Estimation for Area-Level Model |
| Version: | 0.1.0 |
| 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. |
| License: | GPL (≥ 3) |
| Encoding: | UTF-8 |
| LazyData: | true |
| Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| VignetteBuilder: | knitr |
| Depends: | R (≥ 3.5.0) |
| Imports: | mgcv, sae, stats |
| Config/roxygen2/version: | 8.1.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-09-22 08:16:08 UTC; alya |
| Author: | Amalyah Rizky Khairunnisa Sutarto [aut, cre], Novi Hidayat Pusponegoro [aut, ths] |
| Maintainer: | Amalyah Rizky Khairunnisa Sutarto <222212489@stis.ac.id> |
| Repository: | CRAN |
| Date/Publication: | 2026-09-30 11:40:09 UTC |
geoaddSAE2: Geoadditive Small Area Estimation for Area Level
Description
Fits area-level Geoadditive Small Area Estimation (SAE) models: a extension of the Fay-Herriot model that represents nonlinear covariate effects with and spatial variation, estimated by REML within a linear mixed model framework (via mgcv), with Mean Squared Error obtained by parametric bootstrap. The package also lets users compare the geoadditive model against the classical Fay-Herriot and Spatial Fay-Herriot models, both of which are provided by, and fitted with, the existing sae package.
Details
Main entry point: geosae.
Author(s)
Maintainer: Amalyah Rizky Khairunnisa Sutarto 222212489@stis.ac.id
Authors:
Amalyah Rizky Khairunnisa Sutarto 222212489@stis.ac.id
Novi Hidayat Pusponegoro novie@stis.ac.id [thesis advisor]
Fit an area-level Geoadditive Small Area Estimation model
Description
Fits area-level Geoadditive Small Area Estimation (SAE) models: a extension of the Fay-Herriot model that represents nonlinear covariate effects with and spatial variation, estimated by REML within a linear mixed model framework (via mgcv), with Mean Squared Error obtained by parametric bootstrap. The package also lets users compare the geoadditive model against the classical Fay-Herriot and Spatial Fay-Herriot models, both of which are provided by, and fitted with, the existing sae package.
Usage
geosae(
data,
formula,
vardir,
nonlinear,
spatial,
knots = NULL,
spatial_k = NULL,
method = c("REML"),
compare = FALSE,
proxmat = NULL,
proxmat_k = 4,
bootstrap = TRUE,
B = 100,
seed = NULL
)
Arguments
data |
A data frame containing the direct estimates, the known sampling variances, the covariates, and (if used) spatial coordinates. |
formula |
A model formula |
vardir |
Name of the column in |
nonlinear |
Character vector of covariate names to be modelled nonlinearly with a P-spline. |
spatial |
Character vector of length 2 giving the names of the two spatial coordinate columns (e.g. |
knots |
Optional. Controls the basis dimension (number of knots) of each nonlinear P-spline term. |
spatial_k |
Optional basis dimension for the spatial thin-plate smooth. |
method |
Smoothing-parameter selection method passed to |
compare |
Logical. If |
proxmat |
Optional spatial proximity matrix for the Spatial Fay-Herriot model. The matrix should have one row and one column for each area, with zero diagonal and row-standardized spatial weights. If |
proxmat_k |
Number of nearest neighbours used to construct the automatic spatial proximity matrix when |
bootstrap |
Logical. Whether to estimate the MSE of the geoadditive predictor via parametric bootstrap ( |
B |
Number of parametric bootstrap replicates. Default 100. |
seed |
Optional integer seed for the bootstrap, for reproducibility. |
Details
Optionally (compare = TRUE), the classical Fay-Herriot and Spatial Fay-Herriot models are also fitted – using the existing, well-tested implementations in the sae package (sae::mseFH, sae::eblupSFH, sae::mseSFH) rather than re-implemented here – so that all three models can be compared side by side.
Value
An object of class "geosae", a list containing the call, settings, estimation results, diagnostics, fixed-effect parameters, model comparisons (if requested), and underlying fitted model objects.
Print method for geosae object
Description
Print method for geosae object
Usage
## S3 method for class 'geosae'
print(x, digits = 4, ...)
Arguments
x |
An object of class |
digits |
Number of decimal digits to print. Default 4. |
... |
Additional arguments passed to other methods. |
Value
Invisibly returns the input object of class "geosae".
The method prints the main model settings and area-level estimation
results to the console.
Simulated area-level small area estimation data
Description
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
U(-11, 6)and longitude is generated fromU(95, 141).Two linear auxiliary variables are generated for each area:
x1 ~ Bernoulli(0.9)andx2 ~ U(1, 5). A nonlinear auxiliary variablex3 ~ U(1, 5)is also generated.The model parameters are set deterministically as
\alpha = 0.5,\beta_1 = 1, and\beta_2 = 1.The nonlinear covariate effect is generated using
g(x3) = x3^2.A continuous spatial effect is generated from the spatial coordinates using the smooth function
h(lat, lon) = sin(lat) + cos(lon).The true small area parameter is calculated as
theta = \alpha + \beta_1 x1 + \beta_2 x2 + g(x3) + h(lat, lon).The number of sampled units in each area is generated from
n_i ~ U{10, 50}. The sampling error variance is then defined asvardir = \sigma_e^2/n_i, where\sigma_e^2 = 1.The direct estimator is generated according to the sampling model
y = theta + e, wheree ~ N(0, vardir).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.
Usage
simulated_sae
Format
A data frame with 100 rows and 9 columns:
- area
Area identifier.
- y
Direct estimator (response).
- x1
Binary auxiliary variable with a linear effect on the response.
- x2
Continuous auxiliary variable with a linear effect on the response.
- x3
Continuous auxiliary variable with a nonlinear effect on the response.
- lat
Latitude-like spatial coordinate.
- lon
Longitude-like spatial coordinate.
- vardir
Known sampling variance of the direct estimator.
- theta
True small area parameter used to generate the direct estimator.
Examples
data(simulated_sae)
head(simulated_sae)
Summary method for geosae object
Description
Summary method for geosae object
Usage
## S3 method for class 'geosae'
summary(object, ...)
Arguments
object |
An object of class |
... |
Additional arguments passed to other methods. |
Value
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.