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🔗

NameTypeDescription
datafile (Parquet or CSV)One row per area, with the target, predictor and sampling-variance columns.
vardirstringName of the column holding each area's sampling variance.
formulastringModel formula, e.g. estimate ~ B20 + B25 + B30 + 0. Use instead of target and features.
targetstringThe direct-estimate column (when no formula is given).
featuresstringColumn selector for the predictors (when no formula is given): names, globs and exclusions, e.g. B20,B25,B30 or B*,-B5.
interceptbooleanInclude an intercept when building from target and features. Default false, matching the paper's ~ ... + 0 models.
id_columnsstringColumn selector for identifier columns, never used as predictors. Default empty.
categoricalstringColumn selector for numeric-coded predictors to treat as categorical. Default empty.
na_actionstringfail (default) or drop: what to do with an area that has a missing value in a model column.
methodstringVariance estimation method - one of REML (default), ML, or FH.
max_iternumberMaximum Fisher-scoring iterations. Default 1000.

Outputs🔗

NameTypeDescription
modelfile (SpadeModel)The fitted model (family fay_herriot): coefficients, their covariance, the between-area variance and its asymptotic variance and bias.
coefficientsfile (CSV)One row per design column: term, estimate, std_error, statistic, p_value.
fitjsonAreas 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"