slxr 0.1.1
CRAN release: 2026-04-22
CRAN resubmission addressing feedback from the initial submission.
- Added
\valuesections toslx-tidiers.Rd(documenting the tibble columns returned bytidy.slx()andglance.slx()) andslx_sensitivity.Rd(documenting that the stub is called for its side effect of signalling an error, with a note on the planned future return value). - Removed all
\dontrun{}blocks from examples. Examples inslx-tidiers,slx_effects,slx_plot_effects, andslx_plot_shockare now unwrapped and run against the bundleddefense_burdendataset. Theslx_weightsexample now runs a custom-matrix case by default; the optionalsf-based contiguity example is wrapped in\donttest{}and guarded byrequireNamespace().
slxr 0.1.0
Initial CRAN release.
Core
-
slx()fits Spatial-X regression models of the formy = X*beta + WX*theta + epsilonvia OLS on an augmented design matrix, with a formula interface and first-class support for variable-specific weights matrices. -
slx_weights()constructsslx_Wweights objects fromsfinput (contiguity,rook,knn,distance) or from a user-supplied matrix (custom). -
slx_effects()returns a tidy tibble with direct, indirect, and total effects and their standard errors. - Higher-order spatial lags (
order = 1:k) supported.
Panel support
-
idandtimearguments turnslx()into a panel estimator. Weights matrices can be time-invariant or supplied as named year-keyed lists. Unbalanced panels are handled automatically. -
time_lag = kimplements the temporally-lagged spatial lag (TSLS, equation 7 of Wimpy, Whitten, and Williams 2021).
Interpretation and visualization
-
slx_compare()produces side-by-side fit statistics forlmandslxobjects, with optional Moran’s I on residuals. -
slx_plot_effects(),slx_plot_decay(),slx_plot_shock(), andslx_plot_W()returnggplotobjects that can be further customized with+ geom_*()/+ theme_*(). -
tidy()andglance()methods for compatibility with thebroomandmodelsummaryecosystems.
Data
-
defense_burden: 1995 cross-section of 179 countries with three sparse weights matrices (contiguity, alliance, defense pact). -
defense_burden_panel: 1951-2008 panel (7,661 observations) with year-specific sparse weights matrices.
Both datasets are drawn from the replication archive for Wimpy, Whitten, and Williams (2021), Journal of Politics 83(2): 722-739.
