sae.fay_herriot
Fit a Fay-Herriot area-level small-area model — an Empirical Best Linear Unbiased Predictor (EBLUP) — with Fisher scoring. The target is a direct (design-based) area estimate; vardir is its known sampling variance. Writes the fitted model, which sae.fay_herriot_mse turns into per-area estimates and MSE without refitting, together with the coefficient table and goodness-of-fit statistics. Fails if the model does not converge. Use sae.all_subsets_fh instead to choose the predictors from a larger candidate pool.
Name the model with a formula (estimate ~ B20 + B25 + B30 + 0), or with a target and a features column selector.
- Kind:
standard - Network: no
Inputs🔗
| Name | Type | Description |
|---|---|---|
data | file (Parquet or CSV) | One row per area, with the target, predictor and sampling-variance columns. |
vardir | string | Name of the column holding each area's sampling variance. |
formula | string | Model formula, e.g. estimate ~ B20 + B25 + B30 + 0. Use instead of target and features. |
target | string | The direct-estimate column (when no formula is given). |
features | string | Column selector for the predictors (when no formula is given): names, globs and exclusions, e.g. B20,B25,B30 or B*,-B5. |
intercept | boolean | Include an intercept when building from target and features. Default false, matching the paper's ~ ... + 0 models. |
id_columns | string | Column selector for identifier columns, never used as predictors. Default empty. |
categorical | string | Column selector for numeric-coded predictors to treat as categorical. Default empty. |
na_action | string | fail (default) or drop: what to do with an area that has a missing value in a model column. |
method | string | Variance estimation method - one of REML (default), ML, or FH. |
max_iter | number | Maximum Fisher-scoring iterations. Default 1000. |
Outputs🔗
| Name | Type | Description |
|---|---|---|
model | file (SpadeModel) | The fitted model (family fay_herriot): coefficients, their covariance, the between-area variance and its asymptotic variance and bias. |
coefficients | file (CSV) | One row per design column: term, estimate, std_error, statistic, p_value. |
fit | json | Areas used and dropped, the arguments that shaped the fit, and metrics: refvar (between-area variance), loglike, aic, bic, iterations. |
Example🔗
- id: "@fit"
name: sae.fay_herriot
inputs:
- "@long_data"
args:
target: "estimate"
features: "B20,B25,B30"
vardir: "var_of_estimate"
method: "REML"