svy-sae API Reference

Models

Fit a model and predict every area.

AreaLevel Area-level small area estimation (Fay-Herriot).
UnitLevel Unit-level small area estimation (Battese-Harter-Fuller and Molina-Rao).

Results

What a fit returns, its diagnostics and its plots.

SAEResults A fitted model: estimates, predictions and diagnostics.
plots.ResultsPlots results.plots: reads only what the fit stored, so it works on decoded results too.

Comparing fits

compare Fits side by side: one row per fit (and indicator), or by=“area” their estimates.

Sampling variances

smooth_variance Return data with a column of smoothed variances, one row per domain.

Model options

Objects passed to fh, eblup and ebp.

Benchmark Adjust estimates so each group’s size-weighted mean equals its target.
LogTransform Log of positive direct estimates; sampling variance by the delta method.
ArcsinTransform arcsin(sqrt(p)) of proportions in [0, 1].
LogitTransform log(p / (1 - p)) of proportions in (0, 1); sampling variance by the delta method.
Indicator Built-in indicators for UnitLevel.ebp.

Area effects

Structures of the area effect in fh(random=...).

Independent Independent area effects: the standard Fay-Herriot model.
SAR Simultaneous autoregressive area effects, u = rho W u + v.
AR1 Area effect plus an AR(1) area-by-time effect (Rao-Yu); needs fh(time=…).

Proximity

How the neighbours of a SAR model are defined. Prox is the type of any of the four.

Proximity The proximity type for a method named by a string; construct the type directly otherwise.
ContiguityProx Neighbours whose polygons share a border (rook) or any boundary point (queen).
NearestProx Each area’s k nearest areas, from one point per area (e.g. centroids).
DistanceProx All areas within distance of each other, from one point per area.
PairsProx W given as neighbour pairs, one row per (area, neighbour).
Prox

Result records

The records stored on SAEResults.

SAEStats Model-level statistics.
SAEPred One area’s prediction, with its MSE, CV and interval.
FixedEffect A single row in the fixed effects table.
VarianceComponent One variance parameter: a variance, covariance or correlation of the random effects.
AreaMatch How the area keys of data and pop_data matched, and where covariates came from.
BenchmarkReport Each group’s size-weighted mean before benchmarking, against its target.
Selection Covariates chosen by AreaLevel.stepwise; pass terms to fh(x=…).

Utilities

warmup Pre-compile the estimator kernels so no real fit pays a cold start.