Skip to content
Skill

Spatial statistics areal

Test and model spatial association and spillovers across polygon zones with R or Python

Spatial statistics areal is an open-source agent skill for analytics and data. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
13
Last commit
License
MIT
Listing updated

Similar skills

About Spatial statistics areal

This skill guides an agent through spatial association analysis on areal data, where each polygon such as a district or municipality carries a single value. It covers global and local Moran's I, bivariate Moran and BiLISA hot and cold spot mapping, Lee's L, and spatial weights matrices built from queen, rook and k-nearest-neighbour definitions. The workflow stresses running results across several weight specifications and reporting which ones hold up, rather than quoting a single statistic.

For explanation rather than prediction, the skill walks through Rao's score diagnostics and a family of spatial regression models (SLX, SAR, SEM, SDM and SDEM), then reports direct, indirect and total impacts using the LeSage-Pace decomposition. It also flags common pitfalls, such as misreading Moran's I as a strength measure, using normal approximations for local tests, and quoting shortcut spillover estimates. Pipelines are given in both R (spdep and spatialreg) and Python (libpysal, esda and spreg), and the skill includes a checklist for reporting results.

The agent is expected to work with polygon data in a metric projected coordinate system and to have R or Python with the listed spatial packages installed. The skill notes that it is not intended for surface prediction or map accuracy work, which belong to other soil mapping workflows.

When your agent uses it

Analyse spatial association and spatial dependence on areal (lattice/polygon) data for ANY variable — global and local Moran's I, LISA hot/cold spots and spatial outliers, bivariate Moran and BiLISA, Lee's L, spatial weights matrices and their robustness, Rao's-score (ex-Lagrange multiplier) diagnostics, and spatial regression (SLX, SAR, SEM, SDM, SDEM) with LeSage-Pace direct/indirect/total impact decomposition. Use when the question is about association, explanation or spillover across zones rather than prediction of a surface — for example relating cumulative forest loss to SOC stocks across the zones of a forest region. Triggers: "spatial autocorrelation", "Moran's I", "LISA", "hot spot analysis", "bivariate Moran", "BiLISA", "spatial weights matrix", "queen contiguity", "Lagrange multiplier test", "LM test spatial", "SAR model", "SEM model", "spatial lag", "spatial error", "SDM", "SDEM", "spatial econometrics", "spillover", "direct indirect effects", "impacts", "spdep", "spatialreg", "GeoDa", "areal data

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (25 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the dsm-soil plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add ccarbajal16/soil-dsm-skills
/plugin install dsm-soil@soil-dsm-skills

Or copy only this skill to ~/.claude/skills/spatial-statistics-areal:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/spatial-statistics-areal &&
cp -R "$tmp/plugins/dsm-soil/skills/spatial-statistics-areal" ~/.claude/skills/spatial-statistics-areal &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/spatial-statistics-areal inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/spatial-statistics-areal to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/spatial-statistics-areal &&
cp -R "$tmp/plugins/dsm-soil/skills/spatial-statistics-areal" ~/.agents/skills/spatial-statistics-areal &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/spatial-statistics-areal inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/spatial-statistics-areal to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/spatial-statistics-areal &&
cp -R "$tmp/plugins/dsm-soil/skills/spatial-statistics-areal" ~/.cursor/skills/spatial-statistics-areal &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/spatial-statistics-areal inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/ccarbajal16/soil-dsm-skills.git --path plugins/dsm-soil/skills/spatial-statistics-areal

Or copy the folder to ~/.gemini/skills/spatial-statistics-areal yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/spatial-statistics-areal:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/spatial-statistics-areal &&
cp -R "$tmp/plugins/dsm-soil/skills/spatial-statistics-areal" ~/.copilot/skills/spatial-statistics-areal &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/spatial-statistics-areal inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git

Then copy soil-dsm-skills/plugins/dsm-soil/skills/spatial-statistics-areal into your agent's skills folder as spatial-statistics-areal. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Global spatial autocorrelation tests
Univariate and bivariate Moran's I plus Lee's L, computed across several neighbour definitions.
Local cluster and outlier mapping
LISA and BiLISA quadrant classification with permutation-based significance and multiple-comparison adjustment.
Spatial weights construction
Queen, rook and k-nearest-neighbour weights with row standardisation and connectivity checks.
Regression diagnostics and model family
Rao's score tests and fitting of SLX, SAR, SEM, SDM and SDEM models with AIC comparison.
Direct and indirect impact decomposition
LeSage-Pace impacts with simulated p-values, distinguishing exact decomposition from shortcut estimates.
R and Python pipelines
Parallel code using spdep, spatialreg, libpysal, esda and spreg, with a cross-language API mapping.

Good for

  • Test whether high forest loss in one district is associated with soil carbon in neighbouring districts
  • Identify hot spots and cold spots of a socioeconomic indicator across municipalities
  • Compare queen and k-nearest-neighbour weights to check whether a spatial result is robust
  • Fit SAR, SEM and SDM models and compare them by AIC for zone-level data
  • Estimate direct and indirect spillover effects from a spatial lag model

Spatial statistics areal FAQ

What kind of data does Spatial statistics areal work with?

It is for polygon or areal data with one value per zone, such as districts or fields, and it is not meant for continuous raster surface prediction.

Which tools does the analysis require?

The pipelines use R with sf, spdep and spatialreg, or Python with libpysal, esda, spreg and geopandas. The skill itself ships no scripts.

Does Spatial statistics areal work with a specific AI client?

The skill follows the shared SKILL.md format, so it is not tied to a single client in its content.

Does the skill establish causation?

No. The content states that cross-sectional spatial results are associations and do not support causal claims.

How do I install Spatial statistics areal in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/spatial-statistics-areal to use it in all your projects, or to .claude/skills/spatial-statistics-areal in one project. Or install the dsm-soil plugin, which includes it: /plugin marketplace add ccarbajal16/soil-dsm-skills, then /plugin install dsm-soil@soil-dsm-skills.

Does Spatial statistics areal run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Spatial statistics areal?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Spatial statistics areal?

The closest alternatives to Spatial statistics areal are Spatial prediction uncertainty, Quantitative analysis, Data scientist, Data analysis and Data analysis.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from ccarbajal16/soil-dsm-skills

  1. Guides an agent through planning a digital soil mapping project from covariates

    • Open source
    • 13 GitHub stars
    • Health and science
  2. Measures whether combining soil ML models can beat the best single model, and how

    • Open source
    • 13 GitHub stars
    • Health and science
  3. Guides an agent in building hybrid process-plus-ML models for soil carbon change over time

    • Open source
    • 13 GitHub stars
    • Health and science
  4. Guides an agent in choosing, tuning and interpreting ML models for soil property

    • Open source
    • 13 GitHub stars
    • Health and science
  5. Guides an agent through setting up, calibrating and checking RothC soil carbon models

    • Open source
    • 13 GitHub stars
    • Health and science
  6. Guides an agent through soil organic carbon stock change measurement and crediting

    • Open source
    • 13 GitHub stars
    • Health and science