SAEResults

SAEResults(
    level,
    y,
    model_type,
    stats,
    fixed_effects,
    variance_components,
    prediction,
    area_match=None,
    benchmark=None,
    diagnostics=None,
    neighbors=None,
    PRINT_WIDTH=None,
)

A fitted model: estimates, predictions and diagnostics.

Attributes

Name Description
plots Plots of the stored diagnostics.

Methods

Name Description
component The variance component with this name (and indicator and time, when keyed).
findings Rules the fit fails at these thresholds, one row each.
refit The same fit with some of its arguments changed, e.g. refit(mse=“bootstrap”).
set_default_print_width Set the printed width of every result without its own.
set_print_width Set the width of this result’s printed summary.
to_polars One part of the results as a table.

component

component(name, *, indicator=None, time=None)

The variance component with this name (and indicator and time, when keyed).

Parameters

Name Type Description Default
name str E.g. “area”, “residual” or “rho_spatial”. required
indicator str | None The indicator and period of the component, for fits keyed by them. None
time str | None The indicator and period of the component, for fits keyed by them. None

findings

findings(
    alpha=0.05,
    cv_max=0.3,
    boundary_tol=0.001,
    cooks_max=None,
    shift_max=0.1,
    vif_max=10.0,
)

Rules the fit fails at these thresholds, one row each.

Parameters

Name Type Description Default
alpha float Significance level of the tests: normality, bias against the direct estimates, residual patterns. 0.05
cv_max float CV above which an area is flagged; area level only. 0.3
boundary_tol float The area variance is at the boundary when below this: as a ratio to the median sampling variance at area level, as the intraclass correlation at unit level. 0.001
cooks_max float | None Cook’s distance above which an area is influential. None takes 4 / number of sampled areas. None
shift_max float Relative change by benchmarking above which a group is flagged. 0.1
vif_max float Variance inflation factor above which a covariate is flagged. 10.0

refit

refit(**changes)

The same fit with some of its arguments changed, e.g. refit(mse=“bootstrap”).

Parameters

Name Type Description Default
**changes Any Arguments of the fh, eblup or ebp call that made these results. {}

set_default_print_width

set_default_print_width(width)

Set the printed width of every result without its own.

Parameters

Name Type Description Default
width int | None Characters, more than 20. None uses the SVY_PRINT_WIDTH environment variable, else svy’s default. required

set_print_width

set_print_width(width)

Set the width of this result’s printed summary.

Parameters

Name Type Description Default
width int | None Characters, more than 20. None uses the class default. required

to_polars

to_polars(component='fixed')

One part of the results as a table.

Parameters

Name Type Description Default
component Literal['fixed', 'components', 'predictions', 'diagnostics', 'units', 'tests', 'findings', 'benchmark', 'neighbors'] “fixed”, the coefficients; “predictions”, one row per area (and indicator, period); “components”, the variance components; “diagnostics”, one row per area with residuals, shrinkage and influence; “units”, at unit level, one row per sampled unit with residuals and influence; “tests”, model-level checks; “findings”, rules failed at the default thresholds; “benchmark”, each group’s target and the change made; “neighbors”, for spatial fits, the pairs behind W. 'fixed'