Static Spatial Panel Models

Specification

\[y_{it} = \rho W y_{it} + X_{it} \beta + \mu_i + \xi_t + \varepsilon_{it}\]

Fixed Effects

TypeMeaningRemoves
NoFE()No fixed effects—
IndivFE()Individual FEUnit-specific means
TimeFE()Time FEPeriod-specific means
TwoWayFE()Two-way FEBoth

Estimation Approaches

# Lee-Yu bias-corrected transformation (default)
m = fit_spatial_panel(SAR(), TwoWayFE(), W, X, y, N, T;
    approach=LeeYuTransformation())

# Direct QML with analytical bias correction
m = fit_spatial_panel(SAR(), IndivFE(), W, X, y, N, T;
    approach=DirectQML(bias_correct=true))

Formula DSL

m = fit_spatial_panel(
    @formula(y ~ x1 + x2 + slag(x1 + x2) + fe(region) + fe(year)),
    table, W; panel=:region, time=:year
)