Panel Diagnostics

Hausman, Chow and joint LM tests for panels.

SpatialEconometrics.SpatialPanelDiagnostics.PanelLMTestResult — Type
PanelLMTestResult

Joint 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.

source
SpatialEconometrics.SpatialPanelDiagnostics.PanelMoranResult — Type
PanelMoranResult

Moran'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.

source
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.

source