{"id":1731,"date":"2026-11-06T08:03:19","date_gmt":"2026-11-06T08:03:19","guid":{"rendered":"https:\/\/helpwithmygisassignment.com\/blog\/?p=1731"},"modified":"2026-11-06T08:03:19","modified_gmt":"2026-11-06T08:03:19","slug":"global-and-local-morans-i","status":"publish","type":"post","link":"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/","title":{"rendered":"Spatial Autocorrelation in Practice: Calculating Global and Local Moran\u2019s I for Disease Cluster Analysis"},"content":{"rendered":"<div id=\"model-response-message-contentr_2125242277c1c11e\" class=\"markdown markdown-main-panel md-content enable-luminous-fast-follows enable-updated-hr-color stronger tutor-markdown-rendering\" dir=\"ltr\" aria-busy=\"false\" aria-live=\"polite\">\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Spatial_Autocorrelation_in_Practice_Calculating_Global_and_Local_Morans_I_for_Disease_Cluster_Analysis\" >Spatial Autocorrelation in Practice: Calculating Global and Local Moran\u2019s I for Disease Cluster Analysis<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Methodology_Overview_Global_vs_Local_Spatial_Autocorrelation\" >Methodology Overview: Global vs. Local Spatial Autocorrelation<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#1_Global_Morans_I_Assessing_Overall_Spatial_Pattern\" >1. Global Moran\u2019s I: Assessing Overall Spatial Pattern<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#2_Local_Morans_I_Anselin_LISA\" >2. Local Moran\u2019s I (Anselin LISA)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Step-by-Step_Python_Implementation_PySAL_GeoPandas\" >Step-by-Step Python Implementation (PySAL &amp; GeoPandas)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Step_1_Constructing_Spatial_Weight_Matrices\" >Step 1: Constructing Spatial Weight Matrices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Step_2_Calculating_Global_Morans_I_Test_Statistics\" >Step 2: Calculating Global Moran\u2019s I Test Statistics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Step_3_Generating_Local_Indicators_of_Spatial_Association_LISA\" >Step 3: Generating Local Indicators of Spatial Association (LISA)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Step_4_Visualizing_and_Interpreting_LISA_Cluster_Maps\" >Step 4: Visualizing and Interpreting LISA Cluster Maps<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Public_Health_Intervention_Planning_Spatial_Interpretation\" >Public Health Intervention Planning &amp; Spatial Interpretation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Methodological_Considerations_Analytical_Pitfalls\" >Methodological Considerations &amp; Analytical Pitfalls<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1 class=\"\" data-path-to-node=\"0\"><span class=\"ez-toc-section\" id=\"Spatial_Autocorrelation_in_Practice_Calculating_Global_and_Local_Morans_I_for_Disease_Cluster_Analysis\"><\/span>Spatial Autocorrelation in Practice: Calculating Global and Local Moran\u2019s I for Disease Cluster Analysis<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1828\" src=\"https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_tv45sdtv45sdtv45-1-1024x559.jpg\" alt=\"Global and Local Moran's I spatial autocorrelation disease hot spot map\" width=\"1024\" height=\"559\" srcset=\"https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_tv45sdtv45sdtv45-1-1024x559.jpg 1024w, https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_tv45sdtv45sdtv45-1-300x164.jpg 300w, https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_tv45sdtv45sdtv45-1-768x419.jpg 768w, https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_tv45sdtv45sdtv45-1.jpg 1408w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<div>In epidemiological surveillance and public health spatial analytics, traditional aspatial statistical models frequently fall short. Standard regression techniques assume that observations are independent and identically distributed (i.i.d.). However, health outcomes, infectious disease transmissions, chronic morbidity rates, and environmental toxic exposures rarely adhere to independence across space.<\/div>\n<div>This spatial dependence is formally captured by <b data-path-to-node=\"2\" data-index-in-node=\"48\">Tobler\u2019s First Law of Geography<\/b>: <i data-path-to-node=\"2\" data-index-in-node=\"81\">&#8220;Everything is related to everything else, but near things are more related than distant things.&#8221;<\/i><\/div>\n<div>When disease rates cluster geographically\u2014whether due to shared environmental contaminants, vector habitats, socioeconomic disparities, or clustered person-to-person transmission\u2014ignoring spatial structure leads to biased parameter estimates, inflated Type I error rates, and flawed public health interventions. This analytical guide explores the theoretical foundations and hands-on Python implementation of spatial autocorrelation metrics using <a href=\"https:\/\/helpwithmygisassignment.com\/blog\/wp-admin\/post.php?post=1731&amp;action=edit#(url?id=112)\"><b data-path-to-node=\"3\" data-index-in-node=\"447\">PySAL <\/b><\/a>and <b data-path-to-node=\"3\" data-index-in-node=\"457\">GeoPandas<\/b>, focusing specifically on <b data-path-to-node=\"3\" data-index-in-node=\"493\">Global Moran\u2019s I<\/b> and <b data-path-to-node=\"3\" data-index-in-node=\"514\">Local Indicators of Spatial Association (LISA) \/ Anselin Local Moran\u2019s I<\/b> for robust disease cluster analysis.<\/div>\n<h2 data-path-to-node=\"5\"><span class=\"ez-toc-section\" id=\"Methodology_Overview_Global_vs_Local_Spatial_Autocorrelation\"><\/span>Methodology Overview: Global vs. Local Spatial Autocorrelation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div>To rigorously evaluate how disease rates distribute across geographic space, quantitative epidemiologists rely on two complementary classes of spatial autocorrelation statistics: <b data-path-to-node=\"6\" data-index-in-node=\"179\">Global<\/b> and <b data-path-to-node=\"6\" data-index-in-node=\"190\">Local<\/b> measures.<\/div>\n<h3 data-path-to-node=\"7\"><span class=\"ez-toc-section\" id=\"1_Global_Morans_I_Assessing_Overall_Spatial_Pattern\"><\/span>1. Global Moran\u2019s I: Assessing Overall Spatial Pattern<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div>Global Moran\u2019s I evaluates the entire study area to determine whether the spatial pattern of a health variable (e.g., standardized incidence ratios or disease mortality rates) exhibits clustering, dispersion, or spatial randomness.<\/div>\n<div>Mathematically, Global Moran\u2019s I is expressed as:<\/div>\n<div data-path-to-node=\"10\">\n<div class=\"math-block\" data-math=\"I = \\frac{N}{S_0} \\sum_{i=1}^{N} \\sum_{j=1}^{N} w_{ij} (x_i - \\bar{x})(x_j - \\bar{x}) \\Big\/ \\sum_{i=1}^{N} (x_i - \\bar{x})^2\">$$I = \\frac{N}{S_0} \\sum_{i=1}^{N} \\sum_{j=1}^{N} w_{ij} (x_i &#8211; \\bar{x})(x_j &#8211; \\bar{x}) \\Big\/ \\sum_{i=1}^{N} (x_i &#8211; \\bar{x})^2$$<\/div>\n<\/div>\n<div>Where:<\/div>\n<ul data-path-to-node=\"12\">\n<li>\n<div><span class=\"math-inline\" data-math=\"N\" data-index-in-node=\"0\">$N$<\/span> is the total number of spatial units (e.g., census tracts, counties, health districts).<\/div>\n<\/li>\n<li>\n<div><span class=\"math-inline\" data-math=\"x_i\" data-index-in-node=\"0\">$x_i$<\/span> and <span class=\"math-inline\" data-math=\"x_j\" data-index-in-node=\"8\">$x_j$<\/span> represent the attribute values (disease incidence) at locations <span class=\"math-inline\" data-math=\"i\" data-index-in-node=\"76\">$i$<\/span> and <span class=\"math-inline\" data-math=\"j\" data-index-in-node=\"82\">$j$<\/span>.<\/div>\n<\/li>\n<li>\n<div><span class=\"math-inline\" data-math=\"\\bar{x}\" data-index-in-node=\"0\">$\\bar{x}$<\/span> is the mean of the attribute across all locations.<\/div>\n<\/li>\n<li>\n<div><span class=\"math-inline\" data-math=\"w_{ij}\" data-index-in-node=\"0\">$w_{ij}$<\/span> is the spatial weight defining the neighborhood relationship between feature <span class=\"math-inline\" data-math=\"i\" data-index-in-node=\"84\">$i$<\/span> and feature <span class=\"math-inline\" data-math=\"j\" data-index-in-node=\"98\">$j$<\/span>.<\/div>\n<\/li>\n<li>\n<div><span class=\"math-inline\" data-math=\"S_0\" data-index-in-node=\"0\">$S_0$<\/span> is the sum of all spatial weights: <span class=\"math-inline\" data-math=\"S_0 = \\sum_{i=1}^{N} \\sum_{j=1}^{N} w_{ij}\" data-index-in-node=\"39\">$S_0 = \\sum_{i=1}^{N} \\sum_{j=1}^{N} w_{ij}$<\/span>.<\/div>\n<\/li>\n<\/ul>\n<div><b data-path-to-node=\"13\" data-index-in-node=\"0\">Interpretation:<\/b><\/div>\n<ul data-path-to-node=\"14\">\n<li>\n<div><span class=\"math-inline\" data-math=\"I &gt; 0\" data-index-in-node=\"0\">$I &gt; 0$<\/span>: Positive spatial autocorrelation (similar values cluster together, such as high disease rates adjacent to high rates).<\/div>\n<\/li>\n<li>\n<div><span class=\"math-inline\" data-math=\"I &lt; 0\" data-index-in-node=\"0\">$I &lt; 0$<\/span>: Negative spatial autocorrelation (checkerboard pattern where high values are surrounded by low values).<\/div>\n<\/li>\n<li>\n<div><span class=\"math-inline\" data-math=\"I \\approx 0\" data-index-in-node=\"0\">$I \\approx 0$<\/span>: Spatial randomness.<\/div>\n<\/li>\n<\/ul>\n<div>While Global Moran\u2019s I provides a single summary statistic of global spatial structure, it masks local heterogeneity. A region can have an overall random global statistic while harboring significant localized disease outbreaks.<\/div>\n<h3 data-path-to-node=\"16\"><span class=\"ez-toc-section\" id=\"2_Local_Morans_I_Anselin_LISA\"><\/span>2. Local Moran\u2019s I (Anselin LISA)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div>To pinpoint precise disease clusters, Anselin introduced <b data-path-to-node=\"17\" data-index-in-node=\"57\">Local Indicators of Spatial Association (LISA)<\/b>. Local Moran&#8217;s I decomposes the global index into individual spatial components for each areal unit <span class=\"math-inline\" data-math=\"i\" data-index-in-node=\"204\">$i$<\/span>:<\/div>\n<div data-path-to-node=\"18\">\n<div class=\"math-block\" data-math=\"I_i = \\frac{x_i - \\bar{x}}{m_2} \\sum_{j=1}^{N} w_{ij} (x_j - \\bar{x})\">$$I_i = \\frac{x_i &#8211; \\bar{x}}{m_2} \\sum_{j=1}^{N} w_{ij} (x_j &#8211; \\bar{x})$$<\/div>\n<\/div>\n<div>Where <span class=\"math-inline\" data-math=\"m_2 = \\frac{\\sum_{i=1}^{N} (x_i - \\bar{x})^2}{N}\" data-index-in-node=\"6\">$m_2 = \\frac{\\sum_{i=1}^{N} (x_i &#8211; \\bar{x})^2}{N}$<\/span>.<\/div>\n<div>LISA statistics evaluate statistical significance against a spatial randomness reference distribution generated via conditional permutation (Monte Carlo simulation). The resulting local statistics classify each spatial unit into one of four distinct quadrant categories on a Moran Scatterplot:<\/div>\n<ul data-path-to-node=\"21\">\n<li>\n<div><b data-path-to-node=\"21,0,0\" data-index-in-node=\"0\">High-High (Hot Spots):<\/b> High disease rates surrounded by neighboring units with high disease rates. Represents primary public health intervention priorities.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"21,1,0\" data-index-in-node=\"0\">Low-Low (Cold Spots):<\/b> Low disease rates surrounded by low-rate neighbors. Indicates protected or low-risk zones.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"21,2,0\" data-index-in-node=\"0\">High-Low (Spatial Outlier):<\/b> High disease incidence surrounded by low-rate neighbors. May point to localized environmental point sources, occupational hazards, or reporting anomalies.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"21,3,0\" data-index-in-node=\"0\">Low-High (Spatial Outlier):<\/b> Low disease incidence surrounded by high-rate neighbors. Indicates protected pockets within high-risk endemic areas.<\/div>\n<\/li>\n<\/ul>\n<h2 class=\"\" data-path-to-node=\"23\"><span class=\"ez-toc-section\" id=\"Step-by-Step_Python_Implementation_PySAL_GeoPandas\"><\/span>Step-by-Step Python Implementation (<code data-path-to-node=\"23\" data-index-in-node=\"36\">PySAL<\/code> &amp; <code data-path-to-node=\"23\" data-index-in-node=\"44\">GeoPandas<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div>Conducting advanced spatial autocorrelation analysis requires specialized spatial libraries in Python. We will use <code data-path-to-node=\"24\" data-index-in-node=\"115\">geopandas<\/code> for vector data manipulation, <code data-path-to-node=\"24\" data-index-in-node=\"155\">libpysal<\/code> for constructing spatial weight matrices, and <code data-path-to-node=\"24\" data-index-in-node=\"210\">esda<\/code> for executing Global and Local Moran&#8217;s I calculations.<\/div>\n<h3 data-path-to-node=\"25\"><span class=\"ez-toc-section\" id=\"Step_1_Constructing_Spatial_Weight_Matrices\"><\/span>Step 1: Constructing Spatial Weight Matrices<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div>Spatial weights (<span class=\"math-inline\" data-math=\"W\" data-index-in-node=\"17\">$W$<\/span>) formalize the geographic relationship between spatial features. Choosing the appropriate weighting scheme\u2014such as Queen contiguity, Rook contiguity, or <span class=\"math-inline\" data-math=\"k\" data-index-in-node=\"172\">$k$<\/span>-nearest neighbors (<span class=\"math-inline\" data-math=\"k\" data-index-in-node=\"193\">$k$<\/span>-NN)\u2014directly impacts analytical outcomes.<\/div>\n<div class=\"code-block ng-tns-c745154712-22 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\" data-hveid=\"0\" data-ved=\"0CAAQhtANahgKEwjT35flgdyXAxUAAAAAHQAAAAAQxQE\">\n<div class=\"formatted-code-block-internal-container ng-tns-c745154712-22\">\n<div class=\"animated-opacity ng-tns-c745154712-22\">\n<div class=\"code-block-decoration header-formatted gds-emphasized-body-m ng-tns-c745154712-22 ng-star-inserted\">\n<p><span class=\"ng-tns-c745154712-22\">Python<\/span><\/p>\n<div class=\"buttons ng-tns-c745154712-22 ng-star-inserted\"><\/div>\n<\/div>\n<pre class=\"ng-tns-c745154712-22\"><code class=\"code-container formatted ng-tns-c745154712-22\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-keyword\">import<\/span> geopandas <span class=\"hljs-keyword\">as<\/span> gpd\r\n<span class=\"hljs-keyword\">import<\/span> libpysal\r\n<span class=\"hljs-keyword\">import<\/span> numpy <span class=\"hljs-keyword\">as<\/span> np\r\n<span class=\"hljs-keyword\">import<\/span> pandas <span class=\"hljs-keyword\">as<\/span> pd\r\n<span class=\"hljs-keyword\">import<\/span> matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\r\n<span class=\"hljs-keyword\">import<\/span> esda\r\n<span class=\"hljs-keyword\">from<\/span> splot.esda <span class=\"hljs-keyword\">import<\/span> plot_moran, lisa_cluster\r\n\r\n<span class=\"hljs-comment\"># Load disease incidence shapefile (e.g., county-level cholera or malaria incidence)<\/span>\r\ngdf = gpd.read_file(<span class=\"hljs-string\">\"path\/to\/disease_incidence_data.shp\"<\/span>)\r\n\r\n<span class=\"hljs-comment\"># 1. Queen Contiguity Weights (shares common edge or vertex)<\/span>\r\nw_queen = libpysal.weights.Queen.from_dataframe(gdf, use_index=<span class=\"hljs-literal\">True<\/span>)\r\n\r\n<span class=\"hljs-comment\"># 2. Rook Contiguity Weights (shares common edge only)<\/span>\r\nw_rook = libpysal.weights.Rook.from_dataframe(gdf, use_index=<span class=\"hljs-literal\">True<\/span>)\r\n\r\n<span class=\"hljs-comment\"># 3. K-Nearest Neighbors Weights (e.g., 5 nearest centroid neighbors)<\/span>\r\n<span class=\"hljs-comment\"># Useful for handling irregular polygon sizes or isolated rural districts<\/span>\r\nw_knn = libpysal.weights.KNN.from_dataframe(gdf, k=<span class=\"hljs-number\">5<\/span>, use_index=<span class=\"hljs-literal\">True<\/span>)\r\n\r\n<span class=\"hljs-comment\"># Row-standardize weights so that rows sum to 1 (essential for smoothing variance)<\/span>\r\nw_queen.transform = <span class=\"hljs-string\">'R'<\/span>\r\n\r\nprint(<span class=\"hljs-string\">f\"Number of observations: <span class=\"hljs-subst\">{<span class=\"hljs-built_in\">len<\/span>(gdf)}<\/span>\"<\/span>)\r\nprint(<span class=\"hljs-string\">f\"Average number of neighbors (Queen): <span class=\"hljs-subst\">{w_queen.mean_neighbors:<span class=\"hljs-number\">.2<\/span>f}<\/span>\"<\/span>)\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<h3 data-path-to-node=\"28\"><span class=\"ez-toc-section\" id=\"Step_2_Calculating_Global_Morans_I_Test_Statistics\"><\/span>Step 2: Calculating Global Moran\u2019s I Test Statistics<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1829\" src=\"https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_mynqg3mynqg3mynq-1024x559.jpg\" alt=\"Global and Local Moran's I Moran Scatterplot visualization\" width=\"1024\" height=\"559\" srcset=\"https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_mynqg3mynqg3mynq-1024x559.jpg 1024w, https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_mynqg3mynqg3mynq-300x164.jpg 300w, https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_mynqg3mynqg3mynq-768x419.jpg 768w, https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/Gemini_Generated_Image_mynqg3mynqg3mynq.jpg 1408w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<div>Once the spatial weights matrix is row-standardized, we calculate Global Moran\u2019s I for our target epidemiological variable (e.g., <code data-path-to-node=\"29\" data-index-in-node=\"130\">incidence_rate<\/code>).<\/div>\n<div class=\"code-block ng-tns-c745154712-23 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\" data-hveid=\"0\" data-ved=\"0CAAQhtANahgKEwjT35flgdyXAxUAAAAAHQAAAAAQxgE\">\n<div class=\"formatted-code-block-internal-container ng-tns-c745154712-23\">\n<div class=\"animated-opacity ng-tns-c745154712-23\">\n<div class=\"code-block-decoration header-formatted gds-emphasized-body-m ng-tns-c745154712-23 ng-star-inserted\">\n<p><span class=\"ng-tns-c745154712-23\">Python<\/span><\/p>\n<div class=\"buttons ng-tns-c745154712-23 ng-star-inserted\"><\/div>\n<\/div>\n<pre class=\"ng-tns-c745154712-23\"><code class=\"code-container formatted ng-tns-c745154712-23\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-comment\"># Extract target attribute series<\/span>\r\ny = gdf[<span class=\"hljs-string\">'incidence_rate'<\/span>].values\r\n\r\n<span class=\"hljs-comment\"># Calculate Global Moran's I with permutation-based inference (999 simulations)<\/span>\r\nmi = esda.moran.Moran(y, w_queen, permutations=<span class=\"hljs-number\">999<\/span>)\r\n\r\nprint(<span class=\"hljs-string\">f\"Global Moran's I Statistic: <span class=\"hljs-subst\">{mi.I:<span class=\"hljs-number\">.4<\/span>f}<\/span>\"<\/span>)\r\nprint(<span class=\"hljs-string\">f\"Expected Value under Null Hypothesis: <span class=\"hljs-subst\">{mi.EI:<span class=\"hljs-number\">.4<\/span>f}<\/span>\"<\/span>)\r\nprint(<span class=\"hljs-string\">f\"Pseudo p-value: <span class=\"hljs-subst\">{mi.p_sim:<span class=\"hljs-number\">.4<\/span>f}<\/span>\"<\/span>)\r\nprint(<span class=\"hljs-string\">f\"Z-score: <span class=\"hljs-subst\">{mi.z_sim:<span class=\"hljs-number\">.4<\/span>f}<\/span>\"<\/span>)\r\n\r\n<span class=\"hljs-comment\"># Visualize Moran Scatterplot<\/span>\r\nfig, ax = plot_moran(mi, zstandard=<span class=\"hljs-literal\">True<\/span>, figsize=(<span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">6<\/span>))\r\nplt.title(<span class=\"hljs-string\">\"Global Moran Scatterplot: Disease Incidence Rate\"<\/span>, fontsize=<span class=\"hljs-number\">12<\/span>)\r\nplt.xlabel(<span class=\"hljs-string\">\"Standardized Incidence Rate\"<\/span>)\r\nplt.ylabel(<span class=\"hljs-string\">\"Spatial Lag of Incidence Rate\"<\/span>)\r\nplt.show()\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div>If the pseudo p-value is less than the standard significance threshold (<span class=\"math-inline\" data-math=\"p &lt; 0.05\" data-index-in-node=\"72\">$p &lt; 0.05$<\/span>) and the z-score is positive, we reject the null hypothesis of spatial randomness and confirm significant global spatial clustering across the study region.<\/div>\n<h3 data-path-to-node=\"32\"><span class=\"ez-toc-section\" id=\"Step_3_Generating_Local_Indicators_of_Spatial_Association_LISA\"><\/span>Step 3: Generating Local Indicators of Spatial Association (LISA)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div>To isolate localized hot spots and spatial outliers, we execute Anselin Local Moran\u2019s I using <code data-path-to-node=\"33\" data-index-in-node=\"94\">esda.Moran_Local<\/code>.<\/div>\n<div class=\"code-block ng-tns-c745154712-24 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\" data-hveid=\"0\" data-ved=\"0CAAQhtANahgKEwjT35flgdyXAxUAAAAAHQAAAAAQxwE\">\n<div class=\"formatted-code-block-internal-container ng-tns-c745154712-24\">\n<div class=\"animated-opacity ng-tns-c745154712-24\">\n<div class=\"code-block-decoration header-formatted gds-emphasized-body-m ng-tns-c745154712-24 ng-star-inserted\">\n<p><span class=\"ng-tns-c745154712-24\">Python<\/span><\/p>\n<div class=\"buttons ng-tns-c745154712-24 ng-star-inserted\"><\/div>\n<\/div>\n<pre class=\"ng-tns-c745154712-24\"><code class=\"code-container formatted ng-tns-c745154712-24\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-comment\"># Compute Local Moran's I with 999 permutations for robust pseudo p-values<\/span>\r\nlm = esda.moran.Moran_Local(y, w_queen, permutations=<span class=\"hljs-number\">999<\/span>)\r\n\r\n<span class=\"hljs-comment\"># Assign local statistics back to the GeoDataFrame<\/span>\r\ngdf[<span class=\"hljs-string\">'local_i'<\/span>] = lm.Is\r\ngdf[<span class=\"hljs-string\">'p_value'<\/span>] = lm.p_sim\r\ngdf[<span class=\"hljs-string\">'quadrant'<\/span>] = lm.q\r\n\r\n<span class=\"hljs-comment\"># Print summary counts per quadrant<\/span>\r\nquadrant_labels = {<span class=\"hljs-number\">1<\/span>: <span class=\"hljs-string\">'High-High'<\/span>, <span class=\"hljs-number\">2<\/span>: <span class=\"hljs-string\">'Low-High'<\/span>, <span class=\"hljs-number\">3<\/span>: <span class=\"hljs-string\">'Low-Low'<\/span>, <span class=\"hljs-number\">4<\/span>: <span class=\"hljs-string\">'High-Low'<\/span>}\r\ngdf[<span class=\"hljs-string\">'quad_label'<\/span>] = gdf[<span class=\"hljs-string\">'quadrant'<\/span>].<span class=\"hljs-built_in\">map<\/span>(quadrant_labels)\r\nprint(gdf[<span class=\"hljs-string\">'quad_label'<\/span>].value_counts())\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<h3 data-path-to-node=\"35\"><span class=\"ez-toc-section\" id=\"Step_4_Visualizing_and_Interpreting_LISA_Cluster_Maps\"><\/span>Step 4: Visualizing and Interpreting LISA Cluster Maps<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1732\" src=\"https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/images-5.jpg\" alt=\"\" width=\"377\" height=\"265\" srcset=\"https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/images-5.jpg 377w, https:\/\/helpwithmygisassignment.com\/blog\/wp-content\/uploads\/2026\/10\/images-5-300x211.jpg 300w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/p>\n<div class=\"attachment-container search-images md-has-block-component\"><\/div>\n<div><span class=\"\">To make these analytical outputs actionable for healthcare administrators,<\/span> we map statistically significant local clusters. Standard practice filters out units where the pseudo p-value exceeds <span class=\"math-inline\" data-math=\"0.05\" data-index-in-node=\"193\">$0.05$<\/span> (classifying them as &#8220;Not Significant&#8221;).<\/div>\n<div class=\"code-block ng-tns-c745154712-25 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\" data-hveid=\"0\" data-ved=\"0CAAQhtANahgKEwjT35flgdyXAxUAAAAAHQAAAAAQyQE\">\n<div class=\"formatted-code-block-internal-container ng-tns-c745154712-25\">\n<div class=\"animated-opacity ng-tns-c745154712-25\">\n<div class=\"code-block-decoration header-formatted gds-emphasized-body-m ng-tns-c745154712-25 ng-star-inserted\">\n<p><span class=\"ng-tns-c745154712-25\">Python<\/span><\/p>\n<div class=\"buttons ng-tns-c745154712-25 ng-star-inserted\"><\/div>\n<\/div>\n<pre class=\"ng-tns-c745154712-25\"><code class=\"code-container formatted ng-tns-c745154712-25\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-comment\"># Create significance mask (p &lt; 0.05)<\/span>\r\nsignificance_mask = gdf[<span class=\"hljs-string\">'p_value'<\/span>] &lt; <span class=\"hljs-number\">0.05<\/span>\r\n\r\n<span class=\"hljs-comment\"># Plot LISA Cluster Map using splot<\/span>\r\nfig, ax = plt.subplots(figsize=(<span class=\"hljs-number\">10<\/span>, <span class=\"hljs-number\">10<\/span>))\r\nlisa_cluster(lm, gdf, p=<span class=\"hljs-number\">0.05<\/span>, ax=ax)\r\nplt.title(<span class=\"hljs-string\">\"LISA Cluster Map: Local Disease Hot Spots &amp; Outliers (p &lt; 0.05)\"<\/span>, fontsize=<span class=\"hljs-number\">14<\/span>)\r\nplt.axis(<span class=\"hljs-string\">'off'<\/span>)\r\nplt.show()\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<h2 data-path-to-node=\"40\"><span class=\"ez-toc-section\" id=\"Public_Health_Intervention_Planning_Spatial_Interpretation\"><\/span>Public Health Intervention Planning &amp; Spatial Interpretation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div>Translating statistical output into clinical and logistical interventions requires rigorous quadrant interpretation:<\/div>\n<ol start=\"1\" data-path-to-node=\"42\">\n<li>\n<div><b data-path-to-node=\"42,0,0\" data-index-in-node=\"0\">High-High Clusters (Target Hot Spots):<\/b> These zones represent contiguous regions experiencing elevated disease burdens. Public health agencies must deploy immediate resources here: mobile vaccination clinics, targeted vector control (e.g., indoor residual spraying for malaria), or emergency water purification infrastructure in waterborne outbreak scenarios. For broader contextual understanding of service accessibility, analysts frequently cross-reference these findings with <a class=\"ng-star-inserted\" href=\"https:\/\/www.google.com\/search?q=https:\/\/example.com\/healthcare-desert-spatial-mismatch\" target=\"_blank\" rel=\"noopener\" data-hveid=\"0\" data-ved=\"0CAAQ_4QMahgKEwjT35flgdyXAxUAAAAAHQAAAAAQygE\">healthcare desert spatial mismatch analysis<\/a>.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"42,1,0\" data-index-in-node=\"0\">Low-Low Clusters (Protected Areas):<\/b> These regions act as protective benchmarks. Epidemiologists should investigate what socio-environmental factors (e.g., robust sanitation, high socioeconomic status, effective primary healthcare coverage) maintain low transmission rates.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"42,2,0\" data-index-in-node=\"0\">High-Low Outliers (Isolated Outbreaks):<\/b> A high-rate district surrounded by low-rate neighbors. This pattern often signals localized institutional failure\u2014such as a failing wastewater treatment plant, a contaminated municipal well, or a localized hospital-acquired outbreak. Analysts investigating localized event density can pair these insights with <a class=\"ng-star-inserted\" href=\"https:\/\/www.google.com\/search?q=https:\/\/example.com\/crime-density-kde-analysis\" target=\"_blank\" rel=\"noopener\" data-hveid=\"0\" data-ved=\"0CAAQ_4QMahgKEwjT35flgdyXAxUAAAAAHQAAAAAQywE\">crime density KDE analysis<\/a> or <a class=\"ng-star-inserted\" href=\"https:\/\/www.google.com\/search?q=https:\/\/example.com\/spatial-point-pattern-tutorials\" target=\"_blank\" rel=\"noopener\" data-hveid=\"0\" data-ved=\"0CAAQ_4QMahgKEwjT35flgdyXAxUAAAAAHQAAAAAQzAE\">spatial point pattern tutorials<\/a> to pinpoint exact coordinate-level clustering.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"42,3,0\" data-index-in-node=\"0\">Low-High Outliers (Vulnerable Buffers):<\/b> Low-rate districts directly exposed to high-incidence neighbors. These areas face immediate contagion spillover risk and require aggressive preventive screening and prophylactic distribution.<\/div>\n<\/li>\n<\/ol>\n<h2 data-path-to-node=\"44\"><span class=\"ez-toc-section\" id=\"Methodological_Considerations_Analytical_Pitfalls\"><\/span>Methodological Considerations &amp; Analytical Pitfalls<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div>When deploying spatial autocorrelation in epidemiological research, analysts must navigate several methodological challenges:<\/div>\n<ul data-path-to-node=\"46\">\n<li>\n<div><b data-path-to-node=\"46,0,0\" data-index-in-node=\"0\">Modifiable Areal Unit Problem (MAUP):<\/b> Spatial statistics are highly sensitive to the scale and aggregation zones of spatial units (e.g.,<span class=\"\"> shifting from county-level to census-block-level analysis changes neighborhood adjacency structures).<\/span> Always report scale dependencies.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"46,1,0\" data-index-in-node=\"0\">Edge Effects:<\/b> Units located at the boundary of your study area have fewer defined neighbors in the spatial weights matrix, potentially distorting local statistics. Analysts should buffer study boundaries where feasible.<\/div>\n<\/li>\n<li>\n<div><b data-path-to-node=\"46,2,0\" data-index-in-node=\"0\">Population Density Bias:<\/b> Raw disease case counts or unadjusted rates can reflect underlying population distribution rather than true spatial contagion risk. Always use standardized incidence ratios (SIR), empirical Bayes smoothed rates, or offset models when computing spatial weights.<\/div>\n<\/li>\n<\/ul>\n<h2 data-path-to-node=\"48\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div>Spatial autocorrelation transforms epidemiological analysis from passive disease mapping into predictive spatial intelligence. By combining Global Moran\u2019s I for global trend detection with Local Moran\u2019s I (LISA) for hot spot identification, public health analysts can uncover hidden transmission corridors, allocate scarce medical supplies with surgical precision,<span class=\"\"> and evaluate intervention efficacy across complex geographic landscapes.<\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Spatial Autocorrelation in Practice: Calculating Global and Local Moran\u2019s I for Disease Cluster Analysis In epidemiological surveillance and public health spatial analytics, traditional aspatial statistical models frequently fall short. Standard regression techniques assume that observations are independent and identically distributed (i.i.d.). However, health outcomes, infectious disease transmissions, chronic morbidity rates, and environmental toxic exposures rarely &#8230; <a title=\"Spatial Autocorrelation in Practice: Calculating Global and Local Moran\u2019s I for Disease Cluster Analysis\" class=\"read-more\" href=\"https:\/\/helpwithmygisassignment.com\/blog\/global-and-local-morans-i\/\" aria-label=\"Read more about Spatial Autocorrelation in Practice: Calculating Global and Local Moran\u2019s I for Disease Cluster Analysis\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[],"class_list":["post-1731","post","type-post","status-publish","format-standard","hentry","category-gis-articles","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/posts\/1731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/comments?post=1731"}],"version-history":[{"count":3,"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/posts\/1731\/revisions"}],"predecessor-version":[{"id":1891,"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/posts\/1731\/revisions\/1891"}],"wp:attachment":[{"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/media?parent=1731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/categories?post=1731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/helpwithmygisassignment.com\/blog\/wp-json\/wp\/v2\/tags?post=1731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}