Panel Diagnostics
Hausman, Chow and joint LM tests for panels.
SpatialEconometrics.SpatialPanelDiagnostics.ChowTestResult — Type
ChowTestResultStructural-break test over time for a spatial panel, returned by spatial_chow_test.
Fields: stat, df, p_value and break_period, the period tested. Rejection says the coefficients differ either side of that period, so a single pooled specification is not adequate.
SpatialEconometrics.SpatialPanelDiagnostics.HausmanTestResult — Type
HausmanTestResultFixed- versus random-effects test for a spatial panel, returned by spatial_hausman_test.
Fields: stat, df, p_value and the coefnames compared. Rejection favours fixed effects, because it says the unit effects are correlated with the regressors and the random-effects estimator is therefore inconsistent.
SpatialEconometrics.SpatialPanelDiagnostics.PanelLMTestResult — Type
PanelLMTestResultJoint and individual LM tests for a spatial panel, returned by panel_lm_tests.
Carries a joint test (joint_stat, joint_df, joint_p) against the hypothesis of no spatial dependence and no random effects, plus the component tests: lag_stat/lag_p, error_stat/error_p and re_stat/re_p for the random-effects variance.
Read the joint test first; if it does not reject, the components are not worth chasing individually.
SpatialEconometrics.SpatialPanelDiagnostics.PanelMoranResult — Type
PanelMoranResultMoran's I computed period by period for a panel, returned by panel_moran.
Fields: period_results, a vector of MoranResult with one entry per period; pooled, the statistic on the pooled residuals; and T_periods.
The per-period series is the useful part — it shows whether spatial dependence is stable over time or concentrated in particular periods, which a single pooled number hides.
SpatialEconometrics.SpatialPanelDiagnostics.panel_lm_tests — Function
panel_lm_tests(y, X, W, N, T)Joint LM tests for spatial panels (Baltagi, Song & Koh 2003). Tests simultaneously for spatial lag, spatial error, and random effects from a pooled OLS baseline. Returns individual and joint test statistics.
SpatialEconometrics.SpatialPanelDiagnostics.panel_moran — Function
panel_moran(residuals, W, N, T)Compute Moran's I for each period and a pooled statistic from panel residuals.
SpatialEconometrics.SpatialPanelDiagnostics.spatial_chow_test — Function
spatial_chow_test(y, X, W, N, T, break_period)Spatial Chow test for structural break at break_period. Tests whether parameters are stable across two sub-periods. Uses the LR-based approach adapted for spatial models.
SpatialEconometrics.SpatialPanelDiagnostics.spatial_hausman_test — Function
spatial_hausman_test(m_fe, m_re; names=nothing)Spatial Hausman test comparing two spatial panel estimators. Under H₀ the second model is consistent and efficient; under H₁ only the first is consistent, so a rejection favours m_fe.
Coefficients are matched by name, using the names the two models share, in the order they appear in m_fe. The names actually compared are returned in the result. Pass names to restrict the comparison to a chosen subset. The models should otherwise share the same dependent variable, covariates and W.
Matching by name matters. A NoFE panel fit carries an intercept that an FE fit does not, so the first position is the intercept in one model and the first slope in the other. Comparing those positionally builds a statistic out of unrelated parameters: it looks like a decisive rejection and means nothing.