In this exercise, I will be analyzing e the spatio-temporal patterns of COVID-19 case at Central Mexico (i.e. Mexico City (9), Mexico State (15) and Morelos State (17) by using localized spatial statistics methods,
extract municipalities located with the study area, and
calculate the COVID-19 rate (i.e. cases per 10000 population) from e-week 13 until e-week 32.
Show the spatio-temporal distribution of COVID-19 rates at municipality level by using appropriate thematic mapping technique and describe the spatio-temporal patterns reveals.
Perform local Moran’s I analysis and display the results by using appropriate thematic mapping techniques. Describe the spatio-temporal patterns reveal by the maps.
Perform local Getis-Ord Gi analysis and display the results using appropriate thematic mapping techniques. Describe the spatio-temporal patterns reveal by the maps
The following is the geographical map of Mexico:
Mexico Map
This code chunk will check if the R packages in the packaging list have been installed. If no, go ahead to install the missing one. After installation, it will also load the R packages in R.
## Reading layer `municipalities_COVID' from data source `C:\Users\Yong Wei\Documents\Y2\IS415-Geospatial\IS415_TakeHome_Ex02\data\geospatial' using driver `ESRI Shapefile'
## Simple feature collection with 2465 features and 198 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: 911292 ymin: 319149.1 xmax: 4082997 ymax: 2349615
## projected CRS: MEXICO_ITRF_2008_LCC
To further understand the data imported, we use the summary function.
## CVEGEO CVE_ENT CVE_MUN NOMGEO
## Length:2465 Length:2465 Length:2465 Length:2465
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Pop2010 Pop2020 new1 new2
## Min. : 93 Min. : 95 Min. :0 Min. :0
## 1st Qu.: 4306 1st Qu.: 4502 1st Qu.:0 1st Qu.:0
## Median : 12779 Median : 14137 Median :0 Median :0
## Mean : 45573 Mean : 51843 Mean :0 Mean :0
## 3rd Qu.: 32531 3rd Qu.: 36629 3rd Qu.:0 3rd Qu.:0
## Max. :1815786 Max. :1815551 Max. :0 Max. :0
## new3 new4 new5 new6 new7
## Min. :0.0000000 Min. :0 Min. :0.0000000 Min. :0 Min. :0
## 1st Qu.:0.0000000 1st Qu.:0 1st Qu.:0.0000000 1st Qu.:0 1st Qu.:0
## Median :0.0000000 Median :0 Median :0.0000000 Median :0 Median :0
## Mean :0.0004057 Mean :0 Mean :0.0004057 Mean :0 Mean :0
## 3rd Qu.:0.0000000 3rd Qu.:0 3rd Qu.:0.0000000 3rd Qu.:0 3rd Qu.:0
## Max. :1.0000000 Max. :0 Max. :1.0000000 Max. :0 Max. :0
## new8 new9 new10 new11
## Min. :0 Min. :0.00000 Min. :0.000000 Min. : 0.00000
## 1st Qu.:0 1st Qu.:0.00000 1st Qu.:0.000000 1st Qu.: 0.00000
## Median :0 Median :0.00000 Median :0.000000 Median : 0.00000
## Mean :0 Mean :0.00284 Mean :0.002028 Mean : 0.07262
## 3rd Qu.:0 3rd Qu.:0.00000 3rd Qu.:0.000000 3rd Qu.: 0.00000
## Max. :0 Max. :1.00000 Max. :1.000000 Max. :29.00000
## new12 new13 new14 new15
## Min. : 0.0000 Min. : 0.0000 Min. : 0.0000 Min. : 0.000
## 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.000
## Median : 0.0000 Median : 0.0000 Median : 0.0000 Median : 0.000
## Mean : 0.2333 Mean : 0.4146 Mean : 0.7797 Mean : 1.243
## 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.000
## Max. :56.0000 Max. :40.0000 Max. :165.0000 Max. :184.000
## new16 new17 new18 new19
## Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000
## Median : 0.000 Median : 0.000 Median : 0.000 Median : 0.000
## Mean : 2.301 Mean : 3.447 Mean : 4.254 Mean : 5.667
## 3rd Qu.: 0.000 3rd Qu.: 0.000 3rd Qu.: 1.000 3rd Qu.: 1.000
## Max. :301.000 Max. :535.000 Max. :693.000 Max. :863.000
## new20 new21 new22 new23
## Min. : 0.0 Min. : 0.000 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.0 1st Qu.: 0.000 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 0.0 Median : 0.000 Median : 0.00 Median : 0.00
## Mean : 7.5 Mean : 9.197 Mean : 10.54 Mean : 11.87
## 3rd Qu.: 2.0 3rd Qu.: 2.000 3rd Qu.: 3.00 3rd Qu.: 3.00
## Max. :966.0 Max. :1076.000 Max. :873.00 Max. :884.00
## new24 new25 new26 new27
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 1.00 Median : 1.00 Median : 1.00 Median : 1.00
## Mean : 13.49 Mean : 14.76 Mean : 15.29 Mean : 16.74
## 3rd Qu.: 4.00 3rd Qu.: 5.00 3rd Qu.: 4.00 3rd Qu.: 5.00
## Max. :1138.00 Max. :1718.00 Max. :1607.00 Max. :1161.00
## new28 new29 new30 new31
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 1.00 Median : 1.00 Median : 1.00 Median : 1.00
## Mean : 16.86 Mean : 18.37 Mean : 17.75 Mean : 14.26
## 3rd Qu.: 5.00 3rd Qu.: 5.00 3rd Qu.: 6.00 3rd Qu.: 5.00
## Max. :1342.00 Max. :1395.00 Max. :1321.00 Max. :1206.00
## new32 cumul1 cumul2 cumul3
## Min. : 0.000 Min. :0 Min. :0 Min. :0.0000000
## 1st Qu.: 0.000 1st Qu.:0 1st Qu.:0 1st Qu.:0.0000000
## Median : 0.000 Median :0 Median :0 Median :0.0000000
## Mean : 2.653 Mean :0 Mean :0 Mean :0.0004057
## 3rd Qu.: 1.000 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0.0000000
## Max. :240.000 Max. :0 Max. :0 Max. :1.0000000
## cumul4 cumul5 cumul6
## Min. :0.0000000 Min. :0.0000000 Min. :0.0000000
## 1st Qu.:0.0000000 1st Qu.:0.0000000 1st Qu.:0.0000000
## Median :0.0000000 Median :0.0000000 Median :0.0000000
## Mean :0.0004057 Mean :0.0008114 Mean :0.0008114
## 3rd Qu.:0.0000000 3rd Qu.:0.0000000 3rd Qu.:0.0000000
## Max. :1.0000000 Max. :1.0000000 Max. :1.0000000
## cumul7 cumul8 cumul9 cumul10
## Min. :0.0000000 Min. :0.0000000 Min. :0.000000 Min. :0.000000
## 1st Qu.:0.0000000 1st Qu.:0.0000000 1st Qu.:0.000000 1st Qu.:0.000000
## Median :0.0000000 Median :0.0000000 Median :0.000000 Median :0.000000
## Mean :0.0008114 Mean :0.0008114 Mean :0.003651 Mean :0.005679
## 3rd Qu.:0.0000000 3rd Qu.:0.0000000 3rd Qu.:0.000000 3rd Qu.:0.000000
## Max. :1.0000000 Max. :1.0000000 Max. :1.000000 Max. :2.000000
## cumul11 cumul12 cumul13 cumul14
## Min. : 0.0000 Min. : 0.0000 Min. : 0.0000 Min. : 0.000
## 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.000
## Median : 0.0000 Median : 0.0000 Median : 0.0000 Median : 0.000
## Mean : 0.0783 Mean : 0.3116 Mean : 0.7262 Mean : 1.506
## 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.000
## Max. :31.0000 Max. :87.0000 Max. :112.0000 Max. :209.000
## cumul15 cumul16 cumul17 cumul18
## Min. : 0.000 Min. : 0.00 Min. : 0.000 Min. : 0.00
## 1st Qu.: 0.000 1st Qu.: 0.00 1st Qu.: 0.000 1st Qu.: 0.00
## Median : 0.000 Median : 0.00 Median : 0.000 Median : 0.00
## Mean : 2.748 Mean : 5.05 Mean : 8.497 Mean : 12.75
## 3rd Qu.: 0.000 3rd Qu.: 1.00 3rd Qu.: 1.000 3rd Qu.: 2.00
## Max. :393.000 Max. :681.00 Max. :1061.000 Max. :1754.00
## cumul19 cumul20 cumul21 cumul22
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 0.00 Median : 1.00 Median : 1.00 Median : 2.00
## Mean : 18.42 Mean : 25.92 Mean : 35.12 Mean : 45.65
## 3rd Qu.: 3.00 3rd Qu.: 5.00 3rd Qu.: 7.00 3rd Qu.: 10.00
## Max. :2617.00 Max. :3583.00 Max. :4659.00 Max. :5532.00
## cumul23 cumul24 cumul25 cumul26
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.0
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 1.00 1st Qu.: 1.0
## Median : 2.00 Median : 3.00 Median : 4.00 Median : 5.0
## Mean : 57.52 Mean : 71.01 Mean : 85.78 Mean : 101.1
## 3rd Qu.: 13.00 3rd Qu.: 17.00 3rd Qu.: 21.00 3rd Qu.: 26.0
## Max. :6416.00 Max. :7234.00 Max. :7981.00 Max. :8646.0
## cumul27 cumul28 cumul29 cumul30
## Min. : 0.0 Min. : 0.0 Min. : 0 Min. : 0.0
## 1st Qu.: 1.0 1st Qu.: 1.0 1st Qu.: 1 1st Qu.: 2.0
## Median : 6.0 Median : 7.0 Median : 9 Median : 10.0
## Mean : 117.8 Mean : 134.7 Mean : 153 Mean : 170.8
## 3rd Qu.: 30.0 3rd Qu.: 35.0 3rd Qu.: 41 3rd Qu.: 48.0
## Max. :9408.0 Max. :10078.0 Max. :11200 Max. :12521.0
## cumul31 cumul32 activ1 activ2 activ3
## Min. : 0 Min. : 0.0 Min. :0 Min. :0 Min. :0.0000000
## 1st Qu.: 2 1st Qu.: 2.0 1st Qu.:0 1st Qu.:0 1st Qu.:0.0000000
## Median : 11 Median : 11.0 Median :0 Median :0 Median :0.0000000
## Mean : 185 Mean : 187.7 Mean :0 Mean :0 Mean :0.0004057
## 3rd Qu.: 54 3rd Qu.: 54.0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0.0000000
## Max. :13522 Max. :13762.0 Max. :0 Max. :0 Max. :1.0000000
## activ4 activ5 activ6 activ7
## Min. :0.0000000 Min. :0.0000000 Min. :0.000000 Min. :0.000000
## 1st Qu.:0.0000000 1st Qu.:0.0000000 1st Qu.:0.000000 1st Qu.:0.000000
## Median :0.0000000 Median :0.0000000 Median :0.000000 Median :0.000000
## Mean :0.0004057 Mean :0.0008114 Mean :0.001217 Mean :0.001217
## 3rd Qu.:0.0000000 3rd Qu.:0.0000000 3rd Qu.:0.000000 3rd Qu.:0.000000
## Max. :1.0000000 Max. :1.0000000 Max. :1.000000 Max. :1.000000
## activ8 activ9 activ10 activ11
## Min. :0.00000 Min. :0.000000 Min. : 0.00000 Min. : 0.0000
## 1st Qu.:0.00000 1st Qu.:0.000000 1st Qu.: 0.00000 1st Qu.: 0.0000
## Median :0.00000 Median :0.000000 Median : 0.00000 Median : 0.0000
## Mean :0.00284 Mean :0.006491 Mean : 0.03286 Mean : 0.2041
## 3rd Qu.:0.00000 3rd Qu.:0.000000 3rd Qu.: 0.00000 3rd Qu.: 0.0000
## Max. :1.00000 Max. :2.000000 Max. :12.00000 Max. :59.0000
## activ12 activ13 activ14 activ15
## Min. : 0.0000 Min. : 0.000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 0.0000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000
## Median : 0.0000 Median : 0.000 Median : 0.000 Median : 0.000
## Mean : 0.5651 Mean : 1.198 Mean : 2.314 Mean : 4.123
## 3rd Qu.: 0.0000 3rd Qu.: 0.000 3rd Qu.: 0.000 3rd Qu.: 0.000
## Max. :103.0000 Max. :134.000 Max. :332.000 Max. :606.000
## activ16 activ17 activ18 activ19
## Min. : 0.000 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.000 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 0.000 Median : 0.00 Median : 0.00 Median : 1.00
## Mean : 7.028 Mean : 11.06 Mean : 16.21 Mean : 22.69
## 3rd Qu.: 1.000 3rd Qu.: 2.00 3rd Qu.: 3.00 3rd Qu.: 4.00
## Max. :921.000 Max. :1492.00 Max. :2315.00 Max. :3207.00
## activ20 activ21 activ22 activ23
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 1.00 Median : 1.00 Median : 2.00 Median : 3.00
## Mean : 31.25 Mean : 41.36 Mean : 52.47 Mean : 65.75
## 3rd Qu.: 6.00 3rd Qu.: 9.00 3rd Qu.: 11.00 3rd Qu.: 15.00
## Max. :4207.00 Max. :5208.00 Max. :6095.00 Max. :6979.00
## activ24 activ25 activ26 activ27
## Min. : 0.00 Min. : 0.00 Min. : 0.0 Min. : 0.0
## 1st Qu.: 0.00 1st Qu.: 1.00 1st Qu.: 1.0 1st Qu.: 1.0
## Median : 4.00 Median : 5.00 Median : 6.0 Median : 7.0
## Mean : 79.69 Mean : 95.46 Mean : 110.8 Mean : 128.7
## 3rd Qu.: 19.00 3rd Qu.: 24.00 3rd Qu.: 28.0 3rd Qu.: 34.0
## Max. :7723.00 Max. :8434.00 Max. :9100.0 Max. :9874.0
## activ28 activ29 activ30 activ31
## Min. : 0.0 Min. : 0.0 Min. : 0.0 Min. : 0.0
## 1st Qu.: 1.0 1st Qu.: 2.0 1st Qu.: 2.0 1st Qu.: 2.0
## Median : 8.0 Median : 9.0 Median : 10.0 Median : 11.0
## Mean : 146.4 Mean : 164.1 Mean : 179.7 Mean : 187.3
## 3rd Qu.: 39.0 3rd Qu.: 46.0 3rd Qu.: 52.0 3rd Qu.: 54.0
## Max. :10774.0 Max. :12147.0 Max. :13279.0 Max. :13733.0
## activ32 death1 death2 death3 death4 death5
## Min. : 0.0 Min. :0 Min. :0 Min. :0 Min. :0 Min. :0
## 1st Qu.: 2.0 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0
## Median : 11.0 Median :0 Median :0 Median :0 Median :0 Median :0
## Mean : 187.7 Mean :0 Mean :0 Mean :0 Mean :0 Mean :0
## 3rd Qu.: 54.0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0
## Max. :13762.0 Max. :0 Max. :0 Max. :0 Max. :0 Max. :0
## death6 death7 death8 death9 death10 death11
## Min. :0 Min. :0 Min. :0 Min. :0 Min. :0 Min. :0
## 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0
## Median :0 Median :0 Median :0 Median :0 Median :0 Median :0
## Mean :0 Mean :0 Mean :0 Mean :0 Mean :0 Mean :0
## 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0
## Max. :0 Max. :0 Max. :0 Max. :0 Max. :0 Max. :0
## death12 death13 death14 death15
## Min. :0.000000 Min. :0.0000 Min. : 0.00000 Min. : 0.0000
## 1st Qu.:0.000000 1st Qu.:0.0000 1st Qu.: 0.00000 1st Qu.: 0.0000
## Median :0.000000 Median :0.0000 Median : 0.00000 Median : 0.0000
## Mean :0.001217 Mean :0.0142 Mean : 0.06166 Mean : 0.1497
## 3rd Qu.:0.000000 3rd Qu.:0.0000 3rd Qu.: 0.00000 3rd Qu.: 0.0000
## Max. :1.000000 Max. :2.0000 Max. :11.00000 Max. :26.0000
## death16 death17 death18 death19
## Min. : 0.0000 Min. : 0.0000 Min. : 0.0000 Min. : 0.0000
## 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000
## Median : 0.0000 Median : 0.0000 Median : 0.0000 Median : 0.0000
## Mean : 0.2584 Mean : 0.4856 Mean : 0.7026 Mean : 0.8613
## 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000
## Max. :69.0000 Max. :95.0000 Max. :115.0000 Max. :131.0000
## death20 death21 death22 death23
## Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000
## Median : 0.000 Median : 0.000 Median : 0.000 Median : 0.000
## Mean : 1.056 Mean : 1.266 Mean : 1.324 Mean : 1.479
## 3rd Qu.: 0.000 3rd Qu.: 0.000 3rd Qu.: 0.000 3rd Qu.: 0.000
## Max. :174.000 Max. :176.000 Max. :127.000 Max. :121.000
## death24 death25 death26 death27
## Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000
## Median : 0.000 Median : 0.000 Median : 0.000 Median : 0.000
## Mean : 1.617 Mean : 1.611 Mean : 1.533 Mean : 1.589
## 3rd Qu.: 0.000 3rd Qu.: 1.000 3rd Qu.: 1.000 3rd Qu.: 1.000
## Max. :148.000 Max. :136.000 Max. :133.000 Max. :136.000
## death28 death29 death30 death31
## Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000
## Median : 0.000 Median : 0.000 Median : 0.000 Median : 0.000
## Mean : 1.662 Mean : 1.614 Mean : 1.488 Mean : 1.235
## 3rd Qu.: 1.000 3rd Qu.: 1.000 3rd Qu.: 1.000 3rd Qu.: 0.000
## Max. :113.000 Max. :103.000 Max. :110.000 Max. :115.000
## death32 actvrt1 actvrt2 actvrt3
## Min. : 0.000 Min. :0 Min. :0 Min. :0.000e+00
## 1st Qu.: 0.000 1st Qu.:0 1st Qu.:0 1st Qu.:0.000e+00
## Median : 0.000 Median :0 Median :0 Median :0.000e+00
## Mean : 0.484 Mean :0 Mean :0 Mean :8.556e-05
## 3rd Qu.: 0.000 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0.000e+00
## Max. :36.000 Max. :0 Max. :0 Max. :2.109e-01
## actvrt4 actvrt5 actvrt6
## Min. :0.000e+00 Min. :0.0000000 Min. :0.000e+00
## 1st Qu.:0.000e+00 1st Qu.:0.0000000 1st Qu.:0.000e+00
## Median :0.000e+00 Median :0.0000000 Median :0.000e+00
## Mean :8.556e-05 Mean :0.0001277 Mean :6.482e-05
## 3rd Qu.:0.000e+00 3rd Qu.:0.0000000 3rd Qu.:0.000e+00
## Max. :2.109e-01 Max. :0.2108979 Max. :1.039e-01
## actvrt7 actvrt8 actvrt9 actvr10
## Min. :0.000e+00 Min. :0.0000000 Min. :0.000000 Min. :0.00000
## 1st Qu.:0.000e+00 1st Qu.:0.0000000 1st Qu.:0.000000 1st Qu.:0.00000
## Median :0.000e+00 Median :0.0000000 Median :0.000000 Median :0.00000
## Mean :6.482e-05 Mean :0.0003832 Mean :0.000883 Mean :0.00771
## 3rd Qu.:0.000e+00 3rd Qu.:0.0000000 3rd Qu.:0.000000 3rd Qu.:0.00000
## Max. :1.039e-01 Max. :0.3567453 Max. :0.356745 Max. :3.16102
## actvr11 actvr12 actvr13 actvr14
## Min. : 0.0000 Min. : 0.0000 Min. : 0.0000 Min. : 0.000
## 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.000
## Median : 0.0000 Median : 0.0000 Median : 0.0000 Median : 0.000
## Mean : 0.0726 Mean : 0.2659 Mean : 0.7053 Mean : 1.384
## 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.000
## Max. :32.2997 Max. :130.3215 Max. :390.9644 Max. :434.405
## actvr15 actvr16 actvr17 actvr18
## Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.00
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.00
## Median : 0.000 Median : 0.000 Median : 0.000 Median : 0.00
## Mean : 2.141 Mean : 3.476 Mean : 5.476 Mean : 8.28
## 3rd Qu.: 0.000 3rd Qu.: 2.256 3rd Qu.: 5.180 3rd Qu.: 8.48
## Max. :304.083 Max. :251.889 Max. :382.555 Max. :650.34
## actvr19 actvr20 actvr21 actvr22
## Min. : 0.00 Min. : 0.000 Min. : 0.00 Min. : 0.000
## 1st Qu.: 0.00 1st Qu.: 0.000 1st Qu.: 0.00 1st Qu.: 0.000
## Median : 0.00 Median : 1.322 Median : 4.12 Median : 6.556
## Mean : 10.78 Mean : 14.664 Mean : 18.74 Mean : 23.340
## 3rd Qu.: 12.05 3rd Qu.: 16.700 3rd Qu.: 22.31 3rd Qu.: 28.596
## Max. :573.83 Max. :320.578 Max. :398.64 Max. :456.928
## actvr23 actvr24 actvr25 actvr26
## Min. : 0.000 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.000 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 9.638 Median : 12.91 Median : 17.44 Median : 19.07
## Mean : 28.494 Mean : 33.30 Mean : 39.44 Mean : 41.59
## 3rd Qu.: 35.149 3rd Qu.: 42.19 3rd Qu.: 50.20 3rd Qu.: 54.59
## Max. :588.235 Max. :588.24 Max. :1709.40 Max. :1709.40
## actvr27 actvr28 actvr29 actvr30
## Min. : 0.00 Min. : 0.00 Min. : 0.00 Min. : 0.00
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.: 0.00
## Median : 21.08 Median : 20.93 Median : 23.38 Median : 23.60
## Mean : 45.03 Mean : 46.71 Mean : 49.69 Mean : 49.59
## 3rd Qu.: 59.95 3rd Qu.: 60.78 3rd Qu.: 64.16 3rd Qu.: 65.12
## Max. :1709.40 Max. :778.21 Max. :767.10 Max. :670.02
## actvr31 actvr32 dethrt1 dethrt2 dethrt3
## Min. : 0.00 Min. : 0.00 Min. :0 Min. :0 Min. :0
## 1st Qu.: 0.00 1st Qu.: 0.00 1st Qu.:0 1st Qu.:0 1st Qu.:0
## Median : 18.05 Median : 9.43 Median :0 Median :0 Median :0
## Mean : 41.10 Mean : 24.63 Mean :0 Mean :0 Mean :0
## 3rd Qu.: 54.46 3rd Qu.: 31.07 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0
## Max. :965.25 Max. :1206.56 Max. :0 Max. :0 Max. :0
## dethrt4 dethrt5 dethrt6 dethrt7 dethrt8 dethrt9
## Min. :0 Min. :0 Min. :0 Min. :0 Min. :0 Min. :0
## 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0 1st Qu.:0
## Median :0 Median :0 Median :0 Median :0 Median :0 Median :0
## Mean :0 Mean :0 Mean :0 Mean :0 Mean :0 Mean :0
## 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0
## Max. :0 Max. :0 Max. :0 Max. :0 Max. :0 Max. :0
## dthrt10 dthrt11 dthrt12 dthrt13
## Min. :0 Min. :0 Min. :0.0000000 Min. :0.000000
## 1st Qu.:0 1st Qu.:0 1st Qu.:0.0000000 1st Qu.:0.000000
## Median :0 Median :0 Median :0.0000000 Median :0.000000
## Mean :0 Mean :0 Mean :0.0002677 Mean :0.007128
## 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0.0000000 3rd Qu.:0.000000
## Max. :0 Max. :0 Max. :0.3230016 Max. :7.081651
## dthrt14 dthrt15 dthrt16 dthrt17
## Min. : 0.00000 Min. : 0.0000 Min. : 0.0000 Min. : 0.0000
## 1st Qu.: 0.00000 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000
## Median : 0.00000 Median : 0.0000 Median : 0.0000 Median : 0.0000
## Mean : 0.04691 Mean : 0.1111 Mean : 0.1706 Mean : 0.2624
## 3rd Qu.: 0.00000 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000
## Max. :38.25555 Max. :66.7557 Max. :57.6037 Max. :33.9098
## dthrt18 dthrt19 dthrt20 dthrt21
## Min. : 0.0000 Min. : 0.0000 Min. : 0.0000 Min. : 0.0000
## 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.0000
## Median : 0.0000 Median : 0.0000 Median : 0.0000 Median : 0.0000
## Mean : 0.6108 Mean : 0.6582 Mean : 0.9129 Mean : 0.9223
## 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 0.0000
## Max. :142.4501 Max. :54.6747 Max. :186.2197 Max. :86.4304
## dthrt22 dthrt23 dthrt24 dthrt25
## Min. : 0.0000 Min. : 0.000 Min. : 0.000 Min. : 0.0000
## 1st Qu.: 0.0000 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.0000
## Median : 0.0000 Median : 0.000 Median : 0.000 Median : 0.0000
## Mean : 0.9585 Mean : 1.242 Mean : 1.445 Mean : 1.6172
## 3rd Qu.: 0.0000 3rd Qu.: 0.000 3rd Qu.: 0.000 3rd Qu.: 0.7891
## Max. :70.6714 Max. :90.090 Max. :97.276 Max. :63.0915
## dthrt26 dthrt27 dthrt28 dthrt29
## Min. : 0.0000 Min. : 0.0000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 0.000 1st Qu.: 0.000
## Median : 0.0000 Median : 0.0000 Median : 0.000 Median : 0.000
## Mean : 1.5281 Mean : 1.5721 Mean : 1.656 Mean : 1.641
## 3rd Qu.: 0.7959 3rd Qu.: 0.5813 3rd Qu.: 1.378 3rd Qu.: 1.394
## Max. :116.0093 Max. :186.2197 Max. :96.805 Max. :101.937
## dthrt30 dthrt31 dthrt32 geometry
## Min. : 0.000 Min. : 0.000 Min. : 0.0000 MULTIPOLYGON :2465
## 1st Qu.: 0.000 1st Qu.: 0.000 1st Qu.: 0.0000 epsg:NA : 0
## Median : 0.000 Median : 0.000 Median : 0.0000 +proj=lcc ...: 0
## Mean : 1.530 Mean : 1.149 Mean : 0.5302
## 3rd Qu.: 1.267 3rd Qu.: 0.000 3rd Qu.: 0.0000
## Max. :77.942 Max. :50.403 Max. :63.5324
Select relevant information from the data table.
Convert from wide table to long table.
wm_long <- wholemexico %>%
tidyr::pivot_longer(
cols = starts_with("cumul"),
names_to = "week",
values_to = "weekly_cases",
names_prefix = "cumul")
wm_longSelect relevant information from the data table.
mexicocity <- sf_MC %>%
filter(CVE_ENT == c("09")) %>%
select(CVE_ENT, CVE_MUN, NOMGEO,Pop2020, cumul13:cumul32)
mexicocityConvert from wide table to long table.
mc_long <- mexicocity %>%
tidyr::pivot_longer(
cols = starts_with("cumul"),
names_to = "week",
values_to = "weekly_cases",
names_prefix = "cumul")
mc_longSelect relevant information from the data table.
mexicostate <- sf_MC %>%
filter(CVE_ENT == c("15")) %>%
select(CVE_ENT, CVE_MUN, NOMGEO,Pop2020, cumul13:cumul32)
mexicostateConvert from wide table to long table.
ms_long <- mexicostate %>%
tidyr::pivot_longer(
cols = starts_with("cumul"),
names_to = "week",
values_to = "weekly_cases",
names_prefix = "cumul")
ms_longSelect relevant information from the data table.
morelos <- sf_MC %>%
filter(CVE_ENT == c("17")) %>%
select(CVE_ENT, CVE_MUN, NOMGEO,Pop2020, cumul13:cumul32)
morelosConvert from wide table to long table.
m_long <- morelos %>%
tidyr::pivot_longer(
cols = starts_with("cumul"),
names_to = "week",
values_to = "weekly_cases",
names_prefix = "cumul")
m_longCentral Mexico refers to the combination of three municipalities- Mexico City (9), Mexico State (15) and Morelos State (17).
Select relevant information from the data table.
centralmexico <- sf_MC %>%
filter(CVE_ENT == c("09","15","17")) %>%
select(CVE_ENT, CVE_MUN, NOMGEO,Pop2020, cumul13:cumul32)
centralmexicoConvert from wide table to long table.
cm_long <- centralmexico %>%
tidyr::pivot_longer(
cols = starts_with("cumul"),
names_to = "week",
values_to = "weekly_cases",
names_prefix = "cumul")
cm_longGetting the number of COVID-19 Cases in a week throughout the entire Mexico:
sumbyweek_wm <- wm_long %>%
group_by(week) %>%
summarise (`total_inaweek`=sum(`weekly_cases`))
sumbyweek_wmGetting the number of COVID-19 Cases by municipalities throughout the entire Mexico:
sumbymuni_wm <- wm_long %>%
group_by(CVE_ENT) %>%
summarise (`totalbymuni`=sum(`weekly_cases`))
sumbymuni_wmggplot(sumbyweek_wm, aes(x=week, y=total_inaweek)) +
ggtitle("Total Covid-19 cases for each week in Whole Mexico")+
geom_line()+
geom_point()The above graph show how the total COVID-19 cases in entire Mexico has a steady linear increasing trend over the weeks. Week 13 has the lowest number of cases while week 32 has the highest number of cases.
Central Mexico refers to the combination of three municipalities- Mexico City (9), Mexico State (15) and Morelos State (17).
Total Covid-19 cases for each week in Central Mexico(combining Mexico State, Mexico City, Morelos State):
sumbyweek_cm <- cm_long %>%
group_by(week) %>%
summarise (`total_inaweek`=sum(`weekly_cases`))
sumbyweek_cmggplot(sumbyweek_cm, aes(x=week, y=total_inaweek)) +
ggtitle("Total Covid-19 cases for each week in Central Mexico")+
geom_line()+
geom_point()The above graph show how the total COVID-19 cases in Central Mexico has a steady linear increasing trend over the weeks. Week 13 has the lowest number of cases while week 32 has the highest number of cases.
Total Covid-19 cases for from week13 to week32 in Central Mexico:
centralmexico_totalcases_week13to32 <- sum(sumbyweek_cm[, 'total_inaweek'])
centralmexico_totalcases_week13to32 ## [1] 472900
Total Covid-19 cases for each week in Mexico City:
sumbyweek_mc <- mc_long %>%
group_by(week) %>%
summarise (`total_inaweek`=sum(`weekly_cases`))
sumbyweek_mcggplot(sumbyweek_mc, aes(x=week, y=total_inaweek)) +
ggtitle("Total Covid-19 cases for each week in Mexico City")+
geom_line()+
geom_point()The above graph show how the total COVID-19 cases in Mexico City has a steady linear increasing trend over the weeks. Week 13 has the lowest number of cases while week 32 has the highest number of cases.
Total Covid-19 cases for from week13 to week32 in Mexico City:
## [1] 687041
Total Covid-19 cases for each week in Mexico State:
sumbyweek_ms <- ms_long %>%
group_by(week) %>%
summarise (`total_inaweek`=sum(`weekly_cases`))
sumbyweek_msggplot(sumbyweek_ms, aes(x=week, y=total_inaweek)) +
ggtitle("Total Covid-19 cases for each week in Mexico State")+
geom_line()+
geom_point()The above graph show how the total COVID-19 cases in Mexico State has a steady linear increasing trend over the weeks. Week 13 has the lowest number of cases while week 32 has the highest number of cases.
Total Covid-19 cases for from week13 to week32 in Mexico State:
## [1] 501138
Total Covid-19 cases for each week in Morelos State :
sumbyweek_m <- m_long %>%
group_by(week) %>%
summarise (`total_inaweek`=sum(`weekly_cases`))
sumbyweek_mggplot(sumbyweek_m, aes(x=week, y=total_inaweek)) +
ggtitle("Total Covid-19 cases for each week in Morelos State")+
geom_line()+
geom_point()The above graph show how the total COVID-19 cases in Morelos State has a steady linear increasing trend over the weeks. Week 13 has the lowest number of cases while week 32 has the highest number of cases.
Total Covid-19 cases for from week13 to week32 in Morelos State:
## [1] 40081
municipalities <-c('09','15','17')
total <- c(mc_totalcases_week13to32, ms_totalcases_week13to32, m_totalcases_week13to32 )
totalbymuni <- data.frame(municipalities,total)
totalbymuniggplot(data=totalbymuni, aes(x=municipalities, y=total)) +
geom_bar(stat="identity", fill="steelblue")+
geom_text(aes(label=total), vjust=1.6, color="white", size=3.5)+
theme_minimal()In total from week13 to week32, Mexico City (09) has the most total number COVID-19 cases, followed by Mexico State (15) and lastly Morelos State (17). Mexico City has a total of 687041 cases, while Mexico State has 501138 cases and Morelos State has 40081 cases.
The rate COVID-19 rate in Central Mexico is
centralmexicorate<- sf_MC %>%
filter(CVE_ENT == c("09","15","17")) %>%
mutate (CM_Each_Pop= Pop2020)%>%
mutate (CM_Total_Pop= sum(Pop2020))%>%
mutate (CM_TotalCases= sum(totalbymuni$total))%>%
mutate (CM_Total_Rate= CM_TotalCases/CM_Total_Pop*10000)%>%
select(CVE_ENT,NOMGEO,CM_TotalCases,CM_Each_Pop,CM_Total_Pop,CM_Total_Rate)
centralmexicorateThe COVID-19 rate in Central Mexico is 1128.261 per 10000 population.
The following code chunk calculates the number of Covid-19 cases amongst the population (i.e. cases per 10000 population) in Mexico City.
mexicocityrate<- sf_MC %>%
filter(CVE_ENT == c("09")) %>%
mutate (MC_Each_Pop= Pop2020)%>%
mutate (MC_Total_Pop= sum(Pop2020))%>%
mutate (MC_TotalCases= totalbymuni[1,2])%>%
mutate (MC_Total_Rate= totalbymuni[1,2]/MC_Total_Pop*10000)%>%
select(CVE_ENT,NOMGEO,MC_TotalCases,MC_Each_Pop,MC_Total_Pop,MC_Total_Rate)
mexicocityrateThe COVID-19 rate in Mexico City is 761.8007 per 10000 population.
The following code chunk calculates the number of Covid-19 cases amongst the population (i.e. cases per 10000 population) in Mexico State.
mexicostaterate<- sf_MC %>%
filter(CVE_ENT == c("15")) %>%
mutate (MS_Each_Pop= Pop2020)%>%
mutate (MS_Total_Pop= sum(Pop2020))%>%
mutate (MS_TotalCases= totalbymuni[2,2])%>%
mutate (MS_Total_Rate= totalbymuni[2,2]/MS_Total_Pop*10000)%>%
select(CVE_ENT,NOMGEO,MS_TotalCases,MS_Each_Pop,MS_Total_Pop,MS_Total_Rate)
mexicostaterateThe COVID-19 rate in Mexico State is 287.5511 per 10000 population.
The following code chunk calculates the number of Covid-19 cases amongst the population (i.e. cases per 10000 population) in Morelos State.
morelosrate<- sf_MC %>%
filter(CVE_ENT == c("17")) %>%
mutate (M_Each_Pop= Pop2020)%>%
mutate (M_Total_Pop= sum(Pop2020))%>%
mutate (M_TotalCases= totalbymuni[3,2])%>%
mutate (M_Total_Rate= totalbymuni[3,2]/M_Total_Pop*10000)%>%
select(CVE_ENT,NOMGEO,M_TotalCases,M_Each_Pop,M_Total_Pop,M_Total_Rate)
morelosrateThe COVID-19 rate in Mexico State is 196.0854 per 10000 population.
There has been consistent increase over the weeks (week 13 to week 32) in all three municipalities.
In total from week13 to week32, Mexico City (09) has the most total number COVID-19 cases, followed by Mexico State (15) and lastly Morelos State (17).
This is similarly reflected in the COVID-19 cases rate per 10000 population, Mexico City (09) has the highest rate of COVID-19 cases, followed by Mexico State (15) and lastly Morelos State (17).
Plot using the Choropleth map to see the the number of cases across Central Mexico from week 13 to week 32.
merged <- sf_MC%>%
filter(CVE_ENT %in% c("09","15","17"))
tm_shape(merged) +
tm_polygons(c("cumul13","cumul14","cumul15","cumul16","cumul17","cumul18","cumul19","cumul20","cumul21","cumul22","cumul23","cumul24","cumul25","cumul26","cumul27","cumul28","cumul29","cumul30","cumul31","cumul32"),
breaks = c(0,100,1000,5000,10000,15000,20000,Inf), colorNA="light grey",
title="Cumulative Cases") +
tm_facets(free.scales = FALSE) +
tm_layout(panel.labels=c("cumul13","cumul14","cumul15","cumul16","cumul17","cumul18","cumul19","cumul20","cumul21","cumul22","cumul23","cumul24","cumul25","cumul26","cumul27","cumul28","cumul29","cumul30","cumul31","cumul32"))By plotting the number of Covid-19 cases in Central Mexico from week 13 to week 32, we can see that the number of cases are increasing over the weeks (as seen the color are getting darker). It also can be seen that it the same area that has the highest number of cases from the start to the end of the study (i.e. week 13 to week 32).
We also can see a trend that cases start to pick up from week 7 onward, where there are more areas getting higher number of cases. From week 20 onwards, the cases in the similar cluster areas are getting more serious, with some crossing over 5000 cases mark.
For this study, we will be performing local Moran I analysis to detect cluster/outliers for the cumulative cases at the start (week 13) till the end of the study period (32).
The localmoran() function returns a matrix of values whose columns are:
Ii: the local Moran’s I statistics
E.Ii: the expectation of local moran statistic under the randomisation hypothesis
Var.Ii: the variance of local moran statistic under the randomisation hypothesis
Z.Ii:the standard deviate of local moran statistic
Pr(): the p-value of local moran statistic
As there are many rows of values to be displayed, we will be referring to the potted choropleth map to make the analysis if the value for I indicates a cluster,and if the p-value are significant.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc13_q <- nb2listw(mc13_q, style="W", zero.policy = TRUE)
rsmc13_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week13 <- order(merged$CVE_ENT)
localMI_week13 <- localmoran(merged$cumul13, rsmc13_q)
head(localMI_week13)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 3.5741304 -0.005714286 0.15942832 8.965643 1.542375e-19
## 2 3.7593985 -0.005714286 0.15942832 9.429643 2.057433e-21
## 3 17.8561163 -0.005714286 0.20018045 39.922261 0.000000e+00
## 4 1.6010317 -0.005714286 0.09830012 5.124721 1.489896e-07
## 5 0.8280661 -0.005714286 0.15942832 2.088185 1.839058e-02
## 6 1.5934168 -0.005714286 0.09830012 5.100433 1.694387e-07
localMI_week13.map <- tm_shape(merged.localMI_week13) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week13.map <- tm_shape(merged.localMI_week13) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week13.map, pvalue_week13.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul13<- scale(merged$cumul13) %>% as.vector
nci_week13 <- moran.plot(merged$Z.cumul13, rsmc13_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul13", ylab="Spatially Lag z-Cumul13")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 2 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week13 <- vector(mode="numeric",length=nrow(localMI_week13))
DV_week13 <- merged$cumul13 - mean(merged$cumul13)
C_mI_week13 <- localMI_week13 [,1] - mean(localMI_week13 [,1])
signif_week13 <- 0.05
quadrant_week13[DV_week13 >0 & C_mI_week13 >0] <- 4
quadrant_week13[DV_week13 <0 & C_mI_week13 <0] <- 1
quadrant_week13[DV_week13 <0 & C_mI_week13 >0] <- 2
quadrant_week13[DV_week13 >0 & C_mI_week13 <0] <- 3
quadrant_week13[localMI_week13 [,5]>signif_week13 ] <- 0merged.localMI_week13$quadrant_week13 <- quadrant_week13
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek13<- tm_shape(merged.localMI_week13) +
tm_fill(col = "quadrant_week13", style = "cat", palette = colors[c(sort(unique(quadrant_week13)))+1], labels = clusters[c(sort(unique(quadrant_week13)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek13The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc14_q <- nb2listw(mc14_q, style="W", zero.policy = TRUE)
rsmc14_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week14 <- order(merged$CVE_ENT)
localMI_week14 <- localmoran(merged$cumul14, rsmc14_q)
head(localMI_week14)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 6.026910 -0.005714286 0.179061 14.256266 2.049005e-46
## 2 4.856312 -0.005714286 0.179061 11.489914 7.412944e-31
## 3 9.431005 -0.005714286 0.225017 19.893601 2.311627e-88
## 4 6.231790 -0.005714286 0.110127 18.795932 4.076727e-79
## 5 2.155855 -0.005714286 0.179061 5.108208 1.626139e-07
## 6 4.060033 -0.005714286 0.110127 12.251616 8.234097e-35
localMI_week14.map <- tm_shape(merged.localMI_week14) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week14.map <- tm_shape(merged.localMI_week14) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week14.map, pvalue_week14.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul14<- scale(merged$cumul14) %>% as.vector
nci_week14 <- moran.plot(merged$Z.cumul14, rsmc14_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul14", ylab="Spatially Lag z-Cumul14")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 3 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week14 <- vector(mode="numeric",length=nrow(localMI_week14))
DV_week14 <- merged$cumul14 - mean(merged$cumul14)
C_mI_week14 <- localMI_week14 [,1] - mean(localMI_week14 [,1])
signif_week14 <- 0.05
quadrant_week14[DV_week14 >0 & C_mI_week14 >0] <- 4
quadrant_week14[DV_week14 <0 & C_mI_week14 <0] <- 1
quadrant_week14[DV_week14 <0 & C_mI_week14 >0] <- 2
quadrant_week14[DV_week14 >0 & C_mI_week14 <0] <- 3
quadrant_week14[localMI_week14 [,5]>signif_week14 ] <- 0merged.localMI_week14$quadrant_week14 <- quadrant_week14
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek14<- tm_shape(merged.localMI_week14) +
tm_fill(col = "quadrant_week14", style = "cat", palette = colors[c(sort(unique(quadrant_week14)))+1], labels = clusters[c(sort(unique(quadrant_week14)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek14The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc15_q <- nb2listw(mc15_q, style="W", zero.policy = TRUE)
rsmc15_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week15 <- order(merged$CVE_ENT)
localMI_week15 <- localmoran(merged$cumul15, rsmc15_q)
head(localMI_week15)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 5.832830 -0.005714286 0.1826238 13.662364 8.518110e-43
## 2 7.603731 -0.005714286 0.1826238 17.806325 3.156007e-71
## 3 4.211157 -0.005714286 0.2295241 8.801894 6.726298e-19
## 4 8.419587 -0.005714286 0.1122733 25.144744 8.066233e-140
## 5 3.775334 -0.005714286 0.1826238 8.847765 4.464480e-19
## 6 6.826233 -0.005714286 0.1122733 20.389486 1.036563e-92
localMI_week15.map <- tm_shape(merged.localMI_week15) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week15.map <- tm_shape(merged.localMI_week15) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week15.map, pvalue_week15.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul15<- scale(merged$cumul15) %>% as.vector
nci_week15 <- moran.plot(merged$Z.cumul15, rsmc15_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul15", ylab="Spatially Lag z-Cumul15")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 2 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week15 <- vector(mode="numeric",length=nrow(localMI_week15))
DV_week15 <- merged$cumul15 - mean(merged$cumul15)
C_mI_week15 <- localMI_week15 [,1] - mean(localMI_week15 [,1])
signif_week15 <- 0.05
quadrant_week15[DV_week15 >0 & C_mI_week15 >0] <- 4
quadrant_week15[DV_week15 <0 & C_mI_week15 <0] <- 1
quadrant_week15[DV_week15 <0 & C_mI_week15 >0] <- 2
quadrant_week15[DV_week15 >0 & C_mI_week15 <0] <- 3
quadrant_week15[localMI_week15 [,5]>signif_week15 ] <- 0merged.localMI_week15$quadrant_week15 <- quadrant_week15
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek15<- tm_shape(merged.localMI_week15) +
tm_fill(col = "quadrant_week15", style = "cat", palette = colors[c(sort(unique(quadrant_week15)))+1], labels = clusters[c(sort(unique(quadrant_week15)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek15The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc16_q <- nb2listw(mc16_q, style="W", zero.policy = TRUE)
rsmc16_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week16 <- order(merged$CVE_ENT)
localMI_week16 <- localmoran(merged$cumul16, rsmc16_q)
head(localMI_week16)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.412459 -0.005714286 0.1780481 10.470659 5.890971e-26
## 2 7.978223 -0.005714286 0.1780481 18.921190 3.815624e-80
## 3 1.789170 -0.005714286 0.2237356 3.794625 7.393347e-05
## 4 8.540665 -0.005714286 0.1095169 25.825082 2.318230e-147
## 5 6.270002 -0.005714286 0.1780481 14.872866 2.472517e-50
## 6 9.211620 -0.005714286 0.1095169 27.852543 5.017013e-171
localMI_week16.map <- tm_shape(merged.localMI_week16) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week16.map <- tm_shape(merged.localMI_week16) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week16.map, pvalue_week16.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul16<- scale(merged$cumul16) %>% as.vector
nci_week16 <- moran.plot(merged$Z.cumul16, rsmc16_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul16", ylab="Spatially Lag z-Cumul16")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week16 <- vector(mode="numeric",length=nrow(localMI_week16))
DV_week16 <- merged$cumul16 - mean(merged$cumul16)
C_mI_week16 <- localMI_week16 [,1] - mean(localMI_week16 [,1])
signif_week16 <- 0.05
quadrant_week16[DV_week16 >0 & C_mI_week16 >0] <- 4
quadrant_week16[DV_week16 <0 & C_mI_week16 <0] <- 1
quadrant_week16[DV_week16 <0 & C_mI_week16 >0] <- 2
quadrant_week16[DV_week16 >0 & C_mI_week16 <0] <- 3
quadrant_week16[localMI_week16 [,5]>signif_week16 ] <- 0merged.localMI_week16$quadrant_week16 <- quadrant_week16
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek16<- tm_shape(merged.localMI_week16) +
tm_fill(col = "quadrant_week16", style = "cat", palette = colors[c(sort(unique(quadrant_week16)))+1], labels = clusters[c(sort(unique(quadrant_week16)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek16The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc17_q <- nb2listw(mc17_q, style="W", zero.policy = TRUE)
rsmc17_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week17 <- order(merged$CVE_ENT)
localMI_week17 <- localmoran(merged$cumul17, rsmc17_q)
head(localMI_week17)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 3.5551296 -0.005714286 0.1723292 8.577753 4.837221e-18
## 2 7.6612763 -0.005714286 0.1723292 18.469091 1.830985e-76
## 3 0.8433891 -0.005714286 0.2165008 1.824865 3.401068e-02
## 4 8.3600549 -0.005714286 0.1060717 25.686568 8.257504e-146
## 5 6.5709299 -0.005714286 0.1723292 15.842545 7.914172e-57
## 6 10.9264662 -0.005714286 0.1060717 33.566572 2.579979e-247
localMI_week17.map <- tm_shape(merged.localMI_week17) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week17.map <- tm_shape(merged.localMI_week17) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week17.map, pvalue_week17.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul17<- scale(merged$cumul17) %>% as.vector
nci_week17 <- moran.plot(merged$Z.cumul17, rsmc17_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul17", ylab="Spatially Lag z-Cumul17")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week17 <- vector(mode="numeric",length=nrow(localMI_week17))
DV_week17 <- merged$cumul17 - mean(merged$cumul17)
C_mI_week17 <- localMI_week17 [,1] - mean(localMI_week17 [,1])
signif_week17 <- 0.05
quadrant_week17[DV_week17 >0 & C_mI_week17 >0] <- 4
quadrant_week17[DV_week17 <0 & C_mI_week17 <0] <- 1
quadrant_week17[DV_week17 <0 & C_mI_week17 >0] <- 2
quadrant_week17[DV_week17 >0 & C_mI_week17 <0] <- 3
quadrant_week17[localMI_week17 [,5]>signif_week17 ] <- 0merged.localMI_week17$quadrant_week17 <- quadrant_week17
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek17<- tm_shape(merged.localMI_week17) +
tm_fill(col = "quadrant_week17", style = "cat", palette = colors[c(sort(unique(quadrant_week17)))+1], labels = clusters[c(sort(unique(quadrant_week17)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek17The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc18_q <- nb2listw(mc18_q, style="W", zero.policy = TRUE)
rsmc18_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week18 <- order(merged$CVE_ENT)
localMI_week18 <- localmoran(merged$cumul18, rsmc18_q)
head(localMI_week18)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 3.351415 -0.005714286 0.1672989 8.207700 1.127324e-16
## 2 7.227149 -0.005714286 0.1672989 17.683315 2.819094e-70
## 3 0.545606 -0.005714286 0.2101372 1.202687 1.145488e-01
## 4 7.959802 -0.005714286 0.1030414 24.814638 3.115697e-136
## 5 7.081355 -0.005714286 0.1672989 17.326870 1.474753e-67
## 6 11.924947 -0.005714286 0.1030414 37.167087 1.161166e-302
localMI_week18.map <- tm_shape(merged.localMI_week18) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week18.map <- tm_shape(merged.localMI_week18) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week18.map, pvalue_week18.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul18<- scale(merged$cumul18) %>% as.vector
nci_week18 <- moran.plot(merged$Z.cumul18, rsmc18_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul18", ylab="Spatially Lag z-Cumul18")From the Moran Scatterplot, there are many town in Mexico City are located in the second quadrant which represents a cluster. There are a few towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week18 <- vector(mode="numeric",length=nrow(localMI_week18))
DV_week18 <- merged$cumul18 - mean(merged$cumul18)
C_mI_week18 <- localMI_week18 [,1] - mean(localMI_week18 [,1])
signif_week18 <- 0.05
quadrant_week18[DV_week18 >0 & C_mI_week18 >0] <- 4
quadrant_week18[DV_week18 <0 & C_mI_week18 <0] <- 1
quadrant_week18[DV_week18 <0 & C_mI_week18 >0] <- 2
quadrant_week18[DV_week18 >0 & C_mI_week18 <0] <- 3
quadrant_week18[localMI_week18 [,5]>signif_week18 ] <- 0merged.localMI_week18$quadrant_week18 <- quadrant_week18
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek18<- tm_shape(merged.localMI_week18) +
tm_fill(col = "quadrant_week18", style = "cat", palette = colors[c(sort(unique(quadrant_week18)))+1], labels = clusters[c(sort(unique(quadrant_week18)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek18The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc19_q <- nb2listw(mc19_q, style="W", zero.policy = TRUE)
rsmc19_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week19 <- order(merged$CVE_ENT)
localMI_week19 <- localmoran(merged$cumul19, rsmc19_q)
head(localMI_week19)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 3.6055619 -0.005714286 0.1657068 8.8713678 3.612644e-19
## 2 7.3493456 -0.005714286 0.1657068 18.0682503 2.834152e-73
## 3 0.3788911 -0.005714286 0.2081231 0.8430536 1.995992e-01
## 4 8.1221109 -0.005714286 0.1020823 25.4389453 4.678321e-143
## 5 7.0716935 -0.005714286 0.1657068 17.3861773 5.250430e-68
## 6 12.2363056 -0.005714286 0.1020823 38.3157939 0.000000e+00
localMI_week19.map <- tm_shape(merged.localMI_week19) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week19.map <- tm_shape(merged.localMI_week19) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week19.map, pvalue_week19.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul19<- scale(merged$cumul19) %>% as.vector
nci_week19 <- moran.plot(merged$Z.cumul19, rsmc19_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul19", ylab="Spatially Lag z-Cumul19")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week19 <- vector(mode="numeric",length=nrow(localMI_week19))
DV_week19 <- merged$cumul19 - mean(merged$cumul19)
C_mI_week19 <- localMI_week19 [,1] - mean(localMI_week19 [,1])
signif_week19 <- 0.05
quadrant_week19[DV_week19 >0 & C_mI_week19 >0] <- 4
quadrant_week19[DV_week19 <0 & C_mI_week19 <0] <- 1
quadrant_week19[DV_week19 <0 & C_mI_week19 >0] <- 2
quadrant_week19[DV_week19 >0 & C_mI_week19 <0] <- 3
quadrant_week19[localMI_week19 [,5]>signif_week19 ] <- 0merged.localMI_week19$quadrant_week19 <- quadrant_week19
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek19<- tm_shape(merged.localMI_week19) +
tm_fill(col = "quadrant_week19", style = "cat", palette = colors[c(sort(unique(quadrant_week19)))+1], labels = clusters[c(sort(unique(quadrant_week19)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek19The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc20_q <- nb2listw(mc20_q, style="W", zero.policy = TRUE)
rsmc20_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week20 <- order(merged$CVE_ENT)
localMI_week20 <- localmoran(merged$cumul20, rsmc20_q)
head(localMI_week20)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.0292697 -0.005714286 0.1666488 9.8841818 2.437741e-23
## 2 7.2001169 -0.005714286 0.1666488 17.6515560 4.949543e-70
## 3 0.2894812 -0.005714286 0.2093148 0.6452229 2.593914e-01
## 4 8.4178074 -0.005714286 0.1026498 26.2914561 1.200789e-152
## 5 7.0786754 -0.005714286 0.1666488 17.3540702 9.187567e-68
## 6 12.3080780 -0.005714286 0.1026498 38.4337502 0.000000e+00
localMI_week20.map <- tm_shape(merged.localMI_week20) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week20.map <- tm_shape(merged.localMI_week20) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week20.map, pvalue_week20.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul20<- scale(merged$cumul20) %>% as.vector
nci_week20 <- moran.plot(merged$Z.cumul20, rsmc20_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul20", ylab="Spatially Lag z-Cumul20")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week20 <- vector(mode="numeric",length=nrow(localMI_week20))
DV_week20 <- merged$cumul20 - mean(merged$cumul20)
C_mI_week20 <- localMI_week20 [,1] - mean(localMI_week20 [,1])
signif_week20 <- 0.05
quadrant_week20[DV_week20 >0 & C_mI_week20 >0] <- 4
quadrant_week20[DV_week20 <0 & C_mI_week20 <0] <- 1
quadrant_week20[DV_week20 <0 & C_mI_week20 >0] <- 2
quadrant_week20[DV_week20 >0 & C_mI_week20 <0] <- 3
quadrant_week20[localMI_week20 [,5]>signif_week20 ] <- 0merged.localMI_week20$quadrant_week20 <- quadrant_week20
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek20<- tm_shape(merged.localMI_week20) +
tm_fill(col = "quadrant_week20", style = "cat", palette = colors[c(sort(unique(quadrant_week20)))+1], labels = clusters[c(sort(unique(quadrant_week20)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek20The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc21_q <- nb2listw(mc21_q, style="W", zero.policy = TRUE)
rsmc21_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week21 <- order(merged$CVE_ENT)
localMI_week21 <- localmoran(merged$cumul21, rsmc21_q)
head(localMI_week21)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.2553472 -0.005714286 0.1669835 10.427519 9.283631e-26
## 2 7.0481722 -0.005714286 0.1669835 17.262022 4.543621e-67
## 3 0.2754534 -0.005714286 0.2097382 0.613941 2.696272e-01
## 4 8.6217929 -0.005714286 0.1028514 26.901726 1.048232e-159
## 5 6.7815618 -0.005714286 0.1669835 16.609583 2.970257e-62
## 6 12.1642701 -0.005714286 0.1028514 37.947645 0.000000e+00
localMI_week21.map <- tm_shape(merged.localMI_week21) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week21.map <- tm_shape(merged.localMI_week21) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week21.map, pvalue_week21.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul21<- scale(merged$cumul21) %>% as.vector
nci_week21 <- moran.plot(merged$Z.cumul21, rsmc21_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul21", ylab="Spatially Lag z-Cumul21")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week21 <- vector(mode="numeric",length=nrow(localMI_week21))
DV_week21 <- merged$cumul21 - mean(merged$cumul21)
C_mI_week21 <- localMI_week21 [,1] - mean(localMI_week21 [,1])
signif_week21 <- 0.05
quadrant_week21[DV_week21 >0 & C_mI_week21 >0] <- 4
quadrant_week21[DV_week21 <0 & C_mI_week21 <0] <- 1
quadrant_week21[DV_week21 <0 & C_mI_week21 >0] <- 2
quadrant_week21[DV_week21 >0 & C_mI_week21 <0] <- 3
quadrant_week21[localMI_week21 [,5]>signif_week21 ] <- 0merged.localMI_week21$quadrant_week21 <- quadrant_week21
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek21<- tm_shape(merged.localMI_week21) +
tm_fill(col = "quadrant_week21", style = "cat", palette = colors[c(sort(unique(quadrant_week21)))+1], labels = clusters[c(sort(unique(quadrant_week21)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek21The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc22_q <- nb2listw(mc22_q, style="W", zero.policy = TRUE)
rsmc22_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week22 <- order(merged$CVE_ENT)
localMI_week22 <- localmoran(merged$cumul22, rsmc22_q)
head(localMI_week22)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.4108350 -0.005714286 0.1691668 10.7380514 3.372650e-27
## 2 7.2338401 -0.005714286 0.1691668 17.6016843 1.195533e-69
## 3 0.3550808 -0.005714286 0.2125003 0.7826739 2.169093e-01
## 4 8.8440960 -0.005714286 0.1041667 27.4201309 7.891571e-166
## 5 6.4709524 -0.005714286 0.1691668 15.7468592 3.608910e-56
## 6 11.8052106 -0.005714286 0.1041667 36.5948079 1.729544e-293
localMI_week22.map <- tm_shape(merged.localMI_week22) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week22.map <- tm_shape(merged.localMI_week22) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week22.map, pvalue_week22.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul22<- scale(merged$cumul22) %>% as.vector
nci_week22 <- moran.plot(merged$Z.cumul22, rsmc22_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul22", ylab="Spatially Lag z-Cumul22")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week22 <- vector(mode="numeric",length=nrow(localMI_week22))
DV_week22 <- merged$cumul22 - mean(merged$cumul22)
C_mI_week22 <- localMI_week22 [,1] - mean(localMI_week22 [,1])
signif_week22 <- 0.05
quadrant_week22[DV_week22 >0 & C_mI_week22 >0] <- 4
quadrant_week22[DV_week22 <0 & C_mI_week22 <0] <- 1
quadrant_week22[DV_week22 <0 & C_mI_week22 >0] <- 2
quadrant_week22[DV_week22 >0 & C_mI_week22 <0] <- 3
quadrant_week22[localMI_week22 [,5]>signif_week22 ] <- 0merged.localMI_week22$quadrant_week22 <- quadrant_week22
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek22<- tm_shape(merged.localMI_week22) +
tm_fill(col = "quadrant_week22", style = "cat", palette = colors[c(sort(unique(quadrant_week22)))+1], labels = clusters[c(sort(unique(quadrant_week22)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek22The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc23_q <- nb2listw(mc23_q, style="W", zero.policy = TRUE)
rsmc23_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week23 <- order(merged$CVE_ENT)
localMI_week23 <- localmoran(merged$cumul23, rsmc23_q)
head(localMI_week23)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.5760533 -0.005714286 0.1709833 11.0804199 7.806929e-29
## 2 7.2316670 -0.005714286 0.1709833 17.5026823 6.833913e-69
## 3 0.3755344 -0.005714286 0.2147982 0.8226082 2.053654e-01
## 4 9.2178173 -0.005714286 0.1052609 28.4291321 4.414018e-178
## 5 6.1455281 -0.005714286 0.1709833 14.8759941 2.359615e-50
## 6 11.4434278 -0.005714286 0.1052609 35.2889964 4.330949e-273
localMI_week23.map <- tm_shape(merged.localMI_week23) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week23.map <- tm_shape(merged.localMI_week23) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week23.map, pvalue_week23.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul23<- scale(merged$cumul23) %>% as.vector
nci_week23 <- moran.plot(merged$Z.cumul23, rsmc23_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul23", ylab="Spatially Lag z-Cumul23")From the Moran Scatterplot, there are many town in Mexico City are located in the second quadrant which represents a cluster. There are a few towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week23 <- vector(mode="numeric",length=nrow(localMI_week23))
DV_week23 <- merged$cumul23 - mean(merged$cumul23)
C_mI_week23 <- localMI_week23 [,1] - mean(localMI_week23 [,1])
signif_week23 <- 0.05
quadrant_week23[DV_week23 >0 & C_mI_week23 >0] <- 4
quadrant_week23[DV_week23 <0 & C_mI_week23 <0] <- 1
quadrant_week23[DV_week23 <0 & C_mI_week23 >0] <- 2
quadrant_week23[DV_week23 >0 & C_mI_week23 <0] <- 3
quadrant_week23[localMI_week23 [,5]>signif_week23 ] <- 0merged.localMI_week23$quadrant_week23 <- quadrant_week23
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek23<- tm_shape(merged.localMI_week23) +
tm_fill(col = "quadrant_week23", style = "cat", palette = colors[c(sort(unique(quadrant_week23)))+1], labels = clusters[c(sort(unique(quadrant_week23)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek23The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc24_q <- nb2listw(mc24_q, style="W", zero.policy = TRUE)
rsmc24_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week24 <- order(merged$CVE_ENT)
localMI_week24 <- localmoran(merged$cumul24, rsmc24_q)
head(localMI_week24)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.6254042 -0.005714286 0.1724908 11.1507213 3.551410e-29
## 2 7.1117825 -0.005714286 0.1724908 17.1373771 3.904744e-66
## 3 0.4110151 -0.005714286 0.2167052 0.8951986 1.853405e-01
## 4 9.2511470 -0.005714286 0.1061691 28.4095769 7.699978e-178
## 5 5.7460177 -0.005714286 0.1724908 13.8489138 6.457514e-44
## 6 10.9803998 -0.005714286 0.1061691 33.7167041 1.645116e-249
localMI_week24.map <- tm_shape(merged.localMI_week24) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week24.map <- tm_shape(merged.localMI_week24) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week24.map, pvalue_week24.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul24<- scale(merged$cumul24) %>% as.vector
nci_week24 <- moran.plot(merged$Z.cumul24, rsmc24_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul24", ylab="Spatially Lag z-Cumul24")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week24 <- vector(mode="numeric",length=nrow(localMI_week24))
DV_week24 <- merged$cumul24 - mean(merged$cumul24)
C_mI_week24 <- localMI_week24 [,1] - mean(localMI_week24 [,1])
signif_week24 <- 0.05
quadrant_week24[DV_week24 >0 & C_mI_week24 >0] <- 4
quadrant_week24[DV_week24 <0 & C_mI_week24 <0] <- 1
quadrant_week24[DV_week24 <0 & C_mI_week24 >0] <- 2
quadrant_week24[DV_week24 >0 & C_mI_week24 <0] <- 3
quadrant_week24[localMI_week24 [,5]>signif_week24 ] <- 0merged.localMI_week24$quadrant_week24 <- quadrant_week24
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek24<- tm_shape(merged.localMI_week24) +
tm_fill(col = "quadrant_week24", style = "cat", palette = colors[c(sort(unique(quadrant_week24)))+1], labels = clusters[c(sort(unique(quadrant_week24)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek24The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc25_q <- nb2listw(mc25_q, style="W", zero.policy = TRUE)
rsmc25_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week25 <- order(merged$CVE_ENT)
localMI_week25 <- localmoran(merged$cumul25, rsmc25_q)
head(localMI_week25)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.7804019 -0.005714286 0.1738266 11.4795565 8.356780e-31
## 2 7.2816913 -0.005714286 0.1738266 17.4789287 1.036791e-68
## 3 0.4511219 -0.005714286 0.2183952 0.9775501 1.641484e-01
## 4 9.2357565 -0.005714286 0.1069738 28.2554619 6.097870e-176
## 5 5.5479931 -0.005714286 0.1738266 13.3206331 8.780603e-41
## 6 10.7160689 -0.005714286 0.1069738 32.7814635 5.409607e-236
localMI_week25.map <- tm_shape(merged.localMI_week25) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week25.map <- tm_shape(merged.localMI_week25) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week25.map, pvalue_week25.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul25<- scale(merged$cumul25) %>% as.vector
nci_week25 <- moran.plot(merged$Z.cumul25, rsmc25_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul25", ylab="Spatially Lag z-Cumul25")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week25 <- vector(mode="numeric",length=nrow(localMI_week25))
DV_week25 <- merged$cumul25 - mean(merged$cumul25)
C_mI_week25 <- localMI_week25 [,1] - mean(localMI_week25 [,1])
signif_week25 <- 0.05
quadrant_week25[DV_week25 >0 & C_mI_week25 >0] <- 4
quadrant_week25[DV_week25 <0 & C_mI_week25 <0] <- 1
quadrant_week25[DV_week25 <0 & C_mI_week25 >0] <- 2
quadrant_week25[DV_week25 >0 & C_mI_week25 <0] <- 3
quadrant_week25[localMI_week25 [,5]>signif_week25 ] <- 0merged.localMI_week25$quadrant_week25 <- quadrant_week25
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek25<- tm_shape(merged.localMI_week25) +
tm_fill(col = "quadrant_week25", style = "cat", palette = colors[c(sort(unique(quadrant_week25)))+1], labels = clusters[c(sort(unique(quadrant_week25)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek25The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc26_q <- nb2listw(mc26_q, style="W", zero.policy = TRUE)
rsmc26_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week26 <- order(merged$CVE_ENT)
localMI_week26 <- localmoran(merged$cumul26, rsmc26_q)
head(localMI_week26)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.9135375 -0.005714286 0.1747210 11.768645 2.831328e-32
## 2 7.2760739 -0.005714286 0.1747210 17.420694 2.873769e-68
## 3 0.4742622 -0.005714286 0.2195266 1.024416 1.528194e-01
## 4 9.1771472 -0.005714286 0.1075126 28.005825 6.899667e-173
## 5 5.3850507 -0.005714286 0.1747210 12.896677 2.349640e-38
## 6 10.5145405 -0.005714286 0.1075126 32.084598 3.615531e-226
localMI_week26.map <- tm_shape(merged.localMI_week26) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week26.map <- tm_shape(merged.localMI_week26) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week26.map, pvalue_week26.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul26<- scale(merged$cumul26) %>% as.vector
nci_week26 <- moran.plot(merged$Z.cumul26, rsmc26_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul26", ylab="Spatially Lag z-Cumul26")From the Moran Scatterplot, there are many town in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week26 <- vector(mode="numeric",length=nrow(localMI_week26))
DV_week26 <- merged$cumul26 - mean(merged$cumul26)
C_mI_week26 <- localMI_week26 [,1] - mean(localMI_week26 [,1])
signif_week26 <- 0.05
quadrant_week26[DV_week26 >0 & C_mI_week26 >0] <- 4
quadrant_week26[DV_week26 <0 & C_mI_week26 <0] <- 1
quadrant_week26[DV_week26 <0 & C_mI_week26 >0] <- 2
quadrant_week26[DV_week26 >0 & C_mI_week26 <0] <- 3
quadrant_week26[localMI_week26 [,5]>signif_week26 ] <- 0merged.localMI_week26$quadrant_week26 <- quadrant_week26
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek26<- tm_shape(merged.localMI_week26) +
tm_fill(col = "quadrant_week26", style = "cat", palette = colors[c(sort(unique(quadrant_week26)))+1], labels = clusters[c(sort(unique(quadrant_week26)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek26The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc27_q <- nb2listw(mc27_q, style="W", zero.policy = TRUE)
rsmc27_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week27 <- order(merged$CVE_ENT)
localMI_week27 <- localmoran(merged$cumul27, rsmc27_q)
head(localMI_week27)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.9339159 -0.005714286 0.1752579 11.79928 1.968264e-32
## 2 7.4677334 -0.005714286 0.1752579 17.85181 1.399184e-71
## 3 0.5209187 -0.005714286 0.2202059 1.12226 1.308759e-01
## 4 9.1091209 -0.005714286 0.1078360 27.75664 7.244417e-170
## 5 5.1295742 -0.005714286 0.1752579 12.26665 6.839742e-35
## 6 10.3759580 -0.005714286 0.1078360 31.61443 1.169325e-219
localMI_week27.map <- tm_shape(merged.localMI_week27) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week27.map <- tm_shape(merged.localMI_week27) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week27.map, pvalue_week27.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul27<- scale(merged$cumul27) %>% as.vector
nci_week27 <- moran.plot(merged$Z.cumul27, rsmc27_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul27", ylab="Spatially Lag z-Cumul27")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week27 <- vector(mode="numeric",length=nrow(localMI_week27))
DV_week27 <- merged$cumul27 - mean(merged$cumul27)
C_mI_week27 <- localMI_week27 [,1] - mean(localMI_week27 [,1])
signif_week27 <- 0.05
quadrant_week27[DV_week27 >0 & C_mI_week27 >0] <- 4
quadrant_week27[DV_week27 <0 & C_mI_week27 <0] <- 1
quadrant_week27[DV_week27 <0 & C_mI_week27 >0] <- 2
quadrant_week27[DV_week27 >0 & C_mI_week27 <0] <- 3
quadrant_week27[localMI_week27 [,5]>signif_week27 ] <- 0merged.localMI_week27$quadrant_week27 <- quadrant_week27
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek27<- tm_shape(merged.localMI_week27) +
tm_fill(col = "quadrant_week27", style = "cat", palette = colors[c(sort(unique(quadrant_week27)))+1], labels = clusters[c(sort(unique(quadrant_week27)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek27The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc28_q <- nb2listw(mc28_q, style="W", zero.policy = TRUE)
rsmc28_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week28 <- order(merged$CVE_ENT)
localMI_week28 <- localmoran(merged$cumul28, rsmc28_q)
head(localMI_week28)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.9604443 -0.005714286 0.1758387 11.843044 1.169044e-32
## 2 7.5487266 -0.005714286 0.1758387 18.015450 7.368943e-73
## 3 0.5667439 -0.005714286 0.2209406 1.217884 1.116340e-01
## 4 9.0088809 -0.005714286 0.1081859 27.406964 1.132741e-165
## 5 4.9546571 -0.005714286 0.1758387 11.829244 1.378072e-32
## 6 10.2388790 -0.005714286 0.1081859 31.146512 2.827365e-213
localMI_week28.map <- tm_shape(merged.localMI_week28) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week28.map <- tm_shape(merged.localMI_week28) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week28.map, pvalue_week28.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul28<- scale(merged$cumul28) %>% as.vector
nci_week28 <- moran.plot(merged$Z.cumul28, rsmc28_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul28", ylab="Spatially Lag z-Cumul28")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week28 <- vector(mode="numeric",length=nrow(localMI_week28))
DV_week28 <- merged$cumul28 - mean(merged$cumul28)
C_mI_week28 <- localMI_week28 [,1] - mean(localMI_week28 [,1])
signif_week28 <- 0.05
quadrant_week28[DV_week28 >0 & C_mI_week28 >0] <- 4
quadrant_week28[DV_week28 <0 & C_mI_week28 <0] <- 1
quadrant_week28[DV_week28 <0 & C_mI_week28 >0] <- 2
quadrant_week28[DV_week28 >0 & C_mI_week28 <0] <- 3
quadrant_week28[localMI_week28 [,5]>signif_week28 ] <- 0merged.localMI_week28$quadrant_week28 <- quadrant_week28
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek28<- tm_shape(merged.localMI_week28) +
tm_fill(col = "quadrant_week28", style = "cat", palette = colors[c(sort(unique(quadrant_week28)))+1], labels = clusters[c(sort(unique(quadrant_week28)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek28The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc29_q <- nb2listw(mc29_q, style="W", zero.policy = TRUE)
rsmc29_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week29 <- order(merged$CVE_ENT)
localMI_week29 <- localmoran(merged$cumul29, rsmc29_q)
head(localMI_week29)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.9408694 -0.005714286 0.1764670 11.775344 2.615174e-32
## 2 7.9443067 -0.005714286 0.1764670 18.925027 3.547647e-80
## 3 0.6202331 -0.005714286 0.2217354 1.329292 9.187587e-02
## 4 8.8894198 -0.005714286 0.1085644 26.996583 8.104656e-161
## 5 4.7542641 -0.005714286 0.1764670 11.331130 4.600506e-30
## 6 10.1488498 -0.005714286 0.1085644 30.818932 7.307331e-209
localMI_week29.map <- tm_shape(merged.localMI_week29) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week29.map <- tm_shape(merged.localMI_week29) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week29.map, pvalue_week29.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul29<- scale(merged$cumul29) %>% as.vector
nci_week29 <- moran.plot(merged$Z.cumul29, rsmc29_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul29", ylab="Spatially Lag z-Cumul29")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week29 <- vector(mode="numeric",length=nrow(localMI_week29))
DV_week29 <- merged$cumul29 - mean(merged$cumul29)
C_mI_week29 <- localMI_week29 [,1] - mean(localMI_week29 [,1])
signif_week29 <- 0.05
quadrant_week29[DV_week29 >0 & C_mI_week29 >0] <- 4
quadrant_week29[DV_week29 <0 & C_mI_week29 <0] <- 1
quadrant_week29[DV_week29 <0 & C_mI_week29 >0] <- 2
quadrant_week29[DV_week29 >0 & C_mI_week29 <0] <- 3
quadrant_week29[localMI_week29 [,5]>signif_week29 ] <- 0merged.localMI_week29$quadrant_week29 <- quadrant_week29
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek29<- tm_shape(merged.localMI_week29) +
tm_fill(col = "quadrant_week29", style = "cat", palette = colors[c(sort(unique(quadrant_week29)))+1], labels = clusters[c(sort(unique(quadrant_week29)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek29The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc30_q <- nb2listw(mc30_q, style="W", zero.policy = TRUE)
rsmc30_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week30 <- order(merged$CVE_ENT)
localMI_week30 <- localmoran(merged$cumul30, rsmc30_q)
head(localMI_week30)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.9650107 -0.005714286 0.1769267 11.817431 1.586186e-32
## 2 8.1351962 -0.005714286 0.1769267 19.354249 9.385491e-84
## 3 0.6937271 -0.005714286 0.2223169 1.483423 6.898099e-02
## 4 8.8651665 -0.005714286 0.1088413 26.888705 1.488497e-159
## 5 4.6897561 -0.005714286 0.1769267 11.163039 3.092033e-29
## 6 10.0359523 -0.005714286 0.1088413 30.437498 8.767291e-204
localMI_week30.map <- tm_shape(merged.localMI_week30) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week30.map <- tm_shape(merged.localMI_week30) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week30.map, pvalue_week30.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul30<- scale(merged$cumul30) %>% as.vector
nci_week30 <- moran.plot(merged$Z.cumul30, rsmc30_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul30", ylab="Spatially Lag z-Cumul30")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week30 <- vector(mode="numeric",length=nrow(localMI_week30))
DV_week30 <- merged$cumul30 - mean(merged$cumul30)
C_mI_week30 <- localMI_week30 [,1] - mean(localMI_week30 [,1])
signif_week30 <- 0.05
quadrant_week30[DV_week30 >0 & C_mI_week30 >0] <- 4
quadrant_week30[DV_week30 <0 & C_mI_week30 <0] <- 1
quadrant_week30[DV_week30 <0 & C_mI_week30 >0] <- 2
quadrant_week30[DV_week30 >0 & C_mI_week30 <0] <- 3
quadrant_week30[localMI_week30 [,5]>signif_week30 ] <- 0merged.localMI_week30$quadrant_week30 <- quadrant_week30
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek30<- tm_shape(merged.localMI_week30) +
tm_fill(col = "quadrant_week30", style = "cat", palette = colors[c(sort(unique(quadrant_week30)))+1], labels = clusters[c(sort(unique(quadrant_week30)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek30The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc31_q <- nb2listw(mc31_q, style="W", zero.policy = TRUE)
rsmc31_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week31 <- order(merged$CVE_ENT)
localMI_week31 <- localmoran(merged$cumul31, rsmc31_q)
head(localMI_week31)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.9517483 -0.005714286 0.1772214 11.776098 2.591873e-32
## 2 8.4075514 -0.005714286 0.1772214 19.985112 3.711051e-89
## 3 0.7079382 -0.005714286 0.2226897 1.512296 6.522935e-02
## 4 8.7676353 -0.005714286 0.1090188 26.571417 7.264470e-156
## 5 4.6710655 -0.005714286 0.1772214 11.109356 5.648548e-29
## 6 10.0626256 -0.005714286 0.1090188 30.493491 1.589381e-204
localMI_week31.map <- tm_shape(merged.localMI_week31) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week31.map <- tm_shape(merged.localMI_week31) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week31.map, pvalue_week31.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul31<- scale(merged$cumul31) %>% as.vector
nci_week31 <- moran.plot(merged$Z.cumul31, rsmc31_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul31", ylab="Spatially Lag z-Cumul31")From the Moran Scatterplot, there are many towns in Mexico City are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week31 <- vector(mode="numeric",length=nrow(localMI_week31))
DV_week31 <- merged$cumul31 - mean(merged$cumul31)
C_mI_week31 <- localMI_week31 [,1] - mean(localMI_week31 [,1])
signif_week31 <- 0.05
quadrant_week31[DV_week31 >0 & C_mI_week31 >0] <- 4
quadrant_week31[DV_week31 <0 & C_mI_week31 <0] <- 1
quadrant_week31[DV_week31 <0 & C_mI_week31 >0] <- 2
quadrant_week31[DV_week31 >0 & C_mI_week31 <0] <- 3
quadrant_week31[localMI_week31 [,5]>signif_week31 ] <- 0merged.localMI_week31$quadrant_week31 <- quadrant_week31
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek31<- tm_shape(merged.localMI_week31) +
tm_fill(col = "quadrant_week31", style = "cat", palette = colors[c(sort(unique(quadrant_week31)))+1], labels = clusters[c(sort(unique(quadrant_week31)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek31The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
## Link number distribution:
##
## 1 2 3 4 5 6 7 8 9 10 11 14
## 3 3 18 41 31 31 22 13 9 3 1 1
## 3 least connected regions:
## 77 95 121 with 1 link
## 1 most connected region:
## 117 with 14 links
#Row-standardised weights matrix
rsmc32_q <- nb2listw(mc32_q, style="W", zero.policy = TRUE)
rsmc32_q## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 176
## Number of nonzero links: 962
## Percentage nonzero weights: 3.10563
## Average number of links: 5.465909
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 176 30976 176 71.10695 731.679
fips_week32 <- order(merged$CVE_ENT)
localMI_week32 <- localmoran(merged$cumul32, rsmc32_q)
head(localMI_week32)## Ii E.Ii Var.Ii Z.Ii Pr(z > 0)
## 1 4.9283432 -0.005714286 0.1771170 11.72395 4.804015e-32
## 2 8.4058696 -0.005714286 0.1771170 19.98700 3.573003e-89
## 3 0.7049074 -0.005714286 0.2225577 1.50632 6.599256e-02
## 4 8.7303100 -0.005714286 0.1089559 26.46601 1.193833e-154
## 5 4.7282175 -0.005714286 0.1771170 11.24843 1.178757e-29
## 6 10.1069200 -0.005714286 0.1089559 30.63648 2.000503e-206
localMI_week32.map <- tm_shape(merged.localMI_week32) +
tm_fill(col = "Ii",
style = "pretty",
title = "local moran statistics") +
tm_borders(alpha = 0.5)
pvalue_week32.map <- tm_shape(merged.localMI_week32) +
tm_fill(col = "Pr.z...0.",
breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
palette="-Blues",
title = "local Moran's I p-values") +
tm_borders(alpha = 0.5)
tmap_arrange(localMI_week32.map, pvalue_week32.map, asp=1, ncol=2)The areas highlighted in dark green, has high local Moran’s I statistics, indicating that the town has neighboring township with similarly high or low attribute values; the town is part of a cluster. The areas with negative local Moran’s I statistics indicate that the town have neighboring town with not similar values; the town is an outlier. The area highlighted in dark blue is statistically significant as the p-value for those town are very small(less than 0.01), it has a spatial pattern resemble cluster patterns.
merged$Z.cumul32<- scale(merged$cumul32) %>% as.vector
nci_week32 <- moran.plot(merged$Z.cumul32, rsmc32_q, labels=as.character(merged$CVE_ENT), xlab="z-Cumul32", ylab="Spatially Lag z-Cumul32")From the Moran Scatterplot, there are many town in Mexico City and some town in Mexico State are located in the second quadrant which represents a cluster. There are 4 towns in Mexico State are located in the second quadrant which represents a cluster.
quadrant_week32 <- vector(mode="numeric",length=nrow(localMI_week32))
DV_week32 <- merged$cumul32 - mean(merged$cumul32)
C_mI_week32 <- localMI_week32 [,1] - mean(localMI_week32 [,1])
signif_week32 <- 0.05
quadrant_week32[DV_week32 >0 & C_mI_week32 >0] <- 4
quadrant_week32[DV_week32 <0 & C_mI_week32 <0] <- 1
quadrant_week32[DV_week32 <0 & C_mI_week32 >0] <- 2
quadrant_week32[DV_week32 >0 & C_mI_week32 <0] <- 3
quadrant_week32[localMI_week32 [,5]>signif_week32 ] <- 0merged.localMI_week32$quadrant_week32 <- quadrant_week32
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")
lisaweek32<- tm_shape(merged.localMI_week32) +
tm_fill(col = "quadrant_week32", style = "cat", palette = colors[c(sort(unique(quadrant_week32)))+1], labels = clusters[c(sort(unique(quadrant_week32)))+1], popup.vars = c("Postal.Code")) +tm_view(set.zoom.limits = c(11,17)) +
tm_borders(alpha=0.5)
lisaweek32The strongly colored region in red are contribute significantly to the a positive local spatial autocorrelation outcome, while the other regions do not contribute significantly to the local spatial autocorrelation outcome.
tmap_arrange(lisaweek13,lisaweek14,lisaweek15,lisaweek16,lisaweek17,lisaweek18,lisaweek19,lisaweek20,lisaweek21,lisaweek22,lisaweek23,lisaweek24,lisaweek25,lisaweek26,lisaweek27,lisaweek28,lisaweek29,lisaweek30,lisaweek31,lisaweek32)Over the weeks, we can see similar town, falling within the High-High quadrants indicating positive auto-correlations with neighboring town.The pattern is quite consistent over the weeks.
It can also be observed that there is an area starting to form a positive auto-correlations with neighboring town from week 23, from being in the insignificant quadrant in week 13 to high-low quadrant in week 23 and to high-high quadrant in week 24. This possibly shows that the number of cases picked up over the weeks and spread to the neighbours.
I will be performing local Getis-Ord Gi analysis to detect hot spot and/or cold spot areas for the cumulative cases at the start (week 13)-where the number of cases and at the end of the study period (32).
The term ‘hot spot’ has been used generically across disciplines to describe a region or value that is higher relative to its surroundings.
fips_week13 <- order(merged$CVE_ENT)
gi_week13.fixed <- localG(merged$cumul13, rsmc13_q)
gi_week13.fixed## [1] 7.10343173 5.33472746 8.09942181 2.55892264 3.60134197 1.69575250
## [7] 3.79855466 0.68101716 7.94223861 1.17184441 1.95295019 3.11020432
## [13] 8.16282372 5.76779839 9.54849870 2.84901134 -0.67725293 -0.24803186
## [19] -0.67725293 -0.63816347 -0.45671250 -0.59907400 -0.90388532 -0.58481077
## [25] -0.67725293 -0.47611394 0.03247163 -0.53896320 1.56219476 -0.75941557
## [31] -0.75941557 -0.67725293 -0.83435568 -0.26863164 -0.44979509 1.59215384
## [37] -0.96777706 -0.44979509 -0.63816347 -0.20376046 -0.78871256 -0.67725293
## [43] -0.20817933 -0.69520467 0.02724736 -0.26977418 0.38161503 -0.67725293
## [49] 0.81221357 -0.67725293 -0.63816347 -0.58481077 7.01851725 0.15228386
## [55] -0.44237498 -0.72435021 -0.58481077 -0.72325330 1.00359414 0.12878577
## [61] -0.75941557 1.09904865 -0.48004001 -0.84426228 -0.80225097 -0.95171770
## [67] 1.52985503 -0.83435568 -0.13318507 -0.32561974 -0.08975328 -0.80225097
## [73] 4.89460258 2.44528164 -0.35385402 0.06202281 -0.33569458 5.24004426
## [79] -0.71745741 -0.67725293 -0.67725293 -0.72435021 -0.28857553 -0.87407380
## [85] -0.26977418 1.41388932 -0.47611394 -0.63816347 -0.73804154 -0.80225097
## [91] -0.75941557 0.58601963 -0.58481077 -0.58481077 -0.33569458 -0.75941557
## [97] -0.40714286 -0.87407380 -0.65421948 -0.59907400 -0.67725293 -0.97816689
## [103] -0.12878577 -0.83435568 -0.65421948 -0.60787813 -0.32544773 -0.77014625
## [109] -0.69520467 -0.72435021 0.05126908 -0.67725293 -0.80225097 -0.80225097
## [115] 0.15313439 -0.58481077 -0.11970949 -0.83435568 -0.63558163 3.32055826
## [121] -0.33569458 -0.64256997 -0.47611394 -0.02103442 1.16121734 -0.87407380
## [127] -0.67725293 -0.33863122 -0.72435021 -0.75941557 0.80893399 -0.75831406
## [133] -0.63816347 -0.35278496 -0.83435568 -0.76657331 1.01234180 1.13411402
## [139] -0.53980554 -0.67725293 0.29254531 -0.63816347 -0.84295905 -0.58481077
## [145] -0.97816689 -0.80225097 -0.59810194 -0.83575214 -0.54541325 0.70767839
## [151] -0.67725293 -0.36453720 -0.67725293 -0.67725293 -0.80225097 -0.66539315
## [157] -0.67725293 -0.83435568 -0.51288877 -0.67725293 -0.63558163 -0.58396251
## [163] -0.67725293 -0.75941557 -0.87407380 -0.83435568 -0.68928484 -0.72435021
## [169] -0.72435021 -0.91184543 -0.97816689 -0.67725293 -0.67725293 -0.67725293
## [175] -0.80225097 -0.83435568
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul13, listw = rsmc13_q)
## attr(,"class")
## [1] "localG"
merged_week13.gi <- cbind(merged, as.matrix(gi_week13.fixed))
names(merged_week13.gi)[17] <- "gstat"fips_week14 <- order(merged$CVE_ENT)
gi_week14.fixed <- localG(merged$cumul14, rsmc14_q)
gi_week14.fixed## [1] 7.79067210 6.62673015 6.27503773 4.65539283 5.59912728 2.94541468
## [7] 3.68386270 0.96494175 6.82616055 2.24505706 2.01845519 3.92701032
## [13] 8.23699105 7.06819955 8.01753911 4.77150395 -0.75828840 0.11768181
## [19] -0.80563070 -0.78195955 -0.64116965 -0.71094610 -1.03911722 -0.69512826
## [25] -0.78195955 -0.53308249 0.27246199 -0.64010318 2.14220243 -0.88075378
## [31] -0.90336780 -0.80563070 -0.97307187 -0.50845491 -0.55939792 3.22445862
## [37] -1.13507189 -0.36862329 -0.66360379 -0.07422024 -0.73664610 -0.80563070
## [43] -0.42689229 -0.80362817 0.02501561 -0.34136978 0.73808141 -0.80563070
## [49] 2.38194679 -0.80563070 -0.70972995 -0.61337595 5.08721253 0.22205011
## [55] -0.36160526 -0.88213350 -0.69566550 -0.83897367 0.89869213 0.67945057
## [61] -0.90336780 0.92278202 -0.48632029 -0.98413765 -0.97307187 -1.03431052
## [67] 1.03820656 -0.99251331 -0.17640044 -0.52339479 -0.28686274 -0.91474755
## [73] 4.53957650 4.53664971 -0.22054982 0.07951773 -0.39932770 4.33478746
## [79] -0.84802643 -0.78133976 -0.80563070 -0.88213350 -0.44815298 -1.05716998
## [85] -0.39587681 2.50780549 -0.56636448 -0.75828840 -0.91398889 -0.91474755
## [91] -0.90336780 0.39533495 -0.69566550 -0.69566550 -0.39932770 -0.88213350
## [97] -0.17888096 -1.03911722 -0.64855620 -0.54524804 -0.71094610 -1.17846052
## [103] -0.19063721 -0.99251331 -0.64855620 -0.82609387 -0.35587884 -0.73977458
## [109] -0.84053679 -0.88213350 0.24332677 -0.66360379 -0.97307187 -0.95363043
## [115] 0.69293152 -0.55887440 -0.35256029 -0.95363043 -0.64116965 4.94900543
## [121] -0.35239530 -0.84060025 -0.56636448 0.20258235 2.68428397 -1.05716998
## [127] -0.80563070 -0.35127600 -0.88213350 -0.88213350 0.59193750 -0.90267015
## [133] -0.78195955 -0.52519925 -0.99251331 -0.74334294 1.71698748 2.00750155
## [139] -0.66841199 -0.78195955 0.85907912 -0.78195955 -1.02023954 -0.69566550
## [145] -1.14642719 -0.97307187 -0.75706331 -0.93721226 -0.56407822 0.69948809
## [151] -0.80563070 -0.37954999 -0.75767100 -0.80563070 -0.97307187 -0.69611466
## [157] -0.80563070 -0.93418899 -0.53914788 -0.75828840 -0.73222019 -0.69512826
## [163] -0.80563070 -0.88213350 -1.00301168 -0.97155526 -0.86089920 -0.88213350
## [169] -0.77596200 -1.08426511 -1.17846052 -0.73461725 -0.80563070 -0.80563070
## [175] -0.89530610 -0.97307187
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul14, listw = rsmc14_q)
## attr(,"class")
## [1] "localG"
merged_week14.gi <- cbind(merged, as.matrix(gi_week14.fixed))
names(merged_week14.gi)[17] <- "gstat"fips_week15 <- order(merged$CVE_ENT)
gi_week15.fixed <- localG(merged$cumul15, rsmc15_q)
gi_week15.fixed## [1] 7.228300699 7.401219828 4.306968560 5.694919090 6.746692498
## [6] 4.061669204 3.805778063 1.441157893 5.868253012 3.249634262
## [11] 2.395593930 5.422604446 8.294410778 6.687077073 6.489997171
## [16] 5.850455864 -0.827630042 0.450958147 -0.841088150 -0.841088150
## [21] -0.739279282 -0.775547841 -1.070062073 -0.737298387 -0.840737305
## [26] -0.582076275 0.477085336 -0.691432073 1.937346385 -0.921768565
## [31] -0.934307884 -0.841088150 -1.030812930 -0.686847624 -0.616867454
## [36] 3.937222391 -1.175001423 -0.345214654 -0.565818851 -0.072527020
## [41] -0.446296995 -0.854196211 -0.526494666 -0.919653514 0.353720735
## [46] -0.465949232 1.109209121 -0.841088150 2.888965626 -0.814872026
## [51] -0.669337347 -0.556207555 3.406220640 0.276831966 -0.244921958
## [56] -0.946066523 -0.722510210 -0.874357154 1.203995740 1.219540530
## [61] -0.957825162 0.923557128 -0.535182982 -1.049144854 -0.998515437
## [66] -0.874719510 0.500941050 -1.030812930 -0.057684008 -0.711444799
## [71] -0.390490120 -0.998515437 3.433739326 5.890443065 0.062970430
## [76] -0.003201824 -0.423400217 3.561178772 -0.931643985 -0.801415516
## [81] -0.853844569 -0.934307884 -0.621304381 -1.090055759 -0.496132876
## [86] 3.472736403 -0.600506409 -0.801415516 -0.965789978 -0.965365815
## [91] -0.946066523 0.123134741 -0.737602032 -0.722510210 -0.423400217
## [96] -0.946066523 0.105271948 -1.120046288 -0.652100540 -0.408522110
## [101] -0.775547841 -1.238362391 -0.330295692 -1.040717740 -0.652100540
## [106] -0.936291688 -0.210656294 -0.632477186 -0.930106271 -0.922549244
## [111] 0.200313099 -0.631359161 -1.041578761 -0.998515437 1.222648225
## [116] -0.631662068 -0.295443176 -1.020047099 -0.589777797 5.408605711
## [121] -0.397411077 -0.949192816 -0.600506409 0.315002818 3.086989620
## [126] -1.129574425 -0.854196211 -0.416927754 -0.910790605 -0.910790605
## [131] 0.457707526 -0.945672936 -0.841088150 -0.673915496 -1.030812930
## [136] -0.585149109 1.907218917 2.842896628 -0.722510210 -0.814872026
## [141] 1.382395784 -0.814872026 -1.058684410 -0.737602032 -1.202885036
## [146] -1.041578761 -0.748304803 -0.940135309 -0.577441857 1.122958985
## [151] -0.854196211 -0.433765154 -0.801415516 -0.854196211 -1.020047099
## [156] -0.800147313 -0.840389768 -1.019188619 -0.613198509 -0.827980088
## [161] -0.579781563 -0.737298387 -0.827980088 -0.675617819 -1.029612087
## [166] -1.008424058 -0.863756048 -0.922549244 -0.792438792 -1.089134339
## [171] -1.228962026 -0.801763964 -0.814872026 -0.841088150 -0.901622959
## [176] -0.987749606
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul15, listw = rsmc15_q)
## attr(,"class")
## [1] "localG"
merged_week15.gi <- cbind(merged, as.matrix(gi_week15.fixed))
names(merged_week15.gi)[17] <- "gstat"fips_week16 <- order(merged$CVE_ENT)
gi_week16.fixed <- localG(merged$cumul16, rsmc16_q)
gi_week16.fixed## [1] 6.186840103 7.736536222 3.074045388 5.593977676 7.022648523
## [6] 4.816980021 3.870123491 1.735219715 4.937141633 4.042716710
## [11] 2.343536188 6.247555071 8.109386908 6.197532041 5.043470945
## [16] 6.207687284 -0.828278550 0.670801952 -0.835229545 -0.841828424
## [21] -0.658391018 -0.775839633 -1.046319622 -0.732467642 -0.781571108
## [26] -0.587048494 0.689744446 -0.678836729 1.618973568 -0.927087453
## [31] -0.886044773 -0.815432908 -0.969145155 -0.755425157 -0.610910660
## [36] 4.185585437 -1.152508783 -0.139877356 -0.590733375 -0.158744477
## [41] -0.145524590 -0.841828424 -0.624065416 -0.870415853 0.718213407
## [46] -0.451367122 1.367992186 -0.822031787 2.986696956 -0.808834029
## [51] -0.668737518 -0.603313349 2.218154875 0.191280137 0.131142773
## [56] -0.939319082 -0.717425462 -0.865633336 1.362527184 1.350435982
## [61] -0.951356384 0.729796053 -0.519319841 -1.011093394 -0.996459717
## [66] -0.679957993 0.123546491 -1.007299217 -0.184245911 -0.728766245
## [71] -0.497096613 -1.007299217 2.460585664 7.053836037 -0.033292442
## [76] -0.050346831 -0.420452962 3.016975872 -0.940285463 -0.801884642
## [81] -0.828103732 -0.933597731 -0.600206567 -1.066216706 -0.481901520
## [86] 4.385083292 -0.596450822 -0.788862146 -0.984760848 -0.903685277
## [91] -0.909919528 -0.002604496 -0.732467642 -0.717425462 -0.420540737
## [96] -0.945436833 0.236852437 -1.117242713 -0.483527774 -0.353349609
## [101] -0.789037391 -1.215759788 -0.336340994 -1.028113736 -0.483527774
## [106] -0.942877184 -0.306520652 -0.589368041 -0.895807221 -0.898080426
## [111] 0.037031117 -0.670257569 -1.034397966 -0.991039967 1.636627574
## [116] -0.632816735 -0.231755758 -1.018138716 -0.421672862 5.281355289
## [121] -0.407457247 -0.974356771 -0.577894574 0.199501433 3.082479684
## [126] -1.116772078 -0.815432908 -0.448011568 -0.898080426 -0.886044773
## [131] 0.287867393 -0.939319082 -0.835229545 -0.674657368 -1.012501811
## [136] -0.631395698 1.654792441 3.648737183 -0.725023008 -0.808483119
## [141] 1.564695671 -0.822031787 -1.025500350 -0.725023008 -1.187911143
## [146] -1.028760558 -0.747405125 -0.941713070 -0.620873813 1.334323069
## [151] -0.822031787 -0.450706381 -0.815256845 -0.815432908 -1.018138716
## [156] -0.840221039 -0.828278550 -1.028543925 -0.611724986 -0.808658170
## [161] -0.517926200 -0.724870331 -0.828278550 -0.590263783 -1.016125712
## [166] -0.985188567 -0.880321774 -0.921758630 -0.820545116 -1.005163863
## [171] -1.170843773 -0.815256845 -0.815432908 -0.815432908 -0.947681969
## [176] -0.996459717
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul16, listw = rsmc16_q)
## attr(,"class")
## [1] "localG"
merged_week16.gi <- cbind(merged, as.matrix(gi_week16.fixed))
names(merged_week16.gi)[17] <- "gstat"fips_week17 <- order(merged$CVE_ENT)
gi_week17.fixed <- localG(merged$cumul17, rsmc17_q)
gi_week17.fixed## [1] 5.66828028 7.64224986 2.35512317 5.36562691 7.26513045 5.31743852
## [7] 3.33480584 1.86343524 4.21233244 4.79987832 2.34893812 6.61788234
## [13] 7.74189996 5.80660174 4.14991546 6.23083606 -0.81416494 0.66245402
## [19] -0.81810681 -0.83270915 -0.60507748 -0.78525153 -1.03454173 -0.71686205
## [25] -0.75153797 -0.57506681 0.70177429 -0.68710806 1.43562605 -0.91834357
## [31] -0.86299962 -0.79610626 -0.93868579 -0.76796188 -0.57791866 4.17654022
## [37] -1.13143176 0.01047093 -0.56584498 -0.23014348 0.09740908 -0.81810681
## [43] -0.66468740 -0.84256986 0.81683600 -0.43930598 1.56485183 -0.82175739
## [49] 2.97217452 -0.76699860 -0.64504133 -0.57387870 1.74956679 0.08972725
## [55] 0.33795770 -0.93198449 -0.71274327 -0.82715396 1.15724771 1.28895830
## [61] -0.93187530 0.66607746 -0.53981682 -0.95102114 -0.98089902 -0.51311838
## [67] 0.03927609 -0.99888868 -0.20327053 -0.72110048 -0.54041772 -0.99277238
## [73] 1.92701058 7.55208217 -0.10204533 -0.12829331 -0.40908239 2.46894618
## [79] -0.82307769 -0.78438856 -0.80993901 -0.92881919 -0.57523560 -1.04529303
## [85] -0.46476261 4.94660180 -0.58026806 -0.78505808 -0.98342073 -0.86291784
## [91] -0.88613845 -0.03141181 -0.72106504 -0.71274327 -0.40179645 -0.93525920
## [97] 0.25251309 -1.10984023 -0.36198455 -0.34709182 -0.76699860 -1.20968791
## [103] -0.34850661 -1.00440727 -0.36218371 -0.92971286 -0.32430428 -0.56357819
## [109] -0.86205832 -0.89902031 -0.06713862 -0.64643478 -1.02287489 -0.98377771
## [115] 1.77646101 -0.61929673 -0.34578439 -0.99876883 -0.31208883 5.07972290
## [121] -0.40913073 -0.97097569 -0.58026806 0.04021697 2.97285500 -1.11236460
## [127] -0.81445622 -0.50616921 -0.89923732 -0.86649015 0.31459725 -0.92870977
## [133] -0.82905857 -0.65495331 -1.01076173 -0.64192079 1.34002702 4.25733020
## [139] -0.71694634 -0.77026422 1.48161990 -0.78880521 -0.98683145 -0.71274327
## [145] -1.14953066 -1.00764382 -0.74996733 -0.91535801 -0.46687380 1.39997052
## [151] -0.81810681 -0.29041134 -0.78073849 -0.80715505 -0.98665659 -0.70312044
## [157] -0.80282952 -0.99194265 -0.46507274 -0.81051454 -0.29909592 -0.70416922
## [163] -0.80302113 -0.47035097 -1.00872228 -0.91470039 -0.87642282 -0.91561090
## [169] -0.81028664 -0.97637705 -1.14967557 -0.77007314 -0.77795036 -0.79985388
## [175] -0.91793521 -0.92393177
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul17, listw = rsmc17_q)
## attr(,"class")
## [1] "localG"
merged_week17.gi <- cbind(merged, as.matrix(gi_week17.fixed))
names(merged_week17.gi)[17] <- "gstat"fips_week18 <- order(merged$CVE_ENT)
gi_week18.fixed <- localG(merged$cumul18, rsmc18_q)
gi_week18.fixed## [1] 5.347273474 7.568484714 2.042615889 5.217097244 7.447145896
## [6] 5.600023395 2.999770446 1.792029002 3.662335929 5.062184781
## [11] 2.168126134 6.696032885 7.724134961 5.566054590 3.889037402
## [16] 6.230284131 -0.797378510 0.644512732 -0.797628819 -0.818896580
## [21] -0.558387575 -0.769271804 -1.011579684 -0.704345601 -0.737267753
## [26] -0.562268231 0.705432437 -0.673989115 1.354285440 -0.900585578
## [31] -0.829002294 -0.783262886 -0.892253982 -0.719578543 -0.573436959
## [36] 4.101982810 -1.105671255 0.049652210 -0.555996449 -0.249599636
## [41] 0.218301274 -0.799991903 -0.653297446 -0.829644045 0.866333200
## [46] -0.437564867 1.607146477 -0.802354988 2.871520508 -0.776236161
## [51] -0.616656765 -0.554550429 1.512167471 0.018835656 0.349634934
## [56] -0.913932884 -0.696237806 -0.771087319 0.949177313 1.262024686
## [61] -0.921920818 0.586933592 -0.530619297 -0.923111076 -0.942868136
## [66] -0.471221163 0.027683936 -0.971980643 -0.249303968 -0.663368718
## [71] -0.530274414 -0.964140227 1.626689201 7.722269589 -0.165354222
## [76] -0.190025787 -0.396501612 2.099115906 -0.764216858 -0.751928607
## [81] -0.777980430 -0.911883625 -0.526595018 -1.016245468 -0.445932362
## [86] 5.246458578 -0.555755304 -0.747817766 -0.957934545 -0.852166904
## [91] -0.858678735 0.003544263 -0.707066283 -0.696237806 -0.373044819
## [96] -0.920292258 0.275967286 -1.098082614 -0.322191283 -0.365010470
## [101] -0.752605829 -1.189144978 -0.307169661 -0.975019889 -0.328806364
## [106] -0.877404836 -0.343054685 -0.565694426 -0.841935525 -0.883628819
## [111] -0.114450806 -0.629728101 -1.004974817 -0.952495352 1.847494139
## [116] -0.605715638 -0.446669479 -0.975785103 -0.211896031 4.925909595
## [121] -0.405903217 -0.928024557 -0.572367968 -0.039898027 2.815068829
## [126] -1.097748776 -0.799929147 -0.483549458 -0.856628699 -0.837481277
## [131] 0.335150407 -0.907573510 -0.816533496 -0.593513389 -0.987352770
## [136] -0.679161452 1.149946840 4.673956275 -0.704399940 -0.742906483
## [141] 1.445530245 -0.764420995 -0.903206518 -0.677138785 -1.066323433
## [146] -0.991157229 -0.732182037 -0.892818970 -0.405858182 1.246658519
## [151] -0.790414361 -0.251929022 -0.736968172 -0.762120207 -0.954359312
## [156] -0.663449979 -0.794828939 -0.951056370 -0.409551695 -0.778041859
## [161] -0.256256917 -0.696129396 -0.799679146 -0.470962212 -0.969150710
## [166] -0.827982028 -0.875706615 -0.890615180 -0.788110795 -0.898617830
## [171] -1.081360552 -0.718849797 -0.783450311 -0.773997973 -0.878820622
## [176] -0.853589783
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul18, listw = rsmc18_q)
## attr(,"class")
## [1] "localG"
merged_week18.gi <- cbind(merged, as.matrix(gi_week18.fixed))
names(merged_week18.gi)[17] <- "gstat"fips_week19 <- order(merged$CVE_ENT)
gi_week19.fixed <- localG(merged$cumul19, rsmc19_q)
gi_week19.fixed## [1] 5.27354351 7.50882445 1.80040082 5.24500267 7.48245721 5.70575508
## [7] 2.84180298 1.86024444 3.40177718 5.12226262 2.14833626 6.82073138
## [13] 7.60578910 5.55813849 3.72625587 6.24530701 -0.77017127 0.55669624
## [19] -0.78798329 -0.81227042 -0.50962883 -0.76077787 -0.98392426 -0.69858536
## [25] -0.73405461 -0.55288756 0.64240530 -0.66660750 1.32897659 -0.87751152
## [31] -0.82769191 -0.77672888 -0.89362718 -0.64609195 -0.55366406 4.05306288
## [37] -1.08628941 0.02922468 -0.55931423 -0.30530108 0.26373491 -0.79301920
## [43] -0.62081610 -0.84419648 0.80945297 -0.45964922 1.58047305 -0.79297659
## [49] 2.81955141 -0.76551670 -0.61955622 -0.56334535 1.37492145 -0.02592002
## [55] 0.28080653 -0.90278478 -0.68570100 -0.76492880 0.90376130 1.13610031
## [61] -0.90384669 0.54814876 -0.53528038 -0.92590627 -0.93466704 -0.48524374
## [67] 0.07211820 -0.95848884 -0.27777337 -0.58097177 -0.50236540 -0.94782006
## [73] 1.53215839 7.75512239 -0.25410814 -0.26389418 -0.39146153 1.92040746
## [79] -0.75036970 -0.72956171 -0.76670412 -0.89860133 -0.46124062 -1.01034036
## [85] -0.46537792 5.21446104 -0.54167406 -0.74292362 -0.93704790 -0.84613982
## [91] -0.85355809 0.12387320 -0.69677107 -0.68755216 -0.37225109 -0.91148630
## [97] 0.23719390 -1.08575282 -0.33422158 -0.40368595 -0.73006153 -1.17393553
## [103] -0.26289688 -0.96172217 -0.33601244 -0.81467156 -0.38533278 -0.60120256
## [109] -0.84403136 -0.87783998 -0.16089178 -0.64002689 -0.99282272 -0.93994914
## [115] 1.77336025 -0.60178853 -0.44110829 -0.95310212 -0.21993767 4.87540247
## [121] -0.40104610 -0.89282754 -0.55746855 -0.09379769 2.75666916 -1.08407396
## [127] -0.78332967 -0.47298538 -0.84658323 -0.82182884 0.35737004 -0.89422658
## [133] -0.80588185 -0.51925978 -0.98062363 -0.71845938 1.06261752 4.81089625
## [139] -0.70051027 -0.73467563 1.32701152 -0.73661864 -0.88945415 -0.66526499
## [145] -1.03918011 -0.97676667 -0.72470474 -0.87534387 -0.37097781 1.20091433
## [151] -0.78485252 -0.25008362 -0.69281782 -0.75434664 -0.92663981 -0.66229346
## [157] -0.78294889 -0.91404259 -0.38623491 -0.76167278 -0.22605268 -0.69114407
## [163] -0.79115647 -0.46009400 -0.93650028 -0.78341716 -0.86947005 -0.87975591
## [169] -0.79620122 -0.88403117 -1.07750398 -0.68120968 -0.77211739 -0.76564366
## [175] -0.84096131 -0.79210156
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul19, listw = rsmc19_q)
## attr(,"class")
## [1] "localG"
merged_week19.gi <- cbind(merged, as.matrix(gi_week19.fixed))
names(merged_week19.gi)[17] <- "gstat"fips_week20 <- order(merged$CVE_ENT)
gi_week20.fixed <- localG(merged$cumul20, rsmc20_q)
gi_week20.fixed## [1] 5.29278940 7.36944768 1.73715067 5.35007293 7.42968736 5.76472911
## [7] 2.71232370 1.95804748 3.20674149 5.19451182 2.19725205 6.80517833
## [13] 7.51651597 5.62742178 3.71576576 6.31152224 -0.75908060 0.54614163
## [19] -0.79515102 -0.81979147 -0.42474498 -0.75801030 -0.97246601 -0.70385434
## [25] -0.72801160 -0.55828845 0.63233164 -0.65651906 1.26897137 -0.87943203
## [31] -0.83449826 -0.78359622 -0.89719050 -0.54115191 -0.54557352 4.07508777
## [37] -1.08566909 0.08958653 -0.56933145 -0.34864665 0.32982277 -0.79888181
## [43] -0.58382872 -0.85520972 0.78610886 -0.45632598 1.57491265 -0.78610368
## [49] 2.83401053 -0.77087966 -0.63018949 -0.57797888 1.31688538 -0.09911434
## [55] 0.30976498 -0.90976410 -0.67849607 -0.77410197 0.79771796 1.11403194
## [61] -0.90528602 0.53560507 -0.56394165 -0.92954204 -0.93443614 -0.46341832
## [67] 0.18679655 -0.96988772 -0.28701038 -0.47555915 -0.46833735 -0.94588482
## [73] 1.52823142 7.78105892 -0.25743469 -0.35483708 -0.39483089 1.82325041
## [79] -0.78644932 -0.74007315 -0.77164538 -0.89527913 -0.35378335 -1.01454347
## [85] -0.45912762 5.16005549 -0.54692032 -0.73480856 -0.93134884 -0.85128337
## [91] -0.85544084 0.29325060 -0.70120614 -0.67849607 -0.38090562 -0.91921182
## [97] 0.22546008 -1.09653259 -0.28539212 -0.40825267 -0.72197028 -1.16697039
## [103] -0.20404282 -0.96161533 -0.28977913 -0.73160767 -0.38898650 -0.60269999
## [109] -0.84038797 -0.88448032 -0.21629817 -0.65117257 -1.00141038 -0.93164924
## [115] 1.76064884 -0.58834206 -0.48249272 -0.94783064 -0.19135266 4.90998324
## [121] -0.40636214 -0.85136614 -0.56325326 -0.08711512 2.72698856 -1.09217346
## [127] -0.79188112 -0.50961914 -0.85245167 -0.82831422 0.38940991 -0.88798470
## [133] -0.81401417 -0.42272633 -0.99061189 -0.71750444 0.98256580 4.90664161
## [139] -0.70388104 -0.74621223 1.30881667 -0.72796040 -0.89092353 -0.67707894
## [145] -1.03877240 -0.99171750 -0.73288348 -0.89111790 -0.41237689 1.07881422
## [151] -0.79533526 -0.29098851 -0.67484652 -0.76748665 -0.92592484 -0.70561611
## [157] -0.79157448 -0.92703316 -0.42779634 -0.77378704 -0.26806808 -0.70249022
## [163] -0.79634327 -0.46386594 -0.93872928 -0.77078003 -0.87527357 -0.89312591
## [169] -0.79897609 -0.87860948 -1.07667883 -0.68634745 -0.78264951 -0.77681050
## [175] -0.83826228 -0.77338468
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul20, listw = rsmc20_q)
## attr(,"class")
## [1] "localG"
merged_week20.gi <- cbind(merged, as.matrix(gi_week20.fixed))
names(merged_week20.gi)[17] <- "gstat"fips_week21 <- order(merged$CVE_ENT)
gi_week21.fixed <- localG(merged$cumul21, rsmc21_q)
gi_week21.fixed## [1] 5.33328248 7.28507337 1.74250395 5.38480721 7.36067357 5.71269738
## [7] 2.62620699 1.97628803 3.09651942 5.24369157 2.25120431 6.82439042
## [13] 7.46323215 5.65612708 3.75288234 6.29261861 -0.74656496 0.53715541
## [19] -0.79555952 -0.82682958 -0.35613993 -0.76003510 -0.96470683 -0.70958123
## [25] -0.72785265 -0.56308258 0.61998674 -0.66403725 1.23634066 -0.88098363
## [31] -0.84326246 -0.78573699 -0.90057577 -0.45583410 -0.54541546 4.14149562
## [37] -1.08195871 0.10105787 -0.54974224 -0.32712857 0.40986784 -0.79483566
## [43] -0.55921185 -0.86350928 0.74525064 -0.47007239 1.49613082 -0.78947977
## [49] 2.83427715 -0.78141080 -0.62011608 -0.56416655 1.29286330 -0.11805642
## [55] 0.27294577 -0.91290807 -0.68305923 -0.77843863 0.69422819 1.12933794
## [61] -0.91245996 0.53737955 -0.59147265 -0.92986558 -0.93420877 -0.42715512
## [67] 0.27586089 -0.97660134 -0.23164541 -0.39278968 -0.43733022 -0.93415117
## [73] 1.54952109 7.72968823 -0.19826202 -0.37548433 -0.39442913 1.77578189
## [79] -0.83014689 -0.74804129 -0.77476985 -0.90424464 -0.27442569 -1.02403839
## [85] -0.47426251 5.05348046 -0.54817083 -0.73414668 -0.93249034 -0.86163316
## [91] -0.85694531 0.44242276 -0.70751438 -0.68510569 -0.37494214 -0.92414886
## [97] 0.23113003 -1.10244711 -0.28059302 -0.40964684 -0.71721550 -1.16565588
## [103] -0.13962609 -0.96420377 -0.28472261 -0.65299061 -0.33329470 -0.60282352
## [109] -0.84751728 -0.89430857 -0.20773700 -0.64003795 -1.00737439 -0.93782948
## [115] 1.70171639 -0.58732392 -0.52542550 -0.93855938 -0.18439303 4.97382604
## [121] -0.40677530 -0.81211637 -0.57064625 -0.02928169 2.76725604 -1.09759898
## [127] -0.79481207 -0.52697883 -0.85691914 -0.82742283 0.39623655 -0.89706954
## [133] -0.82065597 -0.33896683 -0.98670398 -0.68799645 1.01092258 4.97236674
## [139] -0.70964263 -0.75895990 1.31298270 -0.74148908 -0.89295742 -0.68805314
## [145] -1.04664303 -0.99992941 -0.73762136 -0.91571802 -0.47626933 1.00018932
## [151] -0.79303463 -0.35252048 -0.67198430 -0.77081672 -0.94083565 -0.75454478
## [157] -0.80079772 -0.93398191 -0.48811383 -0.77472346 -0.27876923 -0.70855802
## [163] -0.80264556 -0.41950236 -0.93677197 -0.77539813 -0.88253465 -0.90259716
## [169] -0.80878097 -0.88138223 -1.07245315 -0.69130979 -0.79485926 -0.77975096
## [175] -0.85336042 -0.78160205
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul21, listw = rsmc21_q)
## attr(,"class")
## [1] "localG"
merged_week21.gi <- cbind(merged, as.matrix(gi_week21.fixed))
names(merged_week21.gi)[17] <- "gstat"fips_week22 <- order(merged$CVE_ENT)
gi_week22.fixed <- localG(merged$cumul22, rsmc22_q)
gi_week22.fixed## [1] 5.36632565 7.29044715 1.75519606 5.46256560 7.23486190 5.61843493
## [7] 2.68384523 2.03867856 3.18026406 5.23592248 2.34125804 6.77232292
## [13] 7.37413077 5.67862217 3.83956297 6.26196284 -0.76830658 0.57860937
## [19] -0.80729091 -0.84386014 -0.25151783 -0.75399433 -0.95324720 -0.70977374
## [25] -0.75065459 -0.57059310 0.67513884 -0.65866895 1.22533250 -0.88740837
## [31] -0.86315871 -0.79917476 -0.91849135 -0.33512138 -0.52044556 4.23869701
## [37] -1.08688317 0.16014712 -0.53972847 -0.33342556 0.40134316 -0.80813654
## [43] -0.52141592 -0.85794862 0.75472889 -0.46201176 1.47571167 -0.79785217
## [49] 2.87818423 -0.80224584 -0.61464375 -0.55766615 1.33700638 -0.14071921
## [55] 0.30949381 -0.93141074 -0.68632128 -0.77300208 0.71905993 1.18387876
## [61] -0.93686146 0.53625815 -0.60863588 -0.95059363 -0.92993898 -0.39439016
## [67] 0.38981763 -0.99218747 -0.24089357 -0.27451300 -0.40073858 -0.95671749
## [73] 1.57847136 7.67825600 -0.18926844 -0.40470654 -0.40308972 1.86267698
## [79] -0.85357598 -0.75294057 -0.78204280 -0.91519201 -0.15680668 -1.04417257
## [85] -0.47219597 4.93901119 -0.56251562 -0.73707396 -0.93013641 -0.86936104
## [91] -0.86522830 0.64769416 -0.70807814 -0.69051825 -0.38279565 -0.93285007
## [97] 0.27842267 -1.12637830 -0.23994979 -0.41188195 -0.73049385 -1.16505704
## [103] -0.05645753 -0.97337370 -0.24599152 -0.56582964 -0.32798254 -0.60851875
## [109] -0.83987631 -0.91612986 -0.22862761 -0.62566661 -1.01930043 -0.93650177
## [115] 1.71990685 -0.58328020 -0.49427395 -0.95685998 -0.13498923 5.06098100
## [121] -0.41757361 -0.75586465 -0.58197815 -0.01699742 2.82417372 -1.12022995
## [127] -0.80953629 -0.55395648 -0.86254778 -0.82786601 0.40993530 -0.89559374
## [133] -0.83662833 -0.23225809 -1.00112119 -0.69386965 1.00848959 4.91009180
## [139] -0.70974008 -0.76845968 1.36347791 -0.75996120 -0.91829599 -0.70297470
## [145] -1.07485394 -1.02037773 -0.75083992 -0.93142836 -0.51091141 1.01022265
## [151] -0.80447183 -0.38780990 -0.68803943 -0.78258096 -0.96469165 -0.78756370
## [157] -0.82175516 -0.95387337 -0.52840339 -0.78643579 -0.29598024 -0.72233076
## [163] -0.82401990 -0.41941806 -0.95575162 -0.79300204 -0.90254830 -0.91974815
## [169] -0.82623837 -0.89565655 -1.09979647 -0.70834163 -0.81546606 -0.79286526
## [175] -0.87801067 -0.80585346
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul22, listw = rsmc22_q)
## attr(,"class")
## [1] "localG"
merged_week22.gi <- cbind(merged, as.matrix(gi_week22.fixed))
names(merged_week22.gi)[17] <- "gstat"fips_week23 <- order(merged$CVE_ENT)
gi_week23.fixed <- localG(merged$cumul23, rsmc23_q)
gi_week23.fixed## [1] 5.43678256 7.19598192 1.72629884 5.59910965 7.07648470 5.52896369
## [7] 2.66600549 2.07396794 3.13432527 5.18706502 2.39151751 6.70593572
## [13] 7.24527576 5.63909848 3.85894528 6.28733921 -0.76068534 0.62548650
## [19] -0.81065732 -0.85847579 -0.13494896 -0.75614608 -0.94313871 -0.71402584
## [25] -0.76538157 -0.56690008 0.72074584 -0.66449877 1.25537756 -0.88808502
## [31] -0.87490926 -0.81059215 -0.93321572 -0.22226799 -0.50369018 4.39024486
## [37] -1.07524290 0.16721587 -0.54187696 -0.31316871 0.40117688 -0.81260640
## [43] -0.48460866 -0.87112179 0.74114000 -0.47234061 1.46665302 -0.80525097
## [49] 2.97521163 -0.81381323 -0.61143286 -0.55733576 1.35075058 -0.14770540
## [55] 0.28325141 -0.94207696 -0.69295777 -0.76335687 0.68937132 1.27109392
## [61] -0.94869682 0.54914648 -0.61433890 -0.93925957 -0.92821261 -0.38888850
## [67] 0.51150519 -1.00000190 -0.25704199 -0.16630768 -0.36035821 -0.95013449
## [73] 1.59109247 7.62708534 -0.16764163 -0.41318747 -0.40944649 1.85588452
## [79] -0.87857909 -0.74412612 -0.79251726 -0.92305893 -0.04716915 -1.05948246
## [85] -0.48586722 4.82508306 -0.56443516 -0.73575599 -0.92683106 -0.87281338
## [91] -0.87940686 0.84254373 -0.71120923 -0.69647857 -0.38152478 -0.94061532
## [97] 0.32451524 -1.14219728 -0.23959635 -0.41044228 -0.71493151 -1.16119400
## [103] 0.03296012 -0.97675210 -0.24745676 -0.46510184 -0.33319834 -0.61412730
## [109] -0.85413853 -0.93366441 -0.23762568 -0.61793109 -1.03082443 -0.93878095
## [115] 1.75250306 -0.59087361 -0.48843167 -0.95127866 -0.13196873 5.20787339
## [121] -0.42403845 -0.69238860 -0.58764137 0.01585699 2.92775177 -1.13837416
## [127] -0.81928481 -0.56885881 -0.85949430 -0.82933943 0.44128641 -0.89837024
## [133] -0.84878925 -0.13479483 -1.00245310 -0.69485590 1.03270609 4.82725238
## [139] -0.71395507 -0.76153744 1.45543299 -0.78080362 -0.92971925 -0.71671510
## [145] -1.08846917 -1.03821727 -0.75452960 -0.94869493 -0.54180714 0.97964035
## [151] -0.81019275 -0.41360259 -0.70490328 -0.79240757 -0.98903164 -0.82146841
## [157] -0.83264145 -0.97225021 -0.56221071 -0.79134246 -0.30728414 -0.73372786
## [163] -0.83758320 -0.41606725 -0.96474139 -0.81472599 -0.91462759 -0.93675641
## [169] -0.84497696 -0.90531809 -1.11494127 -0.72494750 -0.82735028 -0.79920037
## [175] -0.90827955 -0.83066747
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul23, listw = rsmc23_q)
## attr(,"class")
## [1] "localG"
merged_week23.gi <- cbind(merged, as.matrix(gi_week23.fixed))
names(merged_week23.gi)[17] <- "gstat"fips_week24 <- order(merged$CVE_ENT)
gi_week24.fixed <- localG(merged$cumul24, rsmc24_q)
gi_week24.fixed## [1] 5.4659275934 7.2310909218 1.7975151712 5.6360301422 6.9308467571
## [6] 5.3725114533 2.7723265132 2.1079426132 3.1522899655 5.1744040015
## [11] 2.4694485493 6.6677744862 7.1620932379 5.5956466669 3.9156700142
## [16] 6.1703093514 -0.7716643194 0.6685239552 -0.8221583930 -0.8743461325
## [21] 0.0007296187 -0.7613257638 -0.9292442743 -0.7169098336 -0.7804178385
## [26] -0.5775797791 0.7671554539 -0.6662687536 1.2786004451 -0.8987598357
## [31] -0.8866971406 -0.8118300905 -0.9511414948 -0.0866959356 -0.4823821866
## [36] 4.4611912441 -1.0746010132 0.1550965644 -0.5229026467 -0.2816602528
## [41] 0.3934253237 -0.8238104193 -0.4620078893 -0.8724087432 0.7185800326
## [46] -0.4773852124 1.4033000831 -0.8041250913 2.9815988992 -0.8270289202
## [51] -0.6054930314 -0.5506229712 1.4079991963 -0.1673299035 0.2531123934
## [56] -0.9555460044 -0.6875897635 -0.7658130001 0.7088775845 1.3445782691
## [61] -0.9683249612 0.5553344554 -0.6209742909 -0.9435087704 -0.9297282101
## [66] -0.3843156348 0.6575435868 -1.0100367299 -0.2270345595 -0.0255329362
## [71] -0.3328073678 -0.9584078225 1.6146514373 7.5415023992 -0.1302118638
## [76] -0.4263551845 -0.4082893713 1.9314494028 -0.8975353060 -0.7503032620
## [81] -0.7949148920 -0.9262499413 0.0874644493 -1.0789947938 -0.4953004114
## [86] 4.6856012018 -0.5717401110 -0.7361722148 -0.9331223802 -0.8651751013
## [91] -0.8777151009 1.0729151107 -0.7144737285 -0.6942861690 -0.3808973453
## [96] -0.9505410590 0.3777955471 -1.1631635702 -0.2627050068 -0.4018425746
## [101] -0.7153979172 -1.1560452792 0.1549496734 -0.9861508708 -0.2663857056
## [106] -0.3460506910 -0.3057225974 -0.6030494324 -0.8491131035 -0.9526044891
## [111] -0.2241571209 -0.6078092552 -1.0442543516 -0.9419892201 1.7307585242
## [116] -0.5846260835 -0.4532941241 -0.9642061312 -0.1530345321 5.2751571609
## [121] -0.4326331451 -0.6451607406 -0.5963780649 0.0561569409 2.9938889076
## [126] -1.1583656473 -0.8274891252 -0.5872072649 -0.8564331503 -0.8364666961
## [131] 0.4737223681 -0.8938187932 -0.8627506410 -0.0028181771 -1.0043077062
## [136] -0.6816501507 1.0585090471 4.7198735582 -0.7180106505 -0.7687404336
## [141] 1.5238876383 -0.8052453511 -0.9485046038 -0.7300925070 -1.1113191060
## [146] -1.0611776439 -0.7609686171 -0.9624810694 -0.5595864093 1.0169328886
## [151] -0.8121568720 -0.4365594829 -0.7257834858 -0.7935062945 -1.0166744038
## [156] -0.8466987448 -0.8439129573 -0.9958545254 -0.5841217542 -0.7925227743
## [161] -0.3002995518 -0.7499640779 -0.8535254976 -0.3977689907 -0.9788342295
## [166] -0.8358077311 -0.9355798706 -0.9586488035 -0.8595646329 -0.9161918312
## [171] -1.1320642720 -0.7447509144 -0.8413835801 -0.7999715296 -0.9298847285
## [176] -0.8571241627
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul24, listw = rsmc24_q)
## attr(,"class")
## [1] "localG"
merged_week24.gi <- cbind(merged, as.matrix(gi_week24.fixed))
names(merged_week24.gi)[17] <- "gstat"fips_week25 <- order(merged$CVE_ENT)
gi_week25.fixed <- localG(merged$cumul25, rsmc25_q)
gi_week25.fixed## [1] 5.49475016 7.23354091 1.86714850 5.67561033 6.80936937 5.30510252
## [7] 2.85125702 2.12316616 3.24879990 5.09535581 2.53745450 6.67286713
## [13] 7.15873583 5.57482329 4.01188912 6.08953012 -0.76734144 0.72180528
## [19] -0.82750204 -0.88435236 0.04033258 -0.75725979 -0.92831473 -0.71450336
## [25] -0.79496584 -0.57334690 0.80829105 -0.66267795 1.30440564 -0.90647355
## [31] -0.89930095 -0.81768801 -0.97037734 -0.04100497 -0.47795689 4.51628019
## [37] -1.07758673 0.14033717 -0.49947381 -0.25738748 0.39727811 -0.83037825
## [43] -0.45125249 -0.88535654 0.69438408 -0.48773195 1.35179057 -0.80716295
## [49] 2.97678730 -0.83422611 -0.58221536 -0.52502435 1.46194536 -0.17487644
## [55] 0.21597251 -0.96899882 -0.69112961 -0.77661175 0.73710125 1.42684721
## [61] -0.98107362 0.57674995 -0.63461213 -0.94415316 -0.92570138 -0.40125023
## [67] 0.72553349 -1.01924824 -0.20385536 0.02053866 -0.32643880 -0.95895593
## [73] 1.66620515 7.44544988 -0.08470305 -0.43576069 -0.40475111 2.02008256
## [79] -0.90984604 -0.75259328 -0.79367767 -0.93412496 0.12436146 -1.09519251
## [85] -0.50863565 4.57677300 -0.57353442 -0.73536603 -0.93510939 -0.86956275
## [91] -0.87976954 1.14877336 -0.70962401 -0.69874303 -0.37757968 -0.95232763
## [97] 0.42942146 -1.17639349 -0.28251468 -0.38491836 -0.70875647 -1.15568622
## [103] 0.18778845 -0.99599919 -0.28380920 -0.31040754 -0.26903379 -0.59974333
## [109] -0.85818732 -0.96858883 -0.20752452 -0.57660499 -1.04967592 -0.94321432
## [115] 1.73273605 -0.59068135 -0.44225250 -0.96217246 -0.16476041 5.35823397
## [121] -0.43862057 -0.63394213 -0.60342631 0.09078510 3.04173978 -1.17155377
## [127] -0.83077488 -0.60142243 -0.85579965 -0.84011538 0.49916631 -0.89126852
## [133] -0.87261723 0.03994970 -1.00992467 -0.65723257 1.08573535 4.65706924
## [139] -0.71597227 -0.77417456 1.59624521 -0.82238809 -0.96174961 -0.74192511
## [145] -1.12627995 -1.07722698 -0.76964734 -0.97676360 -0.57720170 1.03273603
## [151] -0.82190235 -0.45236818 -0.73933475 -0.80438834 -1.03530182 -0.86830412
## [157] -0.85204705 -1.01507524 -0.60453272 -0.80161950 -0.30887146 -0.76134972
## [163] -0.86575119 -0.39901671 -0.99332093 -0.85873662 -0.94699241 -0.97143637
## [169] -0.87422577 -0.92836879 -1.15113949 -0.76128069 -0.84840362 -0.80966771
## [175] -0.94953905 -0.87855638
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul25, listw = rsmc25_q)
## attr(,"class")
## [1] "localG"
merged_week25.gi <- cbind(merged, as.matrix(gi_week25.fixed))
names(merged_week25.gi)[17] <- "gstat"fips_week26 <- order(merged$CVE_ENT)
gi_week26.fixed <- localG(merged$cumul26, rsmc26_q)
gi_week26.fixed## [1] 5.485960732 7.275960350 1.880163577 5.686445476 6.723013752
## [6] 5.249886886 2.961176278 2.193986589 3.316315330 5.053506315
## [11] 2.585362030 6.714118105 7.115960114 5.545494424 4.052666406
## [16] 6.026491749 -0.762304021 0.742252376 -0.825849824 -0.891473449
## [21] 0.074086337 -0.761839017 -0.926679410 -0.712738924 -0.803925016
## [26] -0.572046797 0.825412768 -0.666879397 1.303272882 -0.906307123
## [31] -0.911103507 -0.813822506 -0.981787082 0.005193454 -0.480783593
## [36] 4.516188104 -1.075496110 0.120734327 -0.491994405 -0.249083261
## [41] 0.395990014 -0.831929737 -0.436013597 -0.886911993 0.662223202
## [46] -0.493201548 1.320326513 -0.810358348 2.954692911 -0.844055034
## [51] -0.572887622 -0.514212881 1.479222337 -0.169904649 0.190766068
## [56] -0.976166418 -0.695918398 -0.775562492 0.805692085 1.459033735
## [61] -0.987733653 0.592258119 -0.636859061 -0.942246298 -0.920169759
## [66] -0.419291038 0.763456715 -1.021330468 -0.196192095 0.057415970
## [71] -0.306973492 -0.953980014 1.689080328 7.365313462 -0.065295534
## [76] -0.437849593 -0.403322699 2.108692059 -0.921397344 -0.756600820
## [81] -0.789372346 -0.935540076 0.161236026 -1.106408321 -0.515253659
## [86] 4.480963567 -0.569802154 -0.728112321 -0.939969222 -0.868187244
## [91] -0.874301516 1.218279393 -0.706804663 -0.704819878 -0.370921720
## [96] -0.953284757 0.459793533 -1.180668222 -0.302288523 -0.369468831
## [101] -0.692232638 -1.155388883 0.217521964 -0.996193151 -0.302016293
## [106] -0.277101842 -0.257885901 -0.584614994 -0.852028804 -0.975805968
## [111] -0.215959239 -0.569185304 -1.052253999 -0.942851437 1.701178580
## [116] -0.583470422 -0.397943561 -0.952337525 -0.192151634 5.387654628
## [121] -0.441918346 -0.612108524 -0.607928109 0.098116551 3.033402269
## [126] -1.178426102 -0.835692306 -0.605318486 -0.848260950 -0.842449748
## [131] 0.506757834 -0.887574522 -0.879919557 0.081623440 -1.011419724
## [136] -0.653537097 1.095186215 4.610044996 -0.712955047 -0.774687455
## [141] 1.621632236 -0.831999528 -0.969333351 -0.746534211 -1.136603046
## [146] -1.085851444 -0.776119452 -0.991229171 -0.599020083 1.079412982
## [151] -0.823799466 -0.469626719 -0.753689427 -0.806537524 -1.046590608
## [156] -0.886882742 -0.860757685 -1.028778048 -0.623574190 -0.805261096
## [161] -0.322609061 -0.767330442 -0.872801221 -0.403529452 -1.007313943
## [166] -0.875436933 -0.954130934 -0.976094576 -0.887468021 -0.937560249
## [171] -1.159700499 -0.775818233 -0.857869454 -0.818674300 -0.965632931
## [176] -0.897772063
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul26, listw = rsmc26_q)
## attr(,"class")
## [1] "localG"
merged_week26.gi <- cbind(merged, as.matrix(gi_week26.fixed))
names(merged_week26.gi)[17] <- "gstat"fips_week27 <- order(merged$CVE_ENT)
gi_week27.fixed <- localG(merged$cumul27, rsmc20_q)
gi_week27.fixed## [1] 5.44926641 7.30500835 1.90141006 5.68618809 6.67123087 5.20867473
## [7] 3.04496856 2.22319674 3.42195613 5.01220300 2.64279050 6.78533250
## [13] 7.08340344 5.50524692 4.08249937 5.94110926 -0.75828273 0.76282488
## [19] -0.82922802 -0.89459314 0.10625090 -0.76142594 -0.91607992 -0.70904471
## [25] -0.81098517 -0.57209176 0.83802712 -0.66619365 1.28400385 -0.90641810
## [31] -0.91404191 -0.81101221 -0.98605433 0.02934034 -0.46760876 4.51104000
## [37] -1.07206289 0.09613611 -0.48585065 -0.25065311 0.40534232 -0.83361380
## [43] -0.43367052 -0.88772240 0.64178675 -0.49256101 1.30105283 -0.81001687
## [49] 2.93651976 -0.85215609 -0.56925121 -0.50262769 1.50432421 -0.19244455
## [55] 0.17037030 -0.98102214 -0.69778950 -0.77126912 0.85992129 1.48076972
## [61] -0.99224935 0.57617024 -0.64954822 -0.94130609 -0.91209971 -0.43056088
## [67] 0.78662083 -1.01632489 -0.19859578 0.09125292 -0.30689408 -0.95096816
## [73] 1.69129687 7.30025206 -0.06152969 -0.45367467 -0.39365397 2.20552044
## [79] -0.92444674 -0.75231761 -0.77703807 -0.93351456 0.18981051 -1.11241862
## [85] -0.51994906 4.43724149 -0.57120952 -0.72794602 -0.94042723 -0.86386047
## [91] -0.86273628 1.26337551 -0.69730051 -0.70681017 -0.37191331 -0.95073870
## [97] 0.48510654 -1.18006435 -0.32230755 -0.35486836 -0.68925746 -1.14945553
## [103] 0.23291047 -0.99895999 -0.32310803 -0.24771143 -0.25432339 -0.57869478
## [109] -0.84812687 -0.98184637 -0.22651478 -0.55628688 -1.05119158 -0.94377782
## [115] 1.70010186 -0.57802099 -0.36443684 -0.95081307 -0.21013916 5.38076116
## [121] -0.44443498 -0.60256762 -0.60650806 0.09950281 3.02673296 -1.18143928
## [127] -0.82917516 -0.62037138 -0.83943957 -0.83605957 0.51040378 -0.87920743
## [133] -0.88328391 0.11444846 -1.00690098 -0.65352238 1.06919341 4.57656773
## [139] -0.71002844 -0.77189937 1.63803746 -0.84272564 -0.97730884 -0.75148227
## [145] -1.14863873 -1.09257886 -0.78038121 -1.00465387 -0.62148843 1.12267005
## [151] -0.82071064 -0.48465358 -0.76852827 -0.80573686 -1.05775110 -0.90331954
## [157] -0.86777738 -1.04050917 -0.64055920 -0.80379744 -0.32859862 -0.77284282
## [163] -0.88069060 -0.39628711 -1.01758744 -0.89134760 -0.96093160 -0.98139307
## [169] -0.89879882 -0.94869706 -1.16968249 -0.78869493 -0.86435848 -0.82270714
## [175] -0.98167936 -0.91722467
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul27, listw = rsmc20_q)
## attr(,"class")
## [1] "localG"
merged_week27.gi <- cbind(merged, as.matrix(gi_week27.fixed))
names(merged_week27.gi)[17] <- "gstat"fips_week28 <- order(merged$CVE_ENT)
gi_week28.fixed <- localG(merged$cumul28, rsmc28_q)
gi_week28.fixed## [1] 5.41338917 7.34214085 1.93752601 5.66584000 6.60271192 5.17158906
## [7] 3.12135218 2.27987100 3.49067414 5.00319154 2.71318508 6.82429002
## [13] 7.06627768 5.47605333 4.12554099 5.86054520 -0.76244593 0.79245392
## [19] -0.82992043 -0.89658522 0.11703083 -0.76319236 -0.91975065 -0.70455131
## [25] -0.81260379 -0.57288156 0.86770999 -0.66976829 1.26163806 -0.90957158
## [31] -0.91782742 -0.80824851 -0.98841250 0.03905864 -0.47363631 4.50722354
## [37] -1.07514187 0.09763027 -0.48535538 -0.25114134 0.42153160 -0.83436059
## [43] -0.43493318 -0.87581628 0.63502731 -0.49212402 1.26491254 -0.81470334
## [49] 2.90598935 -0.85880261 -0.56972673 -0.49845907 1.51812706 -0.21217409
## [55] 0.16509750 -0.98237406 -0.69999867 -0.76932499 0.88746597 1.50998160
## [61] -0.99586707 0.56638011 -0.66147751 -0.94269582 -0.91369583 -0.42722125
## [67] 0.79882516 -1.01401393 -0.19962639 0.09880035 -0.30406812 -0.95146590
## [73] 1.68317017 7.25076346 -0.05623969 -0.46983781 -0.38986064 2.28999570
## [79] -0.93438796 -0.75249071 -0.76997329 -0.93584118 0.20214381 -1.11960244
## [85] -0.52082340 4.37641821 -0.56851560 -0.73040446 -0.94222892 -0.86618889
## [91] -0.85691281 1.28707432 -0.69073249 -0.71123029 -0.36763542 -0.94851363
## [97] 0.51782920 -1.18249119 -0.32408314 -0.33653387 -0.68809227 -1.14826484
## [103] 0.24039875 -1.00147104 -0.32356897 -0.23160898 -0.25726653 -0.55930242
## [109] -0.83476558 -0.98379978 -0.24249712 -0.55526515 -1.04773574 -0.94900606
## [115] 1.68990182 -0.56352631 -0.34871917 -0.95251667 -0.21343414 5.37403779
## [121] -0.44697312 -0.60603779 -0.60880673 0.09050809 3.00941609 -1.18346154
## [127] -0.83317211 -0.62950660 -0.83895946 -0.83685355 0.50939336 -0.87681146
## [133] -0.88578013 0.12911762 -1.00498576 -0.65187978 1.03528229 4.56895225
## [139] -0.70582938 -0.77144610 1.66503579 -0.85079605 -0.97842030 -0.75583397
## [145] -1.15652001 -1.09738953 -0.78582190 -1.01347160 -0.63976613 1.14108517
## [151] -0.82171724 -0.50016135 -0.77959113 -0.80856330 -1.06579367 -0.91577213
## [157] -0.87397000 -1.05012483 -0.65660394 -0.80569786 -0.33782135 -0.77612274
## [163] -0.88628867 -0.39320952 -1.02697969 -0.90498216 -0.96470151 -0.98370674
## [169] -0.90596404 -0.95680632 -1.17512023 -0.79856326 -0.87045397 -0.82828947
## [175] -0.99213968 -0.93102248
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul28, listw = rsmc28_q)
## attr(,"class")
## [1] "localG"
merged_week28.gi <- cbind(merged, as.matrix(gi_week28.fixed))
names(merged_week28.gi)[17] <- "gstat"fips_week29 <- order(merged$CVE_ENT)
gi_week29.fixed <- localG(merged$cumul29, rsmc29_q)
gi_week29.fixed## [1] 5.40433926 7.42405801 2.01882391 5.61129692 6.52081149 5.16587827
## [7] 3.23006807 2.33772102 3.63875622 4.99653443 2.87351706 6.90454300
## [13] 7.12480829 5.46233447 4.16465107 5.78456109 -0.75737041 0.79055518
## [19] -0.82725382 -0.89694586 0.10828263 -0.76413999 -0.92335401 -0.70235249
## [25] -0.81426326 -0.57346240 0.87047134 -0.66834428 1.22146998 -0.91058114
## [31] -0.92223152 -0.80216600 -0.99045816 0.02665237 -0.47361879 4.47801002
## [37] -1.08002088 0.08604840 -0.48332235 -0.26693238 0.43329109 -0.83433314
## [43] -0.44530356 -0.86663736 0.59357143 -0.49136045 1.21463265 -0.81559024
## [49] 2.86467724 -0.86220860 -0.56988061 -0.49219203 1.53530561 -0.22746604
## [55] 0.14528507 -0.98428828 -0.70085860 -0.77401307 0.91964556 1.49779487
## [61] -0.99658673 0.53983156 -0.67220436 -0.94339366 -0.91176707 -0.42394241
## [67] 0.77576610 -1.01181168 -0.21096579 0.09113471 -0.31718290 -0.94737557
## [73] 1.67695214 7.15825427 -0.06826084 -0.49137512 -0.38572600 2.40666070
## [79] -0.94105325 -0.75691350 -0.76094481 -0.93761079 0.19313444 -1.12439457
## [85] -0.52361850 4.27050602 -0.56664719 -0.73600532 -0.94757843 -0.86852691
## [91] -0.84806368 1.27137890 -0.68766942 -0.71383733 -0.36332040 -0.94627305
## [97] 0.52862544 -1.18358285 -0.33370902 -0.32823221 -0.68029313 -1.14912302
## [103] 0.22888708 -1.00406703 -0.33385492 -0.23967420 -0.26461889 -0.55033051
## [109] -0.82124791 -0.98532073 -0.26714399 -0.55002357 -1.04473797 -0.95170584
## [115] 1.63588782 -0.55013033 -0.34187709 -0.94585884 -0.23544283 5.31868844
## [121] -0.44829263 -0.61765117 -0.60889739 0.07330799 2.97726682 -1.18361833
## [127] -0.83287774 -0.64094573 -0.83882071 -0.83978472 0.49112109 -0.87728987
## [133] -0.88503062 0.12275094 -1.00431562 -0.66110887 0.99729033 4.52680740
## [139] -0.70350549 -0.77174526 1.64791317 -0.85515597 -0.97461548 -0.75792357
## [145] -1.15750499 -1.09981300 -0.78655887 -1.02114293 -0.65277007 1.16921487
## [151] -0.82238923 -0.51223205 -0.78791896 -0.80927010 -1.06992022 -0.92513207
## [157] -0.87715347 -1.05544093 -0.67004568 -0.80660580 -0.33375934 -0.77746069
## [163] -0.88917844 -0.37905262 -1.03377854 -0.91446226 -0.96465155 -0.98195446
## [169] -0.91156178 -0.96044011 -1.17742053 -0.80405154 -0.87326670 -0.83144899
## [175] -0.99965872 -0.94093519
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul29, listw = rsmc29_q)
## attr(,"class")
## [1] "localG"
merged_week29.gi <- cbind(merged, as.matrix(gi_week29.fixed))
names(merged_week29.gi)[17] <- "gstat"fips_week30 <- order(merged$CVE_ENT)
gi_week30.fixed <- localG(merged$cumul30, rsmc30_q)
gi_week30.fixed## [1] 5.38626248 7.45827692 2.07098108 5.58672489 6.47596112 5.14471957
## [7] 3.30942182 2.37126071 3.74195863 4.96792902 2.95069676 6.95184267
## [13] 7.15499962 5.49535499 4.19231525 5.76562686 -0.75270322 0.77825822
## [19] -0.82589848 -0.89383482 0.12347448 -0.76641723 -0.91867601 -0.69661380
## [25] -0.81405559 -0.57198488 0.85551207 -0.66892840 1.16414542 -0.90868270
## [31] -0.92392726 -0.80158870 -0.99102239 0.03569395 -0.46549102 4.45858531
## [37] -1.07498615 0.07055464 -0.48800618 -0.28357927 0.43979388 -0.83216133
## [43] -0.44315941 -0.86851285 0.56045707 -0.48949640 1.18167763 -0.81380022
## [49] 2.83468080 -0.86267212 -0.57377638 -0.49057712 1.55765396 -0.24186771
## [55] 0.12599730 -0.98504303 -0.69880744 -0.77236717 0.95532151 1.48301281
## [61] -0.99935146 0.50699356 -0.67880288 -0.93461495 -0.90652548 -0.42933059
## [67] 0.76783361 -1.00742905 -0.22373666 0.10365537 -0.31757809 -0.94899243
## [73] 1.67773647 7.11146122 -0.07944590 -0.50964588 -0.38203516 2.49486374
## [79] -0.94377383 -0.75090941 -0.76001756 -0.93572158 0.20885688 -1.12669408
## [85] -0.52373666 4.19488596 -0.56133259 -0.73880956 -0.95218688 -0.86319621
## [91] -0.84869605 1.29337034 -0.68012646 -0.71333560 -0.35451301 -0.93731584
## [97] 0.51622313 -1.18105031 -0.34728382 -0.32369664 -0.67674165 -1.14457320
## [103] 0.23215394 -1.00249256 -0.34662763 -0.23204562 -0.27522293 -0.54807747
## [109] -0.82289601 -0.98747666 -0.29036975 -0.54955687 -1.03795119 -0.95330362
## [115] 1.59354157 -0.54937818 -0.31953131 -0.94354006 -0.25961322 5.27473502
## [121] -0.44929540 -0.61266070 -0.60703622 0.06062009 2.94438497 -1.18308227
## [127] -0.82985602 -0.65393415 -0.83464226 -0.83763461 0.46814668 -0.87088994
## [133] -0.88036322 0.13362281 -1.00000958 -0.66689362 0.95183629 4.47472642
## [139] -0.70011884 -0.76480055 1.63104204 -0.85922591 -0.97696524 -0.76060191
## [145] -1.16103792 -1.10108006 -0.78565358 -1.02574292 -0.66483709 1.20021758
## [151] -0.82356747 -0.52119511 -0.79469367 -0.81108342 -1.07464479 -0.93179967
## [157] -0.87898688 -1.06166324 -0.68310681 -0.80737172 -0.33227365 -0.77982701
## [163] -0.89106830 -0.36990349 -1.03958967 -0.92355698 -0.96549888 -0.98489288
## [169] -0.91824274 -0.96594536 -1.18087594 -0.81087023 -0.87447748 -0.83197703
## [175] -1.00872671 -0.95274293
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul30, listw = rsmc30_q)
## attr(,"class")
## [1] "localG"
merged_week30.gi <- cbind(merged, as.matrix(gi_week30.fixed))
names(merged_week30.gi)[17] <- "gstat"fips_week31 <- order(merged$CVE_ENT)
gi_week31.fixed <- localG(merged$cumul31, rsmc31_q)
gi_week31.fixed## [1] 5.34034524 7.52719087 2.10389095 5.53923460 6.46677025 5.17759709
## [7] 3.37842484 2.41527656 3.83941494 4.96144171 3.04006102 7.01246203
## [13] 7.18155127 5.52434861 4.20574724 5.73443205 -0.75314415 0.75176168
## [19] -0.82047130 -0.89188688 0.11443823 -0.76525177 -0.92069868 -0.69355676
## [25] -0.81394180 -0.57399020 0.83045839 -0.66739535 1.12217111 -0.90610405
## [31] -0.92323291 -0.80543689 -0.99089855 0.02681384 -0.47007189 4.40765514
## [37] -1.07410840 0.06399640 -0.49551241 -0.30482683 0.44439425 -0.82691830
## [43] -0.44853203 -0.86888486 0.53369573 -0.49000643 1.16418860 -0.81347042
## [49] 2.79162571 -0.86192308 -0.58102384 -0.49342973 1.54036785 -0.25765659
## [55] 0.11374908 -0.98344202 -0.70000740 -0.77274835 0.98773125 1.44290625
## [61] -0.99473938 0.47725976 -0.68114427 -0.93604246 -0.90492483 -0.42806172
## [67] 0.74321834 -1.00515708 -0.23219500 0.09183706 -0.32579752 -0.94524285
## [73] 1.66048812 7.06892032 -0.10083074 -0.52368828 -0.38379870 2.56487487
## [79] -0.94128164 -0.74996559 -0.76272510 -0.93489488 0.19629826 -1.12541658
## [85] -0.52437969 4.14737311 -0.55490800 -0.74124458 -0.95468027 -0.86301590
## [91] -0.85251364 1.27370369 -0.67664610 -0.71371485 -0.34680162 -0.93454338
## [97] 0.49004103 -1.17834537 -0.35184199 -0.33112720 -0.67562060 -1.14405727
## [103] 0.21920906 -1.00228238 -0.35124722 -0.24101134 -0.28858802 -0.55604790
## [109] -0.82721467 -0.98552864 -0.30647365 -0.55359453 -1.03419537 -0.95314704
## [115] 1.55450072 -0.55054236 -0.31068054 -0.93935801 -0.27067490 5.21188301
## [121] -0.44900036 -0.62478433 -0.60254555 0.03919283 2.89620544 -1.18214905
## [127] -0.83149883 -0.65952255 -0.83217388 -0.83995077 0.44264085 -0.86899065
## [133] -0.87627322 0.12500655 -0.99670478 -0.67663937 0.90863863 4.45511856
## [139] -0.69751097 -0.76430399 1.59032732 -0.85836294 -0.97257015 -0.75861415
## [145] -1.15790407 -1.09712311 -0.78366833 -1.01873978 -0.66091523 1.22849608
## [151] -0.82092182 -0.51867583 -0.79747523 -0.80969695 -1.07431527 -0.92839352
## [157] -0.87760097 -1.06019251 -0.68099230 -0.80416992 -0.32254757 -0.77577614
## [163] -0.89046335 -0.36399451 -1.03833279 -0.92768678 -0.96344461 -0.98127060
## [169] -0.91626802 -0.95736320 -1.17788991 -0.81214524 -0.87334625 -0.82944961
## [175] -1.00881442 -0.95790665
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul31, listw = rsmc31_q)
## attr(,"class")
## [1] "localG"
merged_week31.gi <- cbind(merged, as.matrix(gi_week31.fixed))
names(merged_week31.gi)[17] <- "gstat"fips_week32 <- order(merged$CVE_ENT)
gi_week32.fixed <- localG(merged$cumul32, rsmc32_q)
gi_week32.fixed## [1] 5.33204879 7.54582698 2.10963644 5.52535287 6.47292948 5.19024963
## [7] 3.38739447 2.42058777 3.83758692 4.96927556 3.03966301 7.02204246
## [13] 7.19896130 5.52340885 4.20269906 5.73675782 -0.75341295 0.74795554
## [19] -0.81960294 -0.89100863 0.10571142 -0.76542048 -0.92131305 -0.69343157
## [25] -0.81312758 -0.57299487 0.82512735 -0.66748645 1.11664476 -0.90589581
## [31] -0.92210238 -0.80381460 -0.98999321 0.01792195 -0.47179419 4.39614976
## [37] -1.07410807 0.06186902 -0.49529879 -0.30615239 0.44428430 -0.82628690
## [43] -0.45073856 -0.86948486 0.53005853 -0.49088928 1.16116390 -0.81324047
## [49] 2.78506839 -0.86098642 -0.58066225 -0.49261984 1.53629832 -0.26020599
## [55] 0.11039588 -0.98259491 -0.69982887 -0.77363446 0.99193702 1.43799454
## [61] -0.99353009 0.47436313 -0.68303815 -0.93675124 -0.90544552 -0.42969774
## [67] 0.73297685 -1.00461070 -0.23321027 0.08286366 -0.32837226 -0.94543021
## [73] 1.65658823 7.06988818 -0.10202293 -0.52447277 -0.38326975 2.56656676
## [79] -0.93988723 -0.75026065 -0.76117330 -0.93444901 0.18691351 -1.12411722
## [85] -0.52498479 4.15253188 -0.55447299 -0.74161176 -0.95478964 -0.86364448
## [91] -0.85142140 1.25823768 -0.67666073 -0.71342301 -0.34657850 -0.93410044
## [97] 0.48636301 -1.17727254 -0.35309181 -0.32964623 -0.67653026 -1.14409473
## [103] 0.20939391 -1.00199792 -0.35250204 -0.24831605 -0.28978760 -0.55514445
## [109] -0.82727369 -0.98413463 -0.30884515 -0.55317619 -1.03364733 -0.95326904
## [115] 1.54934158 -0.55126529 -0.31008211 -0.93935562 -0.27199588 5.19745583
## [121] -0.44850780 -0.62886788 -0.60213033 0.03863833 2.88807034 -1.18104485
## [127] -0.83111984 -0.66109292 -0.83257731 -0.84028990 0.43916303 -0.86908966
## [133] -0.87552399 0.11622988 -0.99622829 -0.67636396 0.90343146 4.46283038
## [139] -0.69735315 -0.76448054 1.58499837 -0.85660072 -0.96831798 -0.75726280
## [145] -1.15364642 -1.09580659 -0.78067364 -1.01819859 -0.65844721 1.23179356
## [151] -0.81800992 -0.51593528 -0.79649934 -0.80687795 -1.07248186 -0.92584505
## [157] -0.87597000 -1.05893410 -0.67873197 -0.80111432 -0.32168736 -0.77463011
## [163] -0.88901631 -0.36513598 -1.03620391 -0.92610273 -0.96120060 -0.97965129
## [169] -0.91570733 -0.95372729 -1.17331553 -0.81134587 -0.87233094 -0.82705556
## [175] -1.00752250 -0.95703569
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = merged$cumul32, listw = rsmc32_q)
## attr(,"class")
## [1] "localG"
week13<- tm_shape(merged_week13.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 13 local Gi") +
tm_borders(alpha = 0.5)
week14<- tm_shape(merged_week14.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 14 local Gi") +
tm_borders(alpha = 0.5)
week15<- tm_shape(merged_week15.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 15 local Gi") +
tm_borders(alpha = 0.5)
week16<- tm_shape(merged_week16.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 16 local Gi") +
tm_borders(alpha = 0.5)
week17<- tm_shape(merged_week17.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 17 local Gi") +
tm_borders(alpha = 0.5)
week18<- tm_shape(merged_week18.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 18 local Gi") +
tm_borders(alpha = 0.5)
week19<- tm_shape(merged_week19.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 19 local Gi") +
tm_borders(alpha = 0.5)
week20<- tm_shape(merged_week20.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 20 local Gi") +
tm_borders(alpha = 0.5)
week21<- tm_shape(merged_week21.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 21 local Gi") +
tm_borders(alpha = 0.5)
week22<- tm_shape(merged_week22.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 22 local Gi") +
tm_borders(alpha = 0.5)
week23<- tm_shape(merged_week23.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 23 local Gi") +
tm_borders(alpha = 0.5)
week24<- tm_shape(merged_week24.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 24 local Gi") +
tm_borders(alpha = 0.5)
week25<- tm_shape(merged_week25.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 25 local Gi") +
tm_borders(alpha = 0.5)
week26<- tm_shape(merged_week26.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 26 local Gi") +
tm_borders(alpha = 0.5)
week27<- tm_shape(merged_week27.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 27 local Gi") +
tm_borders(alpha = 0.5)
week28<- tm_shape(merged_week28.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 28 local Gi") +
tm_borders(alpha = 0.5)
week29<- tm_shape(merged_week29.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 29 local Gi") +
tm_borders(alpha = 0.5)
week30<- tm_shape(merged_week30.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 30 local Gi") +
tm_borders(alpha = 0.5)
week31<- tm_shape(merged_week31.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "Week 31 local Gi") +
tm_borders(alpha = 0.5)
week32<- tm_shape(merged_week32.gi) +
tm_fill(col = "gstat",
style = "pretty",
palette="-RdBu",
title = "week 32 local Gi") +
tm_borders(alpha = 0.5)
tmap_arrange(week13,week14,week15,week16,week17, week18, week19,week20,week21,week22,week23,week24,week25,week26,week27, week28,week29,week30,week31,week32)The area highlighted in red, are hotspot for the number of COVID-19 Cases. The analysis in the above sections also shows similar area are cluster with high number of COVID-19 Cases. The area that are highlighted in blue are cold area with a lower number of cases value.
Fortunately, the hotspots did not spread throughout the entire Central Mexico as the weeks passed by. As seen from the color coding, the higher number of cases remained in the same area from week 13 to week 32.
As seen from all the analysis, it is proven that Mexico City has the highest number and has a cluster of COVID-19 cases from week 13 to week 32. It shows a consistent increase in the number of COVID-19 cases over the weeks.
Also the findings have been proven in various test and data wrangling method. Based on the LISA map and Getis-Ord Gi Statistics Map we can see several clusters which primarily align with our initial observations from the start in our data wrangling step.