spatial-social-analysis

Compute Moran's I and fit spatial regression models on social science datasets.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Yuuqq/claude-social-science-skills --skill spatial-social-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spatial-social-analysis
Source: https://github.com/Yuuqq/claude-social-science-skills/tree/main/social-science-skills/spatial-social-analysis
Command: npx skills add https://github.com/Yuuqq/claude-social-science-skills --skill spatial-social-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, geopandas, esda, libpysal, splot, spreg, shapely, matplotlib, scikit-learn, mgwr, h3, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

It helps you detect and model geographic dependence in social science data, where nearby places influence each other and outcomes cluster across space.

Core Features & Use Cases

  • Spatial autocorrelation testing: compute and interpret Moran's I (global) and LISA/Local Moran's I to identify clusters, hotspots, and coldspots.
  • Spatial regression modeling: estimate spatial dependence via SAR (spatial lag), SEM (spatial error), and SDM (Spatial Durbin Model), plus spatial regimes variants.
  • Geographic analysis & mapping: create choropleth maps, run boundary-based geographic RDD workflows, and quantify spatial accessibility (e.g., 2SFCA for service access).
  • Spatial machine learning with guardrails: reduce spatial data leakage using spatial cross-validation approaches and coordinate-based grouping.

Quick Start

Use the spatial-social-analysis skill to compute Moran's I and fit a spatial lag (SAR) model for your outcome variable across regions or areas with shared boundaries.

Frequently Asked Questions about spatial-social-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute Moran's I to detect spatial autocorrelation in my dataset?

Compute Moran's I to detect spatial autocorrelation by constructing spatial weights and calculating global clustering statistics. This identifies whether nearby observations influence each other, revealing geographic dependence across your dataset.

How do I fit a spatial lag model to handle spatial spillovers in regression?

Fit a spatial lag model (SAR) to handle spatial spillovers by estimating spatial dependence parameters. This models how outcomes in neighboring regions influence your target variable, correcting bias from geographic clustering.

What is LISA used for in hotspot detection and choropleth mapping?

LISA, or Local Moran's I, is used in hotspot detection to identify local clusters of similar values. It pinpoints specific hotspots and coldspots, enabling detailed choropleth mapping of significant spatial patterns.

Can I use geopandas and spreg to run spatial econometrics with spatial regimes?

Yes, you can use geopandas with spreg to run spatial econometrics including spatial regimes. This estimates spatial error models and spatial Durbin models while accounting for structural shifts across different geographic boundaries.

How do I prevent spatial data leakage in spatial machine learning validation?

Prevent spatial data leakage in machine learning validation by using spatial cross-validation with coordinate-based grouping. This ensures geographically connected observations stay in the same fold, producing reliable spatial ML performance metrics.

Does this skill support geographic boundary designs and accessibility measurement?

Yes, this skill supports geographic boundary designs and accessibility measurement. It quantifies spatial accessibility using 2SFCA methods and runs boundary-based geographic RDD workflows for analyzing service access across regions.