RPubs Link: https://rpubs.com/vedant_1997/IS415_Take-home_Ex01

Objective

In view of this, we are going to conduct a use-case to demonstrate the potential contribution of geospatial analytics in R to integrate, analyse and communicate the analysis results by using open data provided by different government agencies. The specific objectives of the study are as follow:

  1. Calibrating a simple linear regression to reveal the relation between public bus commuters’ flows (i.e. tap-in or tap-out) data and residential population at the planning sub-zone level.

  2. Performing spatial autocorrelation analysis on the residual of the regression model to test if the model conforms to the randomization assumption.

  3. Performing localized geospatial statistics analysis by using commuters’ tap-in and tap-out data to identify geographical clustering.

Data Sources

  1. Passenger Volume By Bus Stop (https://www.mytransport.sg/content/mytransport/home/dataMall/dynamic-data.html#Geospatial)

  2. Bus Stop Locations (https://www.mytransport.sg/content/mytransport/home/dataMall/static-data.html#Whole%20Island)

  3. Population data (https://www.singstat.gov.sg/publications/population-trends)

  4. Subzone Boundary (https://data.gov.sg/dataset/master-plan-2014-subzone-boundary-web)

Installation of required R packages

packages = c('rgdal', 'spdep',  'tmap', 'tidyverse', 'sf', 'mgcv')
for (p in packages){
if(!require(p, character.only = T)){
install.packages(p)
}
library(p,character.only = T)
}

Reading aspatial and geospatial data

bus_stops <- st_read(dsn = "data/geospatial", layer = "BusStop")
## Reading layer `BusStop' from data source `D:\Geospatial Analytics\Take_home\Take-home_Ex01\data\geospatial' using driver `ESRI Shapefile'
## Simple feature collection with 5040 features and 3 fields
## geometry type:  POINT
## dimension:      XY
## bbox:           xmin: 4427.938 ymin: 26482.1 xmax: 48282.5 ymax: 52983.82
## proj4string:    +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +datum=WGS84 +units=m +no_defs
subzones <- st_read(dsn = "data/geospatial",
                    layer = "MP14_SUBZONE_WEB_PL")
## Reading layer `MP14_SUBZONE_WEB_PL' from data source `D:\Geospatial Analytics\Take_home\Take-home_Ex01\data\geospatial' using driver `ESRI Shapefile'
## Simple feature collection with 323 features and 15 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: 2667.538 ymin: 15748.72 xmax: 56396.44 ymax: 50256.33
## proj4string:    +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +datum=WGS84 +units=m +no_defs
passenger_volume <- read_csv("data/aspatial/passenger volume by busstop.csv")
## Parsed with column specification:
## cols(
##   YEAR_MONTH = col_character(),
##   DAY_TYPE = col_character(),
##   TIME_PER_HOUR = col_double(),
##   PT_TYPE = col_character(),
##   PT_CODE = col_character(),
##   TOTAL_TAP_IN_VOLUME = col_double(),
##   TOTAL_TAP_OUT_VOLUME = col_double()
## )
population <- read_csv("data/aspatial/respopagesextod2011to2019.csv")
## Parsed with column specification:
## cols(
##   PA = col_character(),
##   SZ = col_character(),
##   AG = col_character(),
##   Sex = col_character(),
##   TOD = col_character(),
##   Pop = col_double(),
##   Time = col_double()
## )

Data Wrangling

Check that the CRS for the 2 geospatial datas are the same

bus_stops3414 <- st_set_crs(bus_stops, 3414)
subzones3414 <- st_set_crs(subzones, 3414)
st_transform(bus_stops3414, 3414)
## Simple feature collection with 5040 features and 3 fields
## geometry type:  POINT
## dimension:      XY
## bbox:           xmin: 4427.938 ymin: 26482.1 xmax: 48282.5 ymax: 52983.82
## CRS:            EPSG:3414
## First 10 features:
##    BUS_STOP_N BUS_ROOF_N                  LOC_DESC                  geometry
## 1       78221        B06                      <NA> POINT (42227.96 39563.16)
## 2       63359        B01         HOUGANG SWIM CPLX POINT (34065.75 39047.46)
## 3       64141        B13            AFT JLN TELAWI  POINT (36335.3 38525.74)
## 4       83139        B07          AFT JOO CHIAT PL POINT (36530.26 32981.18)
## 5       55231        B02    OPP SBST EAST DISTRICT POINT (29669.93 40841.51)
## 6       55351        B03         OPP FUDU WALK P/G POINT (28404.77 41300.92)
## 7       92089        B10           CHIJ KATONG CON POINT (37378.19 32166.81)
## 8       80271        B06                 OPP BLK 2 POINT (33524.15 31938.86)
## 9       82059        B02                 ONE AMBER POINT (35142.59 31500.49)
## 10      97089        B02 OPP SELARANG PK DRUG REH. POINT (44329.52 39204.74)
st_transform(subzones3414, 3414)
## Simple feature collection with 323 features and 15 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: 2667.538 ymin: 15748.72 xmax: 56396.44 ymax: 50256.33
## CRS:            EPSG:3414
## First 10 features:
##    OBJECTID SUBZONE_NO       SUBZONE_N SUBZONE_C CA_IND      PLN_AREA_N
## 1         1          1    MARINA SOUTH    MSSZ01      Y    MARINA SOUTH
## 2         2          1    PEARL'S HILL    OTSZ01      Y          OUTRAM
## 3         3          3       BOAT QUAY    SRSZ03      Y SINGAPORE RIVER
## 4         4          8  HENDERSON HILL    BMSZ08      N     BUKIT MERAH
## 5         5          3         REDHILL    BMSZ03      N     BUKIT MERAH
## 6         6          7  ALEXANDRA HILL    BMSZ07      N     BUKIT MERAH
## 7         7          9   BUKIT HO SWEE    BMSZ09      N     BUKIT MERAH
## 8         8          2     CLARKE QUAY    SRSZ02      Y SINGAPORE RIVER
## 9         9         13 PASIR PANJANG 1    QTSZ13      N      QUEENSTOWN
## 10       10          7       QUEENSWAY    QTSZ07      N      QUEENSTOWN
##    PLN_AREA_C       REGION_N REGION_C          INC_CRC FMEL_UPD_D   X_ADDR
## 1          MS CENTRAL REGION       CR 5ED7EB253F99252E 2014-12-05 31595.84
## 2          OT CENTRAL REGION       CR 8C7149B9EB32EEFC 2014-12-05 28679.06
## 3          SR CENTRAL REGION       CR C35FEFF02B13E0E5 2014-12-05 29654.96
## 4          BM CENTRAL REGION       CR 3775D82C5DDBEFBD 2014-12-05 26782.83
## 5          BM CENTRAL REGION       CR 85D9ABEF0A40678F 2014-12-05 26201.96
## 6          BM CENTRAL REGION       CR 9D286521EF5E3B59 2014-12-05 25358.82
## 7          BM CENTRAL REGION       CR 7839A8577144EFE2 2014-12-05 27680.06
## 8          SR CENTRAL REGION       CR 48661DC0FBA09F7A 2014-12-05 29253.21
## 9          QT CENTRAL REGION       CR 1F721290C421BFAB 2014-12-05 22077.34
## 10         QT CENTRAL REGION       CR 3580D2AFFBEE914C 2014-12-05 24168.31
##      Y_ADDR SHAPE_Leng SHAPE_Area                       geometry
## 1  29220.19   5267.381  1630379.3 MULTIPOLYGON (((31495.56 30...
## 2  29782.05   3506.107   559816.2 MULTIPOLYGON (((29092.28 30...
## 3  29974.66   1740.926   160807.5 MULTIPOLYGON (((29932.33 29...
## 4  29933.77   3313.625   595428.9 MULTIPOLYGON (((27131.28 30...
## 5  30005.70   2825.594   387429.4 MULTIPOLYGON (((26451.03 30...
## 6  29991.38   4428.913  1030378.8 MULTIPOLYGON (((25899.7 297...
## 7  30230.86   3275.312   551732.0 MULTIPOLYGON (((27746.95 30...
## 8  30222.86   2208.619   290184.7 MULTIPOLYGON (((29351.26 29...
## 9  29893.78   6571.323  1084792.3 MULTIPOLYGON (((20996.49 30...
## 10 30104.18   3454.239   631644.3 MULTIPOLYGON (((24472.11 29...
population_2019 <- population %>%
  filter(Time == 2019) %>%
  mutate(SUBZONE_N = toupper(SZ)) %>%
  group_by(SUBZONE_N) %>%
  summarize(SUBZONE_POPULATION = sum(Pop))

Join the population_2019 and subzones

subzone_population <- left_join(subzones3414, population_2019, by = "SUBZONE_N")
passenger_volume_cleaned <- passenger_volume %>%
  select(`PT_CODE`, `TOTAL_TAP_IN_VOLUME`, `TOTAL_TAP_OUT_VOLUME`) %>%
  group_by(PT_CODE) %>%
  summarize(TAP_IN = sum(TOTAL_TAP_IN_VOLUME),
            TAP_OUT = sum(TOTAL_TAP_OUT_VOLUME))  
bus_stops_cleaned <- bus_stops3414 %>%
  select(BUS_STOP_N)

Join bus stop location and passenger volume

bus_stop_passengers <- left_join(bus_stops_cleaned, passenger_volume_cleaned, by = c("BUS_STOP_N" = "PT_CODE"))
subzone_geom <- subzone_population %>%
  select(OBJECTID, SUBZONE_N, SUBZONE_POPULATION)
coords <- st_coordinates(bus_stops_cleaned)
x <- coords[,1]
y <- coords[,2]
object <-  bus_stops_cleaned$BUS_STOP_N

points <- data.frame(object, x, y)
coords1 <- st_coordinates(subzone_geom)
x <- coords1[,1]
y <- coords1[,2]
pol <- coords1[,5]

poly <- data.frame(pol, x, y)
x <- split(poly$x, poly$pol)
y <- split(poly$y, poly$pol)

todo <- 1:nrow(points)
Area <- rep.int("", nrow(points))
pol <- names(x)


for (i in 1:length(x)) {
  
  bnd <- cbind(x[[i]], y[[i]])
  
  xy <- with(points, cbind(x[todo], y[todo]))
  
  inbnd <- in.out(bnd, xy)
  
  Area[todo[inbnd]] <- pol[i]
  
  todo <- todo[!inbnd]
  }

points$Area <- Area
points_cleaned <- points %>%
  select(object, Area) %>%
  rename("BUS_STOP_N" = object,
         "OBJECTID" = Area)

bus_stop_passengers_cleaned <- st_set_geometry(bus_stop_passengers, NULL)

bus <- left_join(bus_stop_passengers_cleaned, points_cleaned, by = "BUS_STOP_N")
bus_new <- bus %>%
  mutate(OBJECTID = as.numeric(OBJECTID),
         BUS_STOP_N = as.numeric(BUS_STOP_N))
overall <- left_join(subzone_population, bus_new, by = "OBJECTID")

overall <- overall %>% drop_na()
new_overall <- overall %>%
  select(SUBZONE_N, SUBZONE_POPULATION, TAP_IN, TAP_OUT) %>%
  group_by(SUBZONE_N, SUBZONE_POPULATION) %>%
  summarise(TAP_IN = sum(TAP_IN),
            TAP_OUT = sum(TAP_OUT))
new_overall <- st_make_valid(new_overall)
tmap_mode("plot")
## tmap mode set to plotting

Distribution of population, tap in, tap out

tm_shape(new_overall) +
  tm_fill(col = "SUBZONE_POPULATION",
          n = 5,
          style = "equal",
          title = "POPULATION") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tm_shape(new_overall) +
  tm_fill(col = "TAP_OUT",
          n = 5,
          style = "equal") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tm_shape(new_overall) +
  tm_fill(col = "TAP_OUT",
          n = 5,
          style = "equal") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

#Linear Regression for Tap In vs Population

Tap In(x) vs Population(y)

The Linear Regression is significant as p-value < 0.05

stat <- lm(TAP_IN ~ SUBZONE_POPULATION, new_overall)

plot(stat)

summary(stat)
## 
## Call:
## lm(formula = TAP_IN ~ SUBZONE_POPULATION, data = new_overall)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -865527 -124146  -64237   39142 1949703 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        1.254e+05  2.110e+04   5.944 7.64e-09 ***
## SUBZONE_POPULATION 1.926e+01  9.383e-01  20.524  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 298200 on 303 degrees of freedom
## Multiple R-squared:  0.5816, Adjusted R-squared:  0.5802 
## F-statistic: 421.2 on 1 and 303 DF,  p-value: < 2.2e-16

Plotting a fitted line

ggplot(new_overall, aes(TAP_IN, SUBZONE_POPULATION))+
  geom_point()+
  geom_smooth(method = "lm", se = FALSE)
## `geom_smooth()` using formula 'y ~ x'

##Global Moran’s I prep

Adaptive distance weight matrix (fixed neighbours)

coords <- st_centroid(new_overall$geometry)

wm_knn8 <- knn2nb(knearneigh(coords, k = 8))

Plotting the neighbours of the subzones

plot(new_overall$geometry, border = "lightgrey")
plot(wm_knn8, st_centroid(new_overall$geometry), add = TRUE, col = "red")

Row-standardised weights matrix

rswm_knn8 <- nb2listw(wm_knn8, style="B", zero.policy = TRUE)
rswm_knn8
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 305 
## Number of nonzero links: 2440 
## Percentage nonzero weights: 2.622951 
## Average number of links: 8 
## Non-symmetric neighbours list
## 
## Weights style: B 
## Weights constants summary:
##     n    nn   S0   S1    S2
## B 305 93025 2440 4412 79922

Spatially lagged values of Tap In Residuals

new_overall$TAP_IN_Residuals <- stat$residuals

TAP_IN_Residuals.lag <- lag.listw(rswm_knn8, new_overall$TAP_IN_Residuals)

new_overall$TAP_IN_Residuals_lag <- TAP_IN_Residuals.lag

Plotting Tap In Residual values alongside Tap In Residual Lag values

The mappings below show how the Tap In Residuals and the Tap In Residuals Lag are distributed. The Tap in Residual Lags have a larger range of values.

tap_in_residual <- tm_shape(new_overall) +
          tm_fill(col = "TAP_IN_Residuals",
                  n = 6 ,
                  style = "equal",
                  palette = "-RdBu") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tap_in_residual_lag <- tm_shape(new_overall) +
          tm_fill(col = "TAP_IN_Residuals_lag",
                  n = 6 ,
                  style = "equal",
                  palette = "-RdBu") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(tap_in_residual, tap_in_residual_lag, asp = 1, ncol = 2)

Compute Global Moran’s I for Residual

moran.test(new_overall$TAP_IN_Residuals, listw = rswm_knn8, zero.policy = TRUE, na.action = na.omit)
## 
##  Moran I test under randomisation
## 
## data:  new_overall$TAP_IN_Residuals  
## weights: rswm_knn8    
## 
## Moran I statistic standard deviate = -0.63611, p-value = 0.7376
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##     -0.0200608661     -0.0032894737      0.0006951389

Computing Monte Carlo for Global Moran’s I

Since the p-value > 0.05. We do not reject the null hypothesis. This affirms that the linear regression model conforms to the randomisation assumption.

set.seed(1234)
bperm <- moran.mc(new_overall$TAP_IN_Residuals, listw=rswm_knn8, nsim=999, zero.policy = TRUE, na.action=na.omit)

bperm
## 
##  Monte-Carlo simulation of Moran I
## 
## data:  new_overall$TAP_IN_Residuals 
## weights: rswm_knn8  
## number of simulations + 1: 1000 
## 
## statistic = -0.020061, observed rank = 277, p-value = 0.723
## alternative hypothesis: greater

Visualising Monte Carlo for Global Moran’s I of Residual

mean(bperm$res[1:999])
## [1] -0.003718384
var(bperm$res[1:999])
## [1] 0.0006685426
summary(bperm$res[1:999])
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -0.078989 -0.021945 -0.005632 -0.003718  0.012736  0.082032
hist(bperm$res, freq = TRUE, breaks = 20, xlab = "Simulated Moran's I")
abline(v = 0, col = "red") 

Visualising spatially lagged residual values using Moran Scatterplot

MS <- moran.plot(new_overall$TAP_IN_Residuals, rswm_knn8, zero.policy = TRUE, spChk = FALSE, labels = as.character(new_overall$SUBZONE_N), xlab="Residuals", ylab="Spatially Lag Residuals")

Compute Global Moran’s I correlogram and plot for residual

MI_corr <- sp.correlogram(wm_knn8, new_overall$TAP_IN_Residuals, order = 6, method = "I", style = "B")
plot(MI_corr)

Compute Global Moran’s I for Tap In

moran.test(new_overall$TAP_IN, listw = rswm_knn8, zero.policy = TRUE, na.action = na.omit)
## 
##  Moran I test under randomisation
## 
## data:  new_overall$TAP_IN  
## weights: rswm_knn8    
## 
## Moran I statistic standard deviate = 5.8318, p-value = 2.742e-09
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.1494330699     -0.0032894737      0.0006858098

Computing Monte Carlo for Global Moran’s I

Since p-value < 0.05, we reject the null hypothesis. Since I > 0, there is a sign of clustering taking place. To investigate the subzones involved. We need to conduct a localised analysis.

set.seed(1234)
bperm <- moran.mc(new_overall$TAP_IN, listw=rswm_knn8, nsim=999, zero.policy = TRUE, na.action=na.omit)

bperm
## 
##  Monte-Carlo simulation of Moran I
## 
## data:  new_overall$TAP_IN 
## weights: rswm_knn8  
## number of simulations + 1: 1000 
## 
## statistic = 0.14943, observed rank = 1000, p-value = 0.001
## alternative hypothesis: greater

Visualising Monte Carlo for Global Moran’s I of Tap In

mean(bperm$res[1:999])
## [1] -0.004297922
var(bperm$res[1:999])
## [1] 0.0006157783
summary(bperm$res[1:999])
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -0.080555 -0.021328 -0.006372 -0.004298  0.010760  0.081246
hist(bperm$res, freq = TRUE, breaks = 20, xlab = "Simulated Moran's I")
abline(v = 0, col = "red") 

Visualising spatially lagged Tap In values using Moran Scatterplot

MS <- moran.plot(new_overall$TAP_IN, rswm_knn8, zero.policy = TRUE, spChk=FALSE, labels=as.character(new_overall$SUBZONE_N), xlab="TAP_IN", ylab="Spatially Lag TAP_IN")

Compute Global Moran’s I correlogram and plot for Tap In

MI_corr <- sp.correlogram(wm_knn8, new_overall$TAP_IN, order = 6, method = "I", style = "B")
plot(MI_corr)

Cluster and Outlier Analysis

Computing Local Moran’s I for Tap In

fips <- order(new_overall$SUBZONE_N)

localMI <- localmoran(new_overall$TAP_IN, rswm_knn8)

head(localMI)
##           Ii        E.Ii   Var.Ii       Z.Ii Pr(z > 0)
## 1  0.6454265 -0.02631579 7.422407  0.2465644 0.4026227
## 2 -1.3061542 -0.02631579 7.422407 -0.4697673 0.6807394
## 3 -0.6297459 -0.02631579 7.422407 -0.2214903 0.5876446
## 4  0.3484603 -0.02631579 7.422407  0.1375623 0.4452932
## 5  2.4327928 -0.02631579 7.422407  0.9026208 0.1833636
## 6 -1.0097970 -0.02631579 7.422407 -0.3609888 0.6409461

Values ordered by Subzone Names

printCoefmat(data.frame(localMI[fips,], row.names = new_overall$SUBZONE_N[fips]), check.names = FALSE)
##                                        Ii        E.Ii      Var.Ii        Z.Ii
## ADMIRALTY                      0.64542650 -0.02631579  7.42240664  0.24656437
## AIRPORT ROAD                  -1.30615425 -0.02631579  7.42240664 -0.46976730
## ALEXANDRA HILL                -0.62974591 -0.02631579  7.42240664 -0.22149025
## ALEXANDRA NORTH                0.34846033 -0.02631579  7.42240664  0.13756233
## ALJUNIED                       2.43279282 -0.02631579  7.42240664  0.90262080
## ANAK BUKIT                    -1.00979699 -0.02631579  7.42240664 -0.36098877
## ANCHORVALE                     1.01849525 -0.02631579  7.42240664  0.38350001
## ANG MO KIO TOWN CENTRE         2.62514354 -0.02631579  7.42240664  0.97322352
## ANSON                          2.26264961 -0.02631579  7.42240664  0.84016939
## BALESTIER                      2.54934188 -0.02631579  7.42240664  0.94540037
## BANGKIT                        0.02758578 -0.02631579  7.42240664  0.01978468
## BAYFRONT SUBZONE               3.08832471 -0.02631579  7.42240664  1.14323511
## BAYSHORE                      -5.00031891 -0.02631579  7.42240664 -1.82571793
## BEDOK NORTH                   33.95327536 -0.02631579  7.42240664 12.47227785
## BEDOK RESERVOIR                4.73526361 -0.02631579  7.42240664  1.74774737
## BEDOK SOUTH                   10.89873586 -0.02631579  7.42240664  4.01006237
## BENCOOLEN                      1.85471009 -0.02631579  7.42240664  0.69043437
## BENDEMEER                      0.34642560 -0.02631579  7.42240664  0.13681548
## BENOI SECTOR                   3.68002510 -0.02631579  7.42240664  1.36041994
## BIDADARI                       0.17068271 -0.02631579  7.42240664  0.07230870
## BISHAN EAST                   -0.68467338 -0.02631579  7.42240664 -0.24165149
## BOAT QUAY                      3.23251692 -0.02631579  7.42240664  1.19616116
## BOON KENG                     -0.14025460 -0.02631579  7.42240664 -0.04182147
## BOON LAY PLACE                 4.23769159 -0.02631579  7.42240664  1.56511256
## BOON TECK                     -0.74973916 -0.02631579  7.42240664 -0.26553402
## BOULEVARD                     -3.26408894 -0.02631579  7.42240664 -1.18843120
## BRADDELL                      -0.73576232 -0.02631579  7.42240664 -0.26040379
## BRAS BASAH                     0.42954826 -0.02631579  7.42240664  0.16732582
## BRICKWORKS                    -0.09616525 -0.02631579  7.42240664 -0.02563839
## BUGIS                         -0.33129287 -0.02631579  7.42240664 -0.11194245
## BUKIT BATOK CENTRAL           -0.71410851 -0.02631579  7.42240664 -0.25245571
## BUKIT BATOK EAST              -0.07043923 -0.02631579  7.42240664 -0.01619560
## BUKIT BATOK SOUTH             -0.07794685 -0.02631579  7.42240664 -0.01895129
## BUKIT BATOK WEST              -0.80457111 -0.02631579  7.42240664 -0.28566019
## BUKIT HO SWEE                  0.83551920 -0.02631579  7.42240664  0.31633828
## BUKIT MERAH                    0.08770551 -0.02631579  7.42240664  0.04185175
## CECIL                          2.33770384 -0.02631579  7.42240664  0.86771820
## CENTRAL SUBZONE                2.87991559 -0.02631579  7.42240664  1.06673812
## CENTRAL WATER CATCHMENT        0.52166848 -0.02631579  7.42240664  0.20113874
## CHANGI AIRPORT                -0.72616047 -0.02631579  7.42240664 -0.25687941
## CHANGI POINT                  -0.23273711 -0.02631579  7.42240664 -0.07576736
## CHANGI WEST                   -2.42527179 -0.02631579  7.42240664 -0.88054166
## CHATSWORTH                     1.21485429 -0.02631579  7.42240664  0.45557399
## CHENG SAN                      2.71785819 -0.02631579  7.42240664  1.00725462
## CHIN BEE                      -4.17363344 -0.02631579  7.42240664 -1.52228136
## CHINA SQUARE                   2.10291104 -0.02631579  7.42240664  0.78153703
## CHINATOWN                     -1.05233562 -0.02631579  7.42240664 -0.37660266
## CHOA CHU KANG CENTRAL          0.10775462 -0.02631579  7.42240664  0.04921082
## CHOA CHU KANG NORTH           -0.10611988 -0.02631579  7.42240664 -0.02929225
## CHONG BOON                     2.72803271 -0.02631579  7.42240664  1.01098920
## CITY HALL                      0.18042850 -0.02631579  7.42240664  0.07588591
## CITY TERMINALS                 2.22061576 -0.02631579  7.42240664  0.82474078
## CLARKE QUAY                    1.14196648 -0.02631579  7.42240664  0.42882038
## CLEMENTI CENTRAL              -4.73476455 -0.02631579  7.42240664 -1.72824567
## CLEMENTI NORTH                -0.63999324 -0.02631579  7.42240664 -0.22525155
## CLEMENTI WEST                 -0.10472038 -0.02631579  7.42240664 -0.02877856
## CLEMENTI WOODS                 0.02230401 -0.02631579  7.42240664  0.01784599
## CLIFFORD PIER                  2.70402521 -0.02631579  7.42240664  1.00217720
## COMMONWEALTH                   0.73382625 -0.02631579  7.42240664  0.27901168
## COMPASSVALE                   -1.02579931 -0.02631579  7.42240664 -0.36686245
## CORONATION ROAD                1.01424374 -0.02631579  7.42240664  0.38193949
## CRAWFORD                       0.47203280 -0.02631579  7.42240664  0.18291986
## DAIRY FARM                    -0.10878883 -0.02631579  7.42240664 -0.03027189
## DEFU INDUSTRIAL PARK          -0.46140878 -0.02631579  7.42240664 -0.15970176
## DEPOT ROAD                     0.04147064 -0.02631579  7.42240664  0.02488115
## DHOBY GHAUT                    0.40654590 -0.02631579  7.42240664  0.15888276
## DOVER                          0.52215351 -0.02631579  7.42240664  0.20131677
## DUNEARN                        1.93402852 -0.02631579  7.42240664  0.71954835
## EAST COAST                    -2.92726581 -0.02631579  7.42240664 -1.06479959
## EVERTON PARK                   1.31795579 -0.02631579  7.42240664  0.49341761
## FABER                          0.12952292 -0.02631579  7.42240664  0.05720091
## FAJAR                         -0.11132407 -0.02631579  7.42240664 -0.03120246
## FARRER COURT                   2.12672237 -0.02631579  7.42240664  0.79027702
## FARRER PARK                   -0.80808363 -0.02631579  7.42240664 -0.28694947
## FERNVALE                      -0.20037271 -0.02631579  7.42240664 -0.06388795
## FLORA DRIVE                   -3.79249177 -0.02631579  7.42240664 -1.38238253
## FORT CANNING                   2.42430946 -0.02631579  7.42240664  0.89950697
## FRANKEL                       12.32780820 -0.02631579  7.42240664  4.53460627
## GALI BATU                      0.43295159 -0.02631579  7.42240664  0.16857502
## GEYLANG BAHRU                 -0.17900092 -0.02631579  7.42240664 -0.05604339
## GEYLANG EAST                  10.10739340 -0.02631579  7.42240664  3.71959851
## GHIM MOH                       1.19905660 -0.02631579  7.42240664  0.44977542
## GOMBAK                        -0.16601876 -0.02631579  7.42240664 -0.05127826
## GOODWOOD PARK                  1.80860022 -0.02631579  7.42240664  0.67350964
## GREENWOOD PARK                -6.08585685 -0.02631579  7.42240664 -2.22416684
## GUILIN                        -0.09810368 -0.02631579  7.42240664 -0.02634989
## GUL BASIN                      3.93394293 -0.02631579  7.42240664  1.45362100
## GUL CIRCLE                     3.12195415 -0.02631579  7.42240664  1.15557887
## HENDERSON HILL                -0.01963817 -0.02631579  7.42240664  0.00245103
## HILLCREST                      2.02895256 -0.02631579  7.42240664  0.75439042
## HILLVIEW                       0.07900158 -0.02631579  7.42240664  0.03865695
## HOLLAND DRIVE                  1.02563223 -0.02631579  7.42240664  0.38611966
## HOLLAND ROAD                  -0.41933122 -0.02631579  7.42240664 -0.14425711
## HONG KAH                       0.47591550 -0.02631579  7.42240664  0.18434501
## HONG KAH NORTH                 0.00447039 -0.02631579  7.42240664  0.01130013
## HOUGANG CENTRAL                3.58483099 -0.02631579  7.42240664  1.32547875
## HOUGANG EAST                   0.17393108 -0.02631579  7.42240664  0.07350102
## HOUGANG WEST                   4.85732565 -0.02631579  7.42240664  1.79255050
## INSTITUTION HILL               2.37396824 -0.02631579  7.42240664  0.88102912
## INTERNATIONAL BUSINESS PARK   -0.21006410 -0.02631579  7.42240664 -0.06744519
## ISTANA NEGARA                  2.03661222 -0.02631579  7.42240664  0.75720191
## JELEBU                        -1.90321636 -0.02631579  7.42240664 -0.68892016
## JOO KOON                       0.22869557 -0.02631579  7.42240664  0.09360244
## JOO SENG                       0.35955949 -0.02631579  7.42240664  0.14163630
## JURONG GATEWAY                -0.61764204 -0.02631579  7.42240664 -0.21704750
## JURONG PORT                    1.95242425 -0.02631579  7.42240664  0.72630054
## JURONG RIVER                   0.06519628 -0.02631579  7.42240664  0.03358969
## JURONG WEST CENTRAL            2.39012490 -0.02631579  7.42240664  0.88695946
## KAKI BUKIT                     4.47095277 -0.02631579  7.42240664  1.65073155
## KALLANG BAHRU                  0.24008400 -0.02631579  7.42240664  0.09778258
## KALLANG WAY                   -0.93643635 -0.02631579  7.42240664 -0.33406160
## KAMPONG BUGIS                  1.02884976 -0.02631579  7.42240664  0.38730065
## KAMPONG GLAM                   1.29971654 -0.02631579  7.42240664  0.48672286
## KAMPONG JAVA                   0.98475023 -0.02631579  7.42240664  0.37111383
## KAMPONG TIONG BAHRU            0.32289122 -0.02631579  7.42240664  0.12817714
## KAMPONG UBI                    4.58983393 -0.02631579  7.42240664  1.69436712
## KANGKAR                        0.19215342 -0.02631579  7.42240664  0.08018957
## KATONG                        -1.59302997 -0.02631579  7.42240664 -0.57506562
## KEAT HONG                     -0.02750395 -0.02631579  7.42240664 -0.00043612
## KEBUN BAHRU                    0.20501112 -0.02631579  7.42240664  0.08490901
## KEMBANGAN                      9.48969188 -0.02631579  7.42240664  3.49286992
## KENT RIDGE                     1.31920836 -0.02631579  7.42240664  0.49387737
## KHATIB                         0.15371512 -0.02631579  7.42240664  0.06608071
## KIAN TECK                     -1.89252066 -0.02631579  7.42240664 -0.68499428
## KIM KEAT                      -0.09679243 -0.02631579  7.42240664 -0.02586860
## KOVAN                          1.37818415 -0.02631579  7.42240664  0.51552455
## KRANJI                        -1.82362535 -0.02631579  7.42240664 -0.65970612
## LAKESIDE                      -0.97123199 -0.02631579  7.42240664 -0.34683341
## LAVENDER                      -1.55031756 -0.02631579  7.42240664 -0.55938794
## LEEDON PARK                    1.65654152 -0.02631579  7.42240664  0.61769619
## LEONIE HILL                    1.67070447 -0.02631579  7.42240664  0.62289473
## LIM CHU KANG                   0.44478169 -0.02631579  7.42240664  0.17291728
## LITTLE INDIA                   1.54096408 -0.02631579  7.42240664  0.57527326
## LIU FANG                       2.28101225 -0.02631579  7.42240664  0.84690944
## LORONG 8 TOA PAYOH             0.15263617 -0.02631579  7.42240664  0.06568468
## LORONG AH SOO                  3.96861436 -0.02631579  7.42240664  1.46634721
## LORONG CHUAN                  -1.38542409 -0.02631579  7.42240664 -0.49886346
## LORONG HALUS                  -1.15723960 -0.02631579  7.42240664 -0.41510788
## LOWER SELETAR                 -0.99625461 -0.02631579  7.42240664 -0.35601801
## LOYANG EAST                   -5.05340809 -0.02631579  7.42240664 -1.84520443
## LOYANG WEST                   -4.81172521 -0.02631579  7.42240664 -1.75649423
## MACKENZIE                      1.84249682 -0.02631579  7.42240664  0.68595146
## MACPHERSON                     2.02667595 -0.02631579  7.42240664  0.75355478
## MALCOLM                        0.25496845 -0.02631579  7.42240664  0.10324595
## MANDAI EAST                   -2.39866050 -0.02631579  7.42240664 -0.87077394
## MANDAI ESTATE                 -4.47900679 -0.02631579  7.42240664 -1.63436926
## MANDAI WEST                   -5.68129301 -0.02631579  7.42240664 -2.07567086
## MARGARET DRIVE                 0.50298522 -0.02631579  7.42240664  0.19428101
## MARINA CENTRE                  0.77023939 -0.02631579  7.42240664  0.29237719
## MARINA EAST (MP)               0.30973149 -0.02631579  7.42240664  0.12334684
## MARINA SOUTH                   3.51995394 -0.02631579  7.42240664  1.30166550
## MARINE PARADE                  1.73337665 -0.02631579  7.42240664  0.64589868
## MARITIME SQUARE               -1.28953980 -0.02631579  7.42240664 -0.46366893
## MARYMOUNT                      1.57879010 -0.02631579  7.42240664  0.58915737
## MATILDA                        2.84008946 -0.02631579  7.42240664  1.05211986
## MAXWELL                        3.17713807 -0.02631579  7.42240664  1.17583424
## MEI CHIN                       0.56092017 -0.02631579  7.42240664  0.21554615
## MIDVIEW                        2.30788166 -0.02631579  7.42240664  0.85677191
## MONK'S HILL                    0.95075296 -0.02631579  7.42240664  0.35863507
## MOULMEIN                      -0.42492822 -0.02631579  7.42240664 -0.14631150
## MOUNT PLEASANT                -0.03629903 -0.02631579  7.42240664 -0.00366437
## MOUNTBATTEN                   -1.47801359 -0.02631579  7.42240664 -0.53284862
## NASSIM                         0.94692740 -0.02631579  7.42240664  0.35723089
## NATIONAL UNIVERSITY OF S'PORE  0.53504822 -0.02631579  7.42240664  0.20604980
## NATURE RESERVE                 0.38090231 -0.02631579  7.42240664  0.14947023
## NEE SOON                      -2.15610940 -0.02631579  7.42240664 -0.78174507
## NEWTON CIRCUS                  0.69833059 -0.02631579  7.42240664  0.26598292
## NORTH COAST                   12.60146829 -0.02631579  7.42240664  4.63505376
## NORTHLAND                      1.49357034 -0.02631579  7.42240664  0.55787729
## NORTHSHORE                    -3.45564037 -0.02631579  7.42240664 -1.25874054
## ONE NORTH                      0.43752656 -0.02631579  7.42240664  0.17025427
## ONE TREE HILL                  1.78049767 -0.02631579  7.42240664  0.66319455
## ORANGE GROVE                   2.59211068 -0.02631579  7.42240664  0.96109874
## OXLEY                          2.17797054 -0.02631579  7.42240664  0.80908777
## PANDAN                        -0.52825620 -0.02631579  7.42240664 -0.18423825
## PANG SUA                      -0.04545560 -0.02631579  7.42240664 -0.00702531
## PASIR PANJANG 1                0.38452027 -0.02631579  7.42240664  0.15079821
## PASIR PANJANG 2                0.96019455 -0.02631579  7.42240664  0.36210062
## PASIR RIS CENTRAL              8.69607331 -0.02631579  7.42240664  3.20157061
## PASIR RIS DRIVE                7.09719027 -0.02631579  7.42240664  2.61469735
## PASIR RIS PARK                -4.36456334 -0.02631579  7.42240664 -1.59236256
## PASIR RIS WAFER FAB PARK      -1.04132953 -0.02631579  7.42240664 -0.37256285
## PASIR RIS WEST                 3.24799493 -0.02631579  7.42240664  1.20184239
## PATERSON                       1.14515699 -0.02631579  7.42240664  0.42999146
## PAYA LEBAR EAST               -0.58464150 -0.02631579  7.42240664 -0.20493458
## PAYA LEBAR NORTH               1.39862416 -0.02631579  7.42240664  0.52302710
## PAYA LEBAR WEST                0.34759380 -0.02631579  7.42240664  0.13724427
## PEARL'S HILL                   0.63006407 -0.02631579  7.42240664  0.24092556
## PEI CHUN                       0.10582153 -0.02631579  7.42240664  0.04850127
## PENG SIANG                     0.24055766 -0.02631579  7.42240664  0.09795644
## PENJURU CRESCENT               0.95612216 -0.02631579  7.42240664  0.36060584
## PEOPLE'S PARK                  0.86311543 -0.02631579  7.42240664  0.32646753
## PHILLIP                        3.24673971 -0.02631579  7.42240664  1.20138166
## PIONEER SECTOR                 3.47621553 -0.02631579  7.42240664  1.28561123
## PLAB                           2.14096509 -0.02631579  7.42240664  0.79550484
## PORT                           1.38402726 -0.02631579  7.42240664  0.51766928
## POTONG PASIR                   0.63253559 -0.02631579  7.42240664  0.24183274
## PUNGGOL FIELD                  1.05405834 -0.02631579  7.42240664  0.39655352
## PUNGGOL TOWN CENTRE           -2.08234872 -0.02631579  7.42240664 -0.75467106
## QUEENSWAY                      1.26963610 -0.02631579  7.42240664  0.47568177
## RAFFLES PLACE                  3.76212872 -0.02631579  7.42240664  1.39055624
## REDHILL                        0.08679050 -0.02631579  7.42240664  0.04151589
## RESERVOIR VIEW                 0.95482610 -0.02631579  7.42240664  0.36013012
## RIDOUT                         2.19114506 -0.02631579  7.42240664  0.81392350
## RIVERVALE                      3.74215658 -0.02631579  7.42240664  1.38322543
## ROBERTSON QUAY                 1.81104922 -0.02631579  7.42240664  0.67440855
## ROCHOR CANAL                   1.32719929 -0.02631579  7.42240664  0.49681046
## SAFTI                         -2.40451420 -0.02631579  7.42240664 -0.87292255
## SAMULUN                        3.95094860 -0.02631579  7.42240664  1.45986296
## SAUJANA                       -0.81899364 -0.02631579  7.42240664 -0.29095401
## SELEGIE                        1.74332949 -0.02631579  7.42240664  0.64955189
## SELETAR                       -0.96120484 -0.02631579  7.42240664 -0.34315292
## SELETAR AEROSPACE PARK         1.06814556 -0.02631579  7.42240664  0.40172426
## SELETAR HILLS                 -0.57196800 -0.02631579  7.42240664 -0.20028275
## SEMBAWANG CENTRAL             -0.61197497 -0.02631579  7.42240664 -0.21496739
## SEMBAWANG EAST                -0.51168710 -0.02631579  7.42240664 -0.17815652
## SEMBAWANG HILLS               -1.51294269 -0.02631579  7.42240664 -0.54566942
## SEMBAWANG NORTH                0.16668467 -0.02631579  7.42240664  0.07084121
## SEMBAWANG SPRINGS             -0.54716218 -0.02631579  7.42240664 -0.19117772
## SEMBAWANG STRAITS             -1.14269131 -0.02631579  7.42240664 -0.40976790
## SENGKANG TOWN CENTRE           9.43970596 -0.02631579  7.42240664  3.47452248
## SENGKANG WEST                  2.32475411 -0.02631579  7.42240664  0.86296498
## SENJA                         -0.43006884 -0.02631579  7.42240664 -0.14819838
## SENNETT                        0.37376705 -0.02631579  7.42240664  0.14685122
## SENOKO NORTH                  -0.37676801 -0.02631579  7.42240664 -0.12863420
## SENOKO SOUTH                  -0.62677189 -0.02631579  7.42240664 -0.22039863
## SENOKO WEST                   -3.36017826 -0.02631579  7.42240664 -1.22370098
## SENTOSA                        1.64243088 -0.02631579  7.42240664  0.61251685
## SERANGOON CENTRAL             -0.72539375 -0.02631579  7.42240664 -0.25659798
## SERANGOON GARDEN               1.98809743 -0.02631579  7.42240664  0.73939446
## SERANGOON NORTH                0.43377677 -0.02631579  7.42240664  0.16887791
## SERANGOON NORTH IND ESTATE    -2.33953795 -0.02631579  7.42240664 -0.84907289
## SHANGRI-LA                    -0.66502124 -0.02631579  7.42240664 -0.23443813
## SHIPYARD                       3.65186967 -0.02631579  7.42240664  1.35008543
## SIGLAP                        -4.28767353 -0.02631579  7.42240664 -1.56414000
## SIMEI                         15.33816121 -0.02631579  7.42240664  5.63956244
## SINGAPORE GENERAL HOSPITAL     0.32428683 -0.02631579  7.42240664  0.12868940
## SINGAPORE POLYTECHNIC         -0.23070466 -0.02631579  7.42240664 -0.07502135
## SOMERSET                      -1.03651644 -0.02631579  7.42240664 -0.37079620
## SPRINGLEAF                     1.51932375 -0.02631579  7.42240664  0.56733013
## STRAITS VIEW                   4.41624639 -0.02631579  7.42240664  1.63065146
## SUNGEI ROAD                    0.90786184 -0.02631579  7.42240664  0.34289179
## SUNSET WAY                    -1.18632993 -0.02631579  7.42240664 -0.42578554
## SWISS CLUB                     1.05164925 -0.02631579  7.42240664  0.39566925
## TAGORE                         0.09879419 -0.02631579  7.42240664  0.04592187
## TAI SENG                       0.00547515 -0.02631579  7.42240664  0.01166893
## TAMAN JURONG                   0.87874340 -0.02631579  7.42240664  0.33220381
## TAMPINES EAST                 29.12259347 -0.02631579  7.42240664 10.69916627
## TAMPINES NORTH                -3.96454420 -0.02631579  7.42240664 -1.44553473
## TAMPINES WEST                 32.95499708 -0.02631579  7.42240664 12.10585778
## TANGLIN                        2.46292538 -0.02631579  7.42240664  0.91368102
## TANGLIN HALT                   0.65785155 -0.02631579  7.42240664  0.25112501
## TANJONG PAGAR                  2.84161108 -0.02631579  7.42240664  1.05267838
## TANJONG RHU                    0.11236777 -0.02631579  7.42240664  0.05090408
## TEBAN GARDENS                 -0.01164304 -0.02631579  7.42240664  0.00538566
## TECK WHYE                      0.65280318 -0.02631579  7.42240664  0.24927199
## TELOK BLANGAH DRIVE           -0.01678095 -0.02631579  7.42240664  0.00349978
## TELOK BLANGAH RISE             0.02242528 -0.02631579  7.42240664  0.01789051
## TELOK BLANGAH WAY             -0.33860968 -0.02631579  7.42240664 -0.11462810
## TENGAH                        -1.38215314 -0.02631579  7.42240664 -0.49766285
## TENGEH                         3.67332286 -0.02631579  7.42240664  1.35795987
## THE WHARVES                    1.45309895 -0.02631579  7.42240664  0.54302218
## TIONG BAHRU                    0.44429951 -0.02631579  7.42240664  0.17274030
## TIONG BAHRU STATION           -1.61790281 -0.02631579  7.42240664 -0.58419524
## TOA PAYOH CENTRAL              0.65395631 -0.02631579  7.42240664  0.24969525
## TOA PAYOH WEST                -0.92912372 -0.02631579  7.42240664 -0.33137748
## TOH GUAN                      -0.00957386 -0.02631579  7.42240664  0.00614516
## TOH TUCK                       0.06647805 -0.02631579  7.42240664  0.03406017
## TOWNSVILLE                     0.88756789 -0.02631579  7.42240664  0.33544286
## TRAFALGAR                      2.60171733 -0.02631579  7.42240664  0.96462489
## TUAS BAY                       2.75254595 -0.02631579  7.42240664  1.01998684
## TUAS NORTH                     2.81036435 -0.02631579  7.42240664  1.04120920
## TUAS PROMENADE                 2.51201022 -0.02631579  7.42240664  0.93169771
## TUAS VIEW                      3.71056572 -0.02631579  7.42240664  1.37162994
## TUAS VIEW EXTENSION            4.08790695 -0.02631579  7.42240664  1.51013380
## TUKANG                        -2.50396076 -0.02631579  7.42240664 -0.90942461
## TURF CLUB                      0.44231409 -0.02631579  7.42240664  0.17201155
## TYERSALL                       1.38969751 -0.02631579  7.42240664  0.51975055
## ULU PANDAN                     0.97287575 -0.02631579  7.42240664  0.36675528
## UPPER PAYA LEBAR              -0.27469456 -0.02631579  7.42240664 -0.09116793
## UPPER THOMSON                  2.72397431 -0.02631579  7.42240664  1.00949956
## VICTORIA                      -1.13486781 -0.02631579  7.42240664 -0.40689627
## WATERWAY EAST                 -1.28562631 -0.02631579  7.42240664 -0.46223248
## WENYA                         -3.56443051 -0.02631579  7.42240664 -1.29867218
## WEST COAST                    -0.39161655 -0.02631579  7.42240664 -0.13408438
## WESTERN WATER CATCHMENT        1.39175721 -0.02631579  7.42240664  0.52050657
## WOODGROVE                      0.69164563 -0.02631579  7.42240664  0.26352919
## WOODLANDS EAST                 7.58740575 -0.02631579  7.42240664  2.79463193
## WOODLANDS REGIONAL CENTRE     17.48478967 -0.02631579  7.42240664  6.42748677
## WOODLANDS SOUTH                1.40347827 -0.02631579  7.42240664  0.52480881
## WOODLANDS WEST                 3.18904811 -0.02631579  7.42240664  1.18020584
## WOODLEIGH                      2.06134244 -0.02631579  7.42240664  0.76627919
## XILIN                         -7.68415989 -0.02631579  7.42240664 -2.81082721
## YEW TEE                        0.18063789 -0.02631579  7.42240664  0.07596277
## YIO CHU KANG                   0.16325192 -0.02631579  7.42240664  0.06958121
## YIO CHU KANG EAST             -0.28613817 -0.02631579  7.42240664 -0.09536833
## YIO CHU KANG NORTH             0.17518937 -0.02631579  7.42240664  0.07396288
## YIO CHU KANG WEST              0.00887667 -0.02631579  7.42240664  0.01291746
## YISHUN CENTRAL                 7.09243589 -0.02631579  7.42240664  2.61295224
## YISHUN EAST                    4.51863492 -0.02631579  7.42240664  1.66823337
## YISHUN SOUTH                   3.87340725 -0.02631579  7.42240664  1.43140125
## YISHUN WEST                    6.86939135 -0.02631579  7.42240664  2.53108329
## YUHUA EAST                     0.40079412 -0.02631579  7.42240664  0.15677156
## YUHUA WEST                     0.65352354 -0.02631579  7.42240664  0.24953640
## YUNNAN                         3.97281330 -0.02631579  7.42240664  1.46788844
##                               Pr.z...0.
## ADMIRALTY                        0.4026
## AIRPORT ROAD                     0.6807
## ALEXANDRA HILL                   0.5876
## ALEXANDRA NORTH                  0.4453
## ALJUNIED                         0.1834
## ANAK BUKIT                       0.6409
## ANCHORVALE                       0.3507
## ANG MO KIO TOWN CENTRE           0.1652
## ANSON                            0.2004
## BALESTIER                        0.1722
## BANGKIT                          0.4921
## BAYFRONT SUBZONE                 0.1265
## BAYSHORE                         0.9661
## BEDOK NORTH                      0.0000
## BEDOK RESERVOIR                  0.0403
## BEDOK SOUTH                      0.0000
## BENCOOLEN                        0.2450
## BENDEMEER                        0.4456
## BENOI SECTOR                     0.0868
## BIDADARI                         0.4712
## BISHAN EAST                      0.5955
## BOAT QUAY                        0.1158
## BOON KENG                        0.5167
## BOON LAY PLACE                   0.0588
## BOON TECK                        0.6047
## BOULEVARD                        0.8827
## BRADDELL                         0.6027
## BRAS BASAH                       0.4336
## BRICKWORKS                       0.5102
## BUGIS                            0.5446
## BUKIT BATOK CENTRAL              0.5997
## BUKIT BATOK EAST                 0.5065
## BUKIT BATOK SOUTH                0.5076
## BUKIT BATOK WEST                 0.6124
## BUKIT HO SWEE                    0.3759
## BUKIT MERAH                      0.4833
## CECIL                            0.1928
## CENTRAL SUBZONE                  0.1430
## CENTRAL WATER CATCHMENT          0.4203
## CHANGI AIRPORT                   0.6014
## CHANGI POINT                     0.5302
## CHANGI WEST                      0.8107
## CHATSWORTH                       0.3243
## CHENG SAN                        0.1569
## CHIN BEE                         0.9360
## CHINA SQUARE                     0.2172
## CHINATOWN                        0.6468
## CHOA CHU KANG CENTRAL            0.4804
## CHOA CHU KANG NORTH              0.5117
## CHONG BOON                       0.1560
## CITY HALL                        0.4698
## CITY TERMINALS                   0.2048
## CLARKE QUAY                      0.3340
## CLEMENTI CENTRAL                 0.9580
## CLEMENTI NORTH                   0.5891
## CLEMENTI WEST                    0.5115
## CLEMENTI WOODS                   0.4929
## CLIFFORD PIER                    0.1581
## COMMONWEALTH                     0.3901
## COMPASSVALE                      0.6431
## CORONATION ROAD                  0.3513
## CRAWFORD                         0.4274
## DAIRY FARM                       0.5121
## DEFU INDUSTRIAL PARK             0.5634
## DEPOT ROAD                       0.4901
## DHOBY GHAUT                      0.4369
## DOVER                            0.4202
## DUNEARN                          0.2359
## EAST COAST                       0.8565
## EVERTON PARK                     0.3109
## FABER                            0.4772
## FAJAR                            0.5124
## FARRER COURT                     0.2147
## FARRER PARK                      0.6129
## FERNVALE                         0.5255
## FLORA DRIVE                      0.9166
## FORT CANNING                     0.1842
## FRANKEL                          0.0000
## GALI BATU                        0.4331
## GEYLANG BAHRU                    0.5223
## GEYLANG EAST                     0.0001
## GHIM MOH                         0.3264
## GOMBAK                           0.5204
## GOODWOOD PARK                    0.2503
## GREENWOOD PARK                   0.9869
## GUILIN                           0.5105
## GUL BASIN                        0.0730
## GUL CIRCLE                       0.1239
## HENDERSON HILL                   0.4990
## HILLCREST                        0.2253
## HILLVIEW                         0.4846
## HOLLAND DRIVE                    0.3497
## HOLLAND ROAD                     0.5574
## HONG KAH                         0.4269
## HONG KAH NORTH                   0.4955
## HOUGANG CENTRAL                  0.0925
## HOUGANG EAST                     0.4707
## HOUGANG WEST                     0.0365
## INSTITUTION HILL                 0.1892
## INTERNATIONAL BUSINESS PARK      0.5269
## ISTANA NEGARA                    0.2245
## JELEBU                           0.7546
## JOO KOON                         0.4627
## JOO SENG                         0.4437
## JURONG GATEWAY                   0.5859
## JURONG PORT                      0.2338
## JURONG RIVER                     0.4866
## JURONG WEST CENTRAL              0.1876
## KAKI BUKIT                       0.0494
## KALLANG BAHRU                    0.4611
## KALLANG WAY                      0.6308
## KAMPONG BUGIS                    0.3493
## KAMPONG GLAM                     0.3132
## KAMPONG JAVA                     0.3553
## KAMPONG TIONG BAHRU              0.4490
## KAMPONG UBI                      0.0451
## KANGKAR                          0.4680
## KATONG                           0.7174
## KEAT HONG                        0.5002
## KEBUN BAHRU                      0.4662
## KEMBANGAN                        0.0002
## KENT RIDGE                       0.3107
## KHATIB                           0.4737
## KIAN TECK                        0.7533
## KIM KEAT                         0.5103
## KOVAN                            0.3031
## KRANJI                           0.7453
## LAKESIDE                         0.6356
## LAVENDER                         0.7121
## LEEDON PARK                      0.2684
## LEONIE HILL                      0.2667
## LIM CHU KANG                     0.4314
## LITTLE INDIA                     0.2826
## LIU FANG                         0.1985
## LORONG 8 TOA PAYOH               0.4738
## LORONG AH SOO                    0.0713
## LORONG CHUAN                     0.6911
## LORONG HALUS                     0.6610
## LOWER SELETAR                    0.6391
## LOYANG EAST                      0.9675
## LOYANG WEST                      0.9605
## MACKENZIE                        0.2464
## MACPHERSON                       0.2256
## MALCOLM                          0.4589
## MANDAI EAST                      0.8081
## MANDAI ESTATE                    0.9489
## MANDAI WEST                      0.9810
## MARGARET DRIVE                   0.4230
## MARINA CENTRE                    0.3850
## MARINA EAST (MP)                 0.4509
## MARINA SOUTH                     0.0965
## MARINE PARADE                    0.2592
## MARITIME SQUARE                  0.6786
## MARYMOUNT                        0.2779
## MATILDA                          0.1464
## MAXWELL                          0.1198
## MEI CHIN                         0.4147
## MIDVIEW                          0.1958
## MONK'S HILL                      0.3599
## MOULMEIN                         0.5582
## MOUNT PLEASANT                   0.5015
## MOUNTBATTEN                      0.7029
## NASSIM                           0.3605
## NATIONAL UNIVERSITY OF S'PORE    0.4184
## NATURE RESERVE                   0.4406
## NEE SOON                         0.7828
## NEWTON CIRCUS                    0.3951
## NORTH COAST                      0.0000
## NORTHLAND                        0.2885
## NORTHSHORE                       0.8959
## ONE NORTH                        0.4324
## ONE TREE HILL                    0.2536
## ORANGE GROVE                     0.1683
## OXLEY                            0.2092
## PANDAN                           0.5731
## PANG SUA                         0.5028
## PASIR PANJANG 1                  0.4401
## PASIR PANJANG 2                  0.3586
## PASIR RIS CENTRAL                0.0007
## PASIR RIS DRIVE                  0.0045
## PASIR RIS PARK                   0.9443
## PASIR RIS WAFER FAB PARK         0.6453
## PASIR RIS WEST                   0.1147
## PATERSON                         0.3336
## PAYA LEBAR EAST                  0.5812
## PAYA LEBAR NORTH                 0.3005
## PAYA LEBAR WEST                  0.4454
## PEARL'S HILL                     0.4048
## PEI CHUN                         0.4807
## PENG SIANG                       0.4610
## PENJURU CRESCENT                 0.3592
## PEOPLE'S PARK                    0.3720
## PHILLIP                          0.1148
## PIONEER SECTOR                   0.0993
## PLAB                             0.2132
## PORT                             0.3023
## POTONG PASIR                     0.4045
## PUNGGOL FIELD                    0.3458
## PUNGGOL TOWN CENTRE              0.7748
## QUEENSWAY                        0.3172
## RAFFLES PLACE                    0.0822
## REDHILL                          0.4834
## RESERVOIR VIEW                   0.3594
## RIDOUT                           0.2078
## RIVERVALE                        0.0833
## ROBERTSON QUAY                   0.2500
## ROCHOR CANAL                     0.3097
## SAFTI                            0.8086
## SAMULUN                          0.0722
## SAUJANA                          0.6145
## SELEGIE                          0.2580
## SELETAR                          0.6343
## SELETAR AEROSPACE PARK           0.3439
## SELETAR HILLS                    0.5794
## SEMBAWANG CENTRAL                0.5851
## SEMBAWANG EAST                   0.5707
## SEMBAWANG HILLS                  0.7074
## SEMBAWANG NORTH                  0.4718
## SEMBAWANG SPRINGS                0.5758
## SEMBAWANG STRAITS                0.6590
## SENGKANG TOWN CENTRE             0.0003
## SENGKANG WEST                    0.1941
## SENJA                            0.5589
## SENNETT                          0.4416
## SENOKO NORTH                     0.5512
## SENOKO SOUTH                     0.5872
## SENOKO WEST                      0.8895
## SENTOSA                          0.2701
## SERANGOON CENTRAL                0.6013
## SERANGOON GARDEN                 0.2298
## SERANGOON NORTH                  0.4329
## SERANGOON NORTH IND ESTATE       0.8021
## SHANGRI-LA                       0.5927
## SHIPYARD                         0.0885
## SIGLAP                           0.9411
## SIMEI                            0.0000
## SINGAPORE GENERAL HOSPITAL       0.4488
## SINGAPORE POLYTECHNIC            0.5299
## SOMERSET                         0.6446
## SPRINGLEAF                       0.2852
## STRAITS VIEW                     0.0515
## SUNGEI ROAD                      0.3658
## SUNSET WAY                       0.6649
## SWISS CLUB                       0.3462
## TAGORE                           0.4817
## TAI SENG                         0.4953
## TAMAN JURONG                     0.3699
## TAMPINES EAST                    0.0000
## TAMPINES NORTH                   0.9258
## TAMPINES WEST                    0.0000
## TANGLIN                          0.1804
## TANGLIN HALT                     0.4009
## TANJONG PAGAR                    0.1462
## TANJONG RHU                      0.4797
## TEBAN GARDENS                    0.4979
## TECK WHYE                        0.4016
## TELOK BLANGAH DRIVE              0.4986
## TELOK BLANGAH RISE               0.4929
## TELOK BLANGAH WAY                0.5456
## TENGAH                           0.6906
## TENGEH                           0.0872
## THE WHARVES                      0.2936
## TIONG BAHRU                      0.4314
## TIONG BAHRU STATION              0.7205
## TOA PAYOH CENTRAL                0.4014
## TOA PAYOH WEST                   0.6298
## TOH GUAN                         0.4975
## TOH TUCK                         0.4864
## TOWNSVILLE                       0.3686
## TRAFALGAR                        0.1674
## TUAS BAY                         0.1539
## TUAS NORTH                       0.1489
## TUAS PROMENADE                   0.1757
## TUAS VIEW                        0.0851
## TUAS VIEW EXTENSION              0.0655
## TUKANG                           0.8184
## TURF CLUB                        0.4317
## TYERSALL                         0.3016
## ULU PANDAN                       0.3569
## UPPER PAYA LEBAR                 0.5363
## UPPER THOMSON                    0.1564
## VICTORIA                         0.6580
## WATERWAY EAST                    0.6780
## WENYA                            0.9030
## WEST COAST                       0.5533
## WESTERN WATER CATCHMENT          0.3014
## WOODGROVE                        0.3961
## WOODLANDS EAST                   0.0026
## WOODLANDS REGIONAL CENTRE        0.0000
## WOODLANDS SOUTH                  0.2999
## WOODLANDS WEST                   0.1190
## WOODLEIGH                        0.2218
## XILIN                            0.9975
## YEW TEE                          0.4697
## YIO CHU KANG                     0.4723
## YIO CHU KANG EAST                0.5380
## YIO CHU KANG NORTH               0.4705
## YIO CHU KANG WEST                0.4948
## YISHUN CENTRAL                   0.0045
## YISHUN EAST                      0.0476
## YISHUN SOUTH                     0.0762
## YISHUN WEST                      0.0057
## YUHUA EAST                       0.4377
## YUHUA WEST                       0.4015
## YUNNAN                           0.0711

Mapping Local Moran’s I values and p-values for Tap In

The the dark red zones on the left map and the dark blue zones on the right map indicate the subzones responsible for the clusters.

new_overall.localMI <- cbind(new_overall, localMI)

localMI.map <- tm_shape(new_overall.localMI) +
  tm_fill(col = "Ii", 
          breaks = c(-Inf, -5, 0, 10, Inf),
          palette = "-RdBu",
          title = "local Moran's I statistics") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.position = c("RIGHT", "BOTTOM"))

pvalue.map <- tm_shape(new_overall.localMI) +
  tm_fill(col = "Pr.z...0.", 
          breaks = c(-Inf, 0.05, Inf),
          palette = "-Blues", 
          title = "local Moran's I p-values") +
  tm_borders(alpha = 0.5) + 
  tm_layout(legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(localMI.map, pvalue.map, asp = 1, ncol = 2)

Spatially lagged Tap In values

TAP_IN.lag <- lag.listw(rswm_knn8, new_overall$TAP_IN)
TAP_IN.lag
##   [1]  2360689  3810264  1909319  2808248  3454081  2530076  5367231  3807032
##   [9]  1476891  3742097  3094827   969605  7339746  5854459  8082570  7247906
##  [17]  1664422  3326373   782330  2910594  2789308   958886  4014323  6463505
##  [25]  4177272  1136205  4425529  2092079  3286976  1585895  2777896  3249361
##  [33]  3495794  4396903  2117436  2360088   894967   890617  1248921  2634562
##  [41]  3227990  6287172  1311923  4090012  5935829  1267776   947917  3066772
##  [49]  3626234  4974136  1646720  1538016  1251979  2002715  2640447  3382580
##  [57]  3362163  1010528  1698224  6544517  1580091  2139550  3115937  3457492
##  [65]  3006646  1589242  2042558  1190669  4682816  1587298  2933606  3233406
##  [73]  1460926  1337657  2468871  7043029  1409121  7399685  2444465  3783444
##  [81]  4935568  1868535  3408758  1943362  7218109  3208887   766812   795395
##  [89]  2333457  1313031  2799989  1614170  1920492  3151774  3051669  4451777
##  [97]  5090005  4838521  1549476  3173853  1878304  2506912  4066787  2554825
## [105]  2872208  1826229  2988598  3264132  4734441  2304733  4257455  2191763
## [113]  2127388  1892828  2642240  6216975  3580993  6558493  4678732  3891157
## [121]  8030964  2089526  4093074  4463780  3132265  6464651  4939436  4005924
## [129]  1561398  1565980  1977368  2772954  2093610  1437229  2209550  4518409
## [137]  3985306  3687393  4213805  6442924  6429150  1410088  5245016  2783820
## [145]  4921727  5746818  6289962  1907643  2083086  2865646  1032096  3864180
## [153]  2408304  4117441  4102714  1199888  1935939  6780533  2499900  2281133
## [161]  3061954  4537558  1411549  2168616  2740144  4395563  1947045  6017924
## [169]  5095544  5031765  1669534  1823106  1575148  1700176  3413548  3064390
## [177]  1740674  1887152  6027085  5646516  6835692  3706915  6234541  1674632
## [185]  3377835  1923931  2838399  1796812  2904022  3441490  2390549  1423601
## [193]  1226713   877954  1707521  1945619  2143207  3820271  4901730  2030572
## [201]   604984  2603364  2451129  1443764  4566844  1107730  2137068  4497685
## [209]   779136  4150743  1820949  3929169  2372060  3515213  2759657  3570112
## [217]  4145919  1910029  3619735  3720541  4753609  1688670  4322266  1979301
## [225]  3356166  3733930  6110871  2108269  2888384  4534312  5082507  4960709
## [233]  4883878   800756  6853869 10154621  2565261  3551857  1406620  2096151
## [241]   526299  2295471  3800357  2064380  2951852  2940485  3324901  4859952
## [249]  8046239  9355089  1586294  1728382  1269505  2915763  2971103  4345954
## [257]  2648588  2983413  3522482  3869082   967107  2074847  2482641  2104241
## [265]  3158159  5232290  3662530  2945576  5918139  4057342   876962   904051
## [273]   870706   519444   590970  4642233  2205339  1260567  2316859  3475308
## [281]  4310848  1187419  4725736  6898085  3278857  6419080  4317959  4451471
## [289]  5215358  5490284  5112455  1667298 10995485  3276423  3273281  3277823
## [297]  2910665  2806340  4426568  5018853  4930773  4463238  3816677  3902611
## [305]  4119939
new_overall$TAP_IN_lag <- TAP_IN.lag

Plotting Tap In values alongside Tap In lag values

tap_in <- tm_shape(new_overall) +
          tm_fill(col = "TAP_IN",
                  n = 6 ,
                  style = "equal",
                  palette = "Blues") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tap_in_lag <- tm_shape(new_overall) +
          tm_fill(col = "TAP_IN_lag",
                  n = 6 ,
                  style = "equal",
                  palette = "Blues") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(tap_in, tap_in_lag, asp = 1, ncol = 2)

Plotting Moran scatterplot as standardised variables

new_overall$Z.TAP_IN <- scale(new_overall$TAP_IN) %>% as.vector()

nci2 <- moran.plot(new_overall$Z.TAP_IN, rswm_knn8, labels = as.character(new_overall$SUBZONE_N), xlab = "z-TAP_IN", ylab = "Spatially Lag z-TAP_IN")

Creating the quadrants

quadrant <- vector(mode="numeric",length=nrow(localMI))

DV <- new_overall$TAP_IN

C_mI <- new_overall$TAP_IN_lag

signif <- 0.05       
quadrant[DV >0 & C_mI>0] <- 4      
quadrant[DV <0 & C_mI<0] <- 1      
quadrant[DV <0 & C_mI>0] <- 2
quadrant[DV >0 & C_mI<0] <- 3
quadrant[localMI[,5]>signif] <- 0

Mapping LISA Cluster

new_overall.localMI$quadrant <- quadrant
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")

tm_shape(new_overall.localMI) +
  tm_fill(col = "quadrant", style = "cat", palette = colors[c(sort(unique(quadrant)))+1], labels = clusters[c(sort(unique(quadrant)))+1], popup.vars = c("SUBZONE_N")) +
  tm_view(set.zoom.limits = c(11,17)) +
  tm_borders(alpha=0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

Hot Spot and Cold Spot Area Analysis

Create adaptive proximity matrix

coords <- st_centroid(new_overall)
## Warning in st_centroid.sf(new_overall): st_centroid assumes attributes are
## constant over geometries of x
knb <- knn2nb(knearneigh(coords, k = 8, longlat = FALSE), row.names = row.names(new_overall$TAP_IN))
## Warning in knearneigh(coords, k = 8, longlat = FALSE): dnearneigh: longlat
## argument overrides object
knb_lw <- nb2listw(knb, style = 'B')

summary(knb_lw)
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 305 
## Number of nonzero links: 2440 
## Percentage nonzero weights: 2.622951 
## Average number of links: 8 
## Non-symmetric neighbours list
## Link number distribution:
## 
##   8 
## 305 
## 305 least connected regions:
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 with 8 links
## 305 most connected regions:
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 with 8 links
## 
## Weights style: B 
## Weights constants summary:
##     n    nn   S0   S1    S2
## B 305 93025 2440 4412 79922

Plotting the subzones and their neighbours

plot(new_overall$geometry, border = "lightgrey")
plot(knb, st_centroid(new_overall$geometry), pch = 19, cex = 0.6, add = TRUE, col = "red")

Gi stats using adaptive distance

fips <- order(new_overall$SUBZONE_N)

gi.adaptive <- localG(new_overall$TAP_IN, knb_lw)

new_overall.gi <- cbind(new_overall, as.matrix(gi.adaptive))

names(new_overall.gi)[8] <- "gstat_adaptive"

Mapping out the hot and cold spots

tm_shape(new_overall.gi) +
  tm_fill(col = "gstat_adaptive",
          style = "equal",
          palette = "-RdBu",
          title = "local Gi") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

#Linear Regression for Tap Out vs Population

Tap Out(x) vs Population(y)

The Linear Regression is significant as p-value < 0.05.

stat2 <- lm(TAP_OUT ~ SUBZONE_POPULATION, new_overall)

plot(stat2)

summary(stat2)
## 
## Call:
## lm(formula = TAP_OUT ~ SUBZONE_POPULATION, data = new_overall)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -824702 -123573  -59179   34208 1643316 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        1.259e+05  2.043e+04   6.163 2.27e-09 ***
## SUBZONE_POPULATION 1.917e+01  9.088e-01  21.088  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 288800 on 303 degrees of freedom
## Multiple R-squared:  0.5948, Adjusted R-squared:  0.5934 
## F-statistic: 444.7 on 1 and 303 DF,  p-value: < 2.2e-16

Plotting a fitted line

ggplot(new_overall, aes(TAP_OUT, SUBZONE_POPULATION))+
  geom_point()+
  geom_smooth(method = "lm", se = FALSE)
## `geom_smooth()` using formula 'y ~ x'

##Global Moran’s I Prep

Adaptive distance weight matrix (fixed neighbours)

coords <- st_centroid(new_overall$geometry)

wm_knn8 <- knn2nb(knearneigh(coords, k = 8))

Plotting the neighbours of the subzones

plot(new_overall$geometry, border = "lightgrey")
plot(wm_knn8, st_centroid(new_overall$geometry), add = TRUE, col = "red")

Row-standardised weights matrix

rswm_knn8 <- nb2listw(wm_knn8, style="B", zero.policy = TRUE)
rswm_knn8
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 305 
## Number of nonzero links: 2440 
## Percentage nonzero weights: 2.622951 
## Average number of links: 8 
## Non-symmetric neighbours list
## 
## Weights style: B 
## Weights constants summary:
##     n    nn   S0   S1    S2
## B 305 93025 2440 4412 79922

Spatially lagged values of Tap Out Residuals

new_overall$TAP_OUT_Residuals <- stat$residuals

TAP_OUT_Residuals.lag <- lag.listw(rswm_knn8, new_overall$TAP_OUT_Residuals)

new_overall$TAP_OUT_Residuals_lag <- TAP_OUT_Residuals.lag

Plotting Tap Out Residual values alongside Tap Out Residual Lag values

tap_out_residual <- tm_shape(new_overall) +
          tm_fill(col = "TAP_OUT_Residuals",
                  n = 6 ,
                  style = "equal",
                  palette = "-RdBu") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tap_out_residual_lag <- tm_shape(new_overall) +
          tm_fill(col = "TAP_OUT_Residuals_lag",
                  n = 6 ,
                  style = "equal",
                  palette = "-RdBu") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(tap_out_residual, tap_out_residual_lag, asp = 1, ncol = 2)

Compute Global Moran’s I for Residual

moran.test(new_overall$TAP_OUT_Residuals, listw = rswm_knn8, zero.policy = TRUE, na.action = na.omit)
## 
##  Moran I test under randomisation
## 
## data:  new_overall$TAP_OUT_Residuals  
## weights: rswm_knn8    
## 
## Moran I statistic standard deviate = -0.63611, p-value = 0.7376
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##     -0.0200608661     -0.0032894737      0.0006951389

Computing Monte Carlo for Global Moran’s I

Since the p-value > 0.05. We do not reject the null hypothesis. This affirms that the linear regression model conforms to the randomisation assumption.

set.seed(1234)
bperm2 <- moran.mc(new_overall$TAP_OUT_Residuals, listw=rswm_knn8, nsim=999, zero.policy = TRUE, na.action=na.omit)

bperm2
## 
##  Monte-Carlo simulation of Moran I
## 
## data:  new_overall$TAP_OUT_Residuals 
## weights: rswm_knn8  
## number of simulations + 1: 1000 
## 
## statistic = -0.020061, observed rank = 277, p-value = 0.723
## alternative hypothesis: greater

Visualising Monte Carlo for Global Moran’s I of Residual

mean(bperm2$res[1:999])
## [1] -0.003718384
var(bperm2$res[1:999])
## [1] 0.0006685426
summary(bperm2$res[1:999])
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -0.078989 -0.021945 -0.005632 -0.003718  0.012736  0.082032
hist(bperm2$res, freq = TRUE, breaks = 20, xlab = "Simulated Moran's I")
abline(v = 0, col = "red") 

Visualising spatially lagged residual values using Moran Scatterplot

MS2 <- moran.plot(new_overall$TAP_OUT_Residuals, rswm_knn8, zero.policy = TRUE, spChk = FALSE, labels = as.character(new_overall$SUBZONE_N), xlab = "Tap Out Residuals", ylab = "Spatially Lag Tap Out Residuals")

Compute Global Moran’s I correlogram and plot for residual

MI_corr2 <- sp.correlogram(wm_knn8, new_overall$TAP_OUT_Residuals, order = 6, method = "I", style = "B")
plot(MI_corr2)

Compute Global Moran’s I for Tap Out

moran.test(new_overall$TAP_OUT, listw = rswm_knn8, zero.policy = TRUE, na.action = na.omit)
## 
##  Moran I test under randomisation
## 
## data:  new_overall$TAP_OUT  
## weights: rswm_knn8    
## 
## Moran I statistic standard deviate = 6.073, p-value = 6.279e-10
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.1558627082     -0.0032894737      0.0006867918

Computing Monte Carlo for Global Moran’s I of Tap Out

Since p-value < 0.05, we reject the null hypothesis. Since I > 0, there is a sign of clustering taking place. To investigate the subzones involved. We need to conduct a localised analysis.

set.seed(1234)
bperm2 <- moran.mc(new_overall$TAP_OUT, listw=rswm_knn8, nsim=999, zero.policy = TRUE, na.action=na.omit)

bperm2
## 
##  Monte-Carlo simulation of Moran I
## 
## data:  new_overall$TAP_OUT 
## weights: rswm_knn8  
## number of simulations + 1: 1000 
## 
## statistic = 0.15586, observed rank = 1000, p-value = 0.001
## alternative hypothesis: greater

Visualising Monte Carlo for Global Moran’s I of Tap Out

mean(bperm2$res[1:999])
## [1] -0.004154364
var(bperm2$res[1:999])
## [1] 0.000610482
summary(bperm2$res[1:999])
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -0.077280 -0.021906 -0.005272 -0.004154  0.011249  0.088465
hist(bperm2$res, freq = TRUE, breaks = 20, xlab = "Simulated Moran's I")
abline(v = 0, col = "red") 

Visualising spatially lagged Tap Out values using Moran Scatterplot

MS2 <- moran.plot(new_overall$TAP_OUT, rswm_knn8, zero.policy = TRUE, spChk=FALSE, labels=as.character(new_overall$SUBZONE_N), xlab="TAP_OUT", ylab="Spatially Lag TAP_OUT")

Compute Global Moran’s I correlogram and plot for Tap Out

MI_corr2 <- sp.correlogram(wm_knn8, new_overall$TAP_IN, order = 6, method = "I", style = "B")
plot(MI_corr2)

Cluster and Outlier Analysis

Computing Local Moran’s I for Tap Out

fips <- order(new_overall$SUBZONE_N)

localMI2 <- localmoran(new_overall$TAP_OUT, rswm_knn8)

head(localMI2)
##           Ii        E.Ii   Var.Ii       Z.Ii Pr(z > 0)
## 1  0.5456460 -0.02631579 7.432713  0.2097941 0.4169142
## 2 -1.6552724 -0.02631579 7.432713 -0.5974971 0.7249122
## 3 -1.1271038 -0.02631579 7.432713 -0.4037662 0.6568077
## 4  0.3182471 -0.02631579 7.432713  0.1263848 0.4497137
## 5  1.4244070 -0.02631579 7.432713  0.5321214 0.2973210
## 6 -0.9347775 -0.02631579 7.432713 -0.3332214 0.6305164

Values ordered by Subzone Names

printCoefmat(data.frame(localMI2[fips,], row.names = new_overall$SUBZONE_N[fips]), check.names = FALSE)
##                                        Ii        E.Ii      Var.Ii        Z.Ii
## ADMIRALTY                      0.54564597 -0.02631579  7.43271338  0.20979412
## AIRPORT ROAD                  -1.65527238 -0.02631579  7.43271338 -0.59749712
## ALEXANDRA HILL                -1.12710379 -0.02631579  7.43271338 -0.40376623
## ALEXANDRA NORTH                0.31824711 -0.02631579  7.43271338  0.12638479
## ALJUNIED                       1.42440699 -0.02631579  7.43271338  0.53212142
## ANAK BUKIT                    -0.93477750 -0.02631579  7.43271338 -0.33322144
## ANCHORVALE                     1.04343553 -0.02631579  7.43271338  0.39238206
## ANG MO KIO TOWN CENTRE         2.25592333 -0.02631579  7.43271338  0.83711949
## ANSON                          2.40942555 -0.02631579  7.43271338  0.89342371
## BALESTIER                      2.64595142 -0.02631579  7.43271338  0.98018080
## BANGKIT                        0.01195084 -0.02631579  7.43271338  0.01403610
## BAYFRONT SUBZONE               2.99208673 -0.02631579  7.43271338  1.10714235
## BAYSHORE                      -6.67697616 -0.02631579  7.43271338 -2.43944526
## BEDOK NORTH                   37.28416216 -0.02631579  7.43271338 13.68538815
## BEDOK RESERVOIR                4.00290578 -0.02631579  7.43271338  1.47790820
## BEDOK SOUTH                   12.01947338 -0.02631579  7.43271338  4.41836474
## BENCOOLEN                      2.16500010 -0.02631579  7.43271338  0.80376908
## BENDEMEER                      0.43809951 -0.02631579  7.43271338  0.17034635
## BENOI SECTOR                   3.71865369 -0.02631579  7.43271338  1.37364525
## BIDADARI                       0.24455135 -0.02631579  7.43271338  0.09935338
## BISHAN EAST                   -0.14424575 -0.02631579  7.43271338 -0.04325641
## BOAT QUAY                      2.69465624 -0.02631579  7.43271338  0.99804560
## BOON KENG                     -0.24721715 -0.02631579  7.43271338 -0.08102605
## BOON LAY PLACE                 4.45887130 -0.02631579  7.43271338  1.64515518
## BOON TECK                     -0.38991018 -0.02631579  7.43271338 -0.13336549
## BOULEVARD                     -4.69526507 -0.02631579  7.43271338 -1.71255869
## BRADDELL                      -0.85273689 -0.02631579  7.43271338 -0.30312915
## BRAS BASAH                     0.49210060 -0.02631579  7.43271338  0.19015381
## BRICKWORKS                    -0.07435569 -0.02631579  7.43271338 -0.01762091
## BUGIS                         -0.48273958 -0.02631579  7.43271338 -0.16741508
## BUKIT BATOK CENTRAL           -0.52628243 -0.02631579  7.43271338 -0.18338649
## BUKIT BATOK EAST              -0.16060761 -0.02631579  7.43271338 -0.04925790
## BUKIT BATOK SOUTH             -0.06358078 -0.02631579  7.43271338 -0.01366871
## BUKIT BATOK WEST              -0.56120900 -0.02631579  7.43271338 -0.19619746
## BUKIT HO SWEE                  0.95554664 -0.02631579  7.43271338  0.36014463
## BUKIT MERAH                   -0.08938195 -0.02631579  7.43271338 -0.02313251
## CECIL                          2.49543112 -0.02631579  7.43271338  0.92497033
## CENTRAL SUBZONE                2.47976219 -0.02631579  7.43271338  0.91922301
## CENTRAL WATER CATCHMENT        0.66866224 -0.02631579  7.43271338  0.25491617
## CHANGI AIRPORT                -0.85065158 -0.02631579  7.43271338 -0.30236426
## CHANGI POINT                  -0.26074185 -0.02631579  7.43271338 -0.08598688
## CHANGI WEST                   -3.71355643 -0.02631579  7.43271338 -1.35247046
## CHATSWORTH                     1.49476486 -0.02631579  7.43271338  0.55792850
## CHENG SAN                      1.94197363 -0.02631579  7.43271338  0.72196354
## CHIN BEE                      -4.10605111 -0.02631579  7.43271338 -1.49643651
## CHINA SQUARE                   1.91384933 -0.02631579  7.43271338  0.71164762
## CHINATOWN                     -0.16544963 -0.02631579  7.43271338 -0.05103394
## CHOA CHU KANG CENTRAL          0.15062307 -0.02631579  7.43271338  0.06490072
## CHOA CHU KANG NORTH           -0.25596377 -0.02631579  7.43271338 -0.08423430
## CHONG BOON                     3.91604220 -0.02631579  7.43271338  1.44604685
## CITY HALL                     -0.01121360 -0.02631579  7.43271338  0.00553945
## CITY TERMINALS                 2.25263717 -0.02631579  7.43271338  0.83591413
## CLARKE QUAY                    1.79327713 -0.02631579  7.43271338  0.66742204
## CLEMENTI CENTRAL              -4.09991872 -0.02631579  7.43271338 -1.49418717
## CLEMENTI NORTH                -0.80498966 -0.02631579  7.43271338 -0.28561559
## CLEMENTI WEST                 -0.01119436 -0.02631579  7.43271338  0.00554650
## CLEMENTI WOODS                 0.00354447 -0.02631579  7.43271338  0.01095267
## CLIFFORD PIER                  2.62292252 -0.02631579  7.43271338  0.97173386
## COMMONWEALTH                   1.04781595 -0.02631579  7.43271338  0.39398878
## COMPASSVALE                   -0.97411467 -0.02631579  7.43271338 -0.34765021
## CORONATION ROAD                1.31766630 -0.02631579  7.43271338  0.49296920
## CRAWFORD                       0.41265093 -0.02631579  7.43271338  0.16101187
## DAIRY FARM                    -0.05652138 -0.02631579  7.43271338 -0.01107933
## DEFU INDUSTRIAL PARK          -0.45346265 -0.02631579  7.43271338 -0.15667638
## DEPOT ROAD                    -0.26686224 -0.02631579  7.43271338 -0.08823182
## DHOBY GHAUT                    0.17359588 -0.02631579  7.43271338  0.07332709
## DOVER                          0.35783279 -0.02631579  7.43271338  0.14090472
## DUNEARN                        2.57517690 -0.02631579  7.43271338  0.95422088
## EAST COAST                    -2.88243109 -0.02631579  7.43271338 -1.04761581
## EVERTON PARK                   1.11854894 -0.02631579  7.43271338  0.41993346
## FABER                          0.13957746 -0.02631579  7.43271338  0.06084922
## FAJAR                         -0.07873435 -0.02631579  7.43271338 -0.01922699
## FARRER COURT                   2.36539111 -0.02631579  7.43271338  0.87727199
## FARRER PARK                   -0.57909881 -0.02631579  7.43271338 -0.20275940
## FERNVALE                      -0.15158598 -0.02631579  7.43271338 -0.04594879
## FLORA DRIVE                   -3.28127835 -0.02631579  7.43271338 -1.19391196
## FORT CANNING                   2.22467748 -0.02631579  7.43271338  0.82565859
## FRANKEL                       16.35150346 -0.02631579  7.43271338  6.00734233
## GALI BATU                      0.35624179 -0.02631579  7.43271338  0.14032115
## GEYLANG BAHRU                 -0.19985790 -0.02631579  7.43271338 -0.06365480
## GEYLANG EAST                   9.19489059 -0.02631579  7.43271338  3.38231498
## GHIM MOH                       1.15473087 -0.02631579  7.43271338  0.43320490
## GOMBAK                        -0.55290051 -0.02631579  7.43271338 -0.19314993
## GOODWOOD PARK                  1.77031320 -0.02631579  7.43271338  0.65899893
## GREENWOOD PARK                -5.88331749 -0.02631579  7.43271338 -2.14833329
## GUILIN                         0.00254666 -0.02631579  7.43271338  0.01058667
## GUL BASIN                      3.79690956 -0.02631579  7.43271338  1.40234931
## GUL CIRCLE                     3.54017594 -0.02631579  7.43271338  1.30818007
## HENDERSON HILL                 0.13430767 -0.02631579  7.43271338  0.05891628
## HILLCREST                      2.27584327 -0.02631579  7.43271338  0.84442607
## HILLVIEW                       0.09925998 -0.02631579  7.43271338  0.04606087
## HOLLAND DRIVE                  1.02279555 -0.02631579  7.43271338  0.38481136
## HOLLAND ROAD                  -0.23333460 -0.02631579  7.43271338 -0.07593397
## HONG KAH                       1.19699075 -0.02631579  7.43271338  0.44870572
## HONG KAH NORTH                -0.00040568 -0.02631579  7.43271338  0.00950376
## HOUGANG CENTRAL                4.00272212 -0.02631579  7.43271338  1.47784083
## HOUGANG EAST                   0.08448490 -0.02631579  7.43271338  0.04064141
## HOUGANG WEST                   4.77655089 -0.02631579  7.43271338  1.76167925
## INSTITUTION HILL               2.66582043 -0.02631579  7.43271338  0.98746870
## INTERNATIONAL BUSINESS PARK   -0.39585537 -0.02631579  7.43271338 -0.13554618
## ISTANA NEGARA                  2.50713079 -0.02631579  7.43271338  0.92926175
## JELEBU                        -1.74301207 -0.02631579  7.43271338 -0.62967982
## JOO KOON                      -0.03427698 -0.02631579  7.43271338 -0.00292014
## JOO SENG                       0.31520790 -0.02631579  7.43271338  0.12527002
## JURONG GATEWAY                -0.13467266 -0.02631579  7.43271338 -0.03974502
## JURONG PORT                    1.56124479 -0.02631579  7.43271338  0.58231317
## JURONG RIVER                  -0.12917187 -0.02631579  7.43271338 -0.03772735
## JURONG WEST CENTRAL            3.51873453 -0.02631579  7.43271338  1.30031541
## KAKI BUKIT                     5.45847473 -0.02631579  7.43271338  2.01180717
## KALLANG BAHRU                 -0.01228355 -0.02631579  7.43271338  0.00514699
## KALLANG WAY                   -1.28010511 -0.02631579  7.43271338 -0.45988673
## KAMPONG BUGIS                  0.91471946 -0.02631579  7.43271338  0.34516933
## KAMPONG GLAM                   1.47841260 -0.02631579  7.43271338  0.55193053
## KAMPONG JAVA                   0.96944875 -0.02631579  7.43271338  0.36524389
## KAMPONG TIONG BAHRU            0.30000253 -0.02631579  7.43271338  0.11969273
## KAMPONG UBI                    5.39284283 -0.02631579  7.43271338  1.98773356
## KANGKAR                        0.17165034 -0.02631579  7.43271338  0.07261347
## KATONG                        -1.41361965 -0.02631579  7.43271338 -0.50885952
## KEAT HONG                      0.72638201 -0.02631579  7.43271338  0.27608763
## KEBUN BAHRU                   -0.11372661 -0.02631579  7.43271338 -0.03206206
## KEMBANGAN                      9.81414922 -0.02631579  7.43271338  3.60945747
## KENT RIDGE                     1.05528892 -0.02631579  7.43271338  0.39672985
## KHATIB                         1.47728667 -0.02631579  7.43271338  0.55151755
## KIAN TECK                     -1.48416267 -0.02631579  7.43271338 -0.53473452
## KIM KEAT                      -0.54874136 -0.02631579  7.43271338 -0.19162437
## KOVAN                          1.15184227 -0.02631579  7.43271338  0.43214537
## KRANJI                        -1.56159771 -0.02631579  7.43271338 -0.56313749
## LAKESIDE                      -0.75321046 -0.02631579  7.43271338 -0.26662311
## LAVENDER                      -1.27356085 -0.02631579  7.43271338 -0.45748631
## LEEDON PARK                    1.89566710 -0.02631579  7.43271338  0.70497842
## LEONIE HILL                    1.90460731 -0.02631579  7.43271338  0.70825767
## LIM CHU KANG                   0.51448039 -0.02631579  7.43271338  0.19836266
## LITTLE INDIA                   1.94276429 -0.02631579  7.43271338  0.72225355
## LIU FANG                       2.08804221 -0.02631579  7.43271338  0.77554112
## LORONG 8 TOA PAYOH             0.00102112 -0.02631579  7.43271338  0.01002711
## LORONG AH SOO                  4.30646441 -0.02631579  7.43271338  1.58925273
## LORONG CHUAN                  -1.69724234 -0.02631579  7.43271338 -0.61289160
## LORONG HALUS                  -1.26321362 -0.02631579  7.43271338 -0.45369097
## LOWER SELETAR                 -1.38252706 -0.02631579  7.43271338 -0.49745483
## LOYANG EAST                   -5.55075880 -0.02631579  7.43271338 -2.02635161
## LOYANG WEST                   -3.82763256 -0.02631579  7.43271338 -1.39431330
## MACKENZIE                      2.47936594 -0.02631579  7.43271338  0.91907767
## MACPHERSON                     1.90334188 -0.02631579  7.43271338  0.70779351
## MALCOLM                        0.40061550 -0.02631579  7.43271338  0.15659731
## MANDAI EAST                   -3.28951132 -0.02631579  7.43271338 -1.19693180
## MANDAI ESTATE                 -4.75774598 -0.02631579  7.43271338 -1.73547653
## MANDAI WEST                   -5.93550528 -0.02631579  7.43271338 -2.16747563
## MARGARET DRIVE                 0.78992865 -0.02631579  7.43271338  0.29939638
## MARINA CENTRE                  0.75748873 -0.02631579  7.43271338  0.28749750
## MARINA EAST (MP)               0.00991489 -0.02631579  7.43271338  0.01328932
## MARINA SOUTH                   3.45407779 -0.02631579  7.43271338  1.27659949
## MARINE PARADE                  1.46855853 -0.02631579  7.43271338  0.54831609
## MARITIME SQUARE               -0.82602029 -0.02631579  7.43271338 -0.29332957
## MARYMOUNT                      1.37380861 -0.02631579  7.43271338  0.51356206
## MATILDA                        2.92061344 -0.02631579  7.43271338  1.08092612
## MAXWELL                        3.26279309 -0.02631579  7.43271338  1.20643675
## MEI CHIN                       0.20107978 -0.02631579  7.43271338  0.08340811
## MIDVIEW                        2.09064385 -0.02631579  7.43271338  0.77649540
## MONK'S HILL                    1.16489044 -0.02631579  7.43271338  0.43693141
## MOULMEIN                      -0.32296480 -0.02631579  7.43271338 -0.10881010
## MOUNT PLEASANT                 0.16503382 -0.02631579  7.43271338  0.07018655
## MOUNTBATTEN                   -1.36153145 -0.02631579  7.43271338 -0.48975370
## NASSIM                         1.17172014 -0.02631579  7.43271338  0.43943652
## NATIONAL UNIVERSITY OF S'PORE  0.55734745 -0.02631579  7.43271338  0.21408619
## NATURE RESERVE                 0.26738241 -0.02631579  7.43271338  0.10772775
## NEE SOON                      -2.39784135 -0.02631579  7.43271338 -0.86986953
## NEWTON CIRCUS                  1.18371644 -0.02631579  7.43271338  0.44383673
## NORTH COAST                   11.18238038 -0.02631579  7.43271338  4.11132117
## NORTHLAND                      1.24363680 -0.02631579  7.43271338  0.46581537
## NORTHSHORE                    -3.48272416 -0.02631579  7.43271338 -1.26780178
## ONE NORTH                      0.05867265 -0.02631579  7.43271338  0.03117354
## ONE TREE HILL                  2.05491083 -0.02631579  7.43271338  0.76338862
## ORANGE GROVE                   2.81331706 -0.02631579  7.43271338  1.04157009
## OXLEY                          2.44112404 -0.02631579  7.43271338  0.90505064
## PANDAN                        -0.57927268 -0.02631579  7.43271338 -0.20282318
## PANG SUA                      -0.15707296 -0.02631579  7.43271338 -0.04796140
## PASIR PANJANG 1                0.29560492 -0.02631579  7.43271338  0.11807969
## PASIR PANJANG 2                1.02004691 -0.02631579  7.43271338  0.38380317
## PASIR RIS CENTRAL              9.57626668 -0.02631579  7.43271338  3.52220276
## PASIR RIS DRIVE                6.71150503 -0.02631579  7.43271338  2.47141549
## PASIR RIS PARK                -3.73171356 -0.02631579  7.43271338 -1.35913045
## PASIR RIS WAFER FAB PARK      -0.97353486 -0.02631579  7.43271338 -0.34743754
## PASIR RIS WEST                 2.78069738 -0.02631579  7.43271338  1.02960527
## PATERSON                       2.03631167 -0.02631579  7.43271338  0.75656649
## PAYA LEBAR EAST               -0.73605021 -0.02631579  7.43271338 -0.26032877
## PAYA LEBAR NORTH               1.43913472 -0.02631579  7.43271338  0.53752351
## PAYA LEBAR WEST                0.19530108 -0.02631579  7.43271338  0.08128850
## PEARL'S HILL                   1.05982798 -0.02631579  7.43271338  0.39839476
## PEI CHUN                       0.03630611 -0.02631579  7.43271338  0.02296955
## PENG SIANG                     0.10305591 -0.02631579  7.43271338  0.04745321
## PENJURU CRESCENT               0.93417515 -0.02631579  7.43271338  0.35230563
## PEOPLE'S PARK                  0.50960880 -0.02631579  7.43271338  0.19657577
## PHILLIP                        3.42267805 -0.02631579  7.43271338  1.26508214
## PIONEER SECTOR                 3.72685568 -0.02631579  7.43271338  1.37665372
## PLAB                           2.11598252 -0.02631579  7.43271338  0.78578955
## PORT                           1.46793796 -0.02631579  7.43271338  0.54808847
## POTONG PASIR                   0.44900943 -0.02631579  7.43271338  0.17434808
## PUNGGOL FIELD                  0.86765063 -0.02631579  7.43271338  0.32790460
## PUNGGOL TOWN CENTRE           -2.44575423 -0.02631579  7.43271338 -0.88744385
## QUEENSWAY                      1.16867095 -0.02631579  7.43271338  0.43831809
## RAFFLES PLACE                  3.79494716 -0.02631579  7.43271338  1.40162950
## REDHILL                        0.11069087 -0.02631579  7.43271338  0.05025369
## RESERVOIR VIEW                 0.46460357 -0.02631579  7.43271338  0.18006797
## RIDOUT                         2.18850867 -0.02631579  7.43271338  0.81239196
## RIVERVALE                      3.99093431 -0.02631579  7.43271338  1.47351709
## ROBERTSON QUAY                 1.86009754 -0.02631579  7.43271338  0.69193160
## ROCHOR CANAL                   1.49404835 -0.02631579  7.43271338  0.55766569
## SAFTI                         -2.47224553 -0.02631579  7.43271338 -0.89716079
## SAMULUN                        3.60350464 -0.02631579  7.43271338  1.33140887
## SAUJANA                       -0.79757794 -0.02631579  7.43271338 -0.28289699
## SELEGIE                        1.97282467 -0.02631579  7.43271338  0.73327962
## SELETAR                       -0.91834708 -0.02631579  7.43271338 -0.32719480
## SELETAR AEROSPACE PARK         1.12437653 -0.02631579  7.43271338  0.42207101
## SELETAR HILLS                 -0.30813076 -0.02631579  7.43271338 -0.10336901
## SEMBAWANG CENTRAL             -0.22943524 -0.02631579  7.43271338 -0.07450370
## SEMBAWANG EAST                -0.31833771 -0.02631579  7.43271338 -0.10711289
## SEMBAWANG HILLS               -1.11403936 -0.02631579  7.43271338 -0.39897423
## SEMBAWANG NORTH               -0.19155620 -0.02631579  7.43271338 -0.06060976
## SEMBAWANG SPRINGS             -0.49445579 -0.02631579  7.43271338 -0.17171256
## SEMBAWANG STRAITS             -1.02227223 -0.02631579  7.43271338 -0.36531428
## SENGKANG TOWN CENTRE           8.67591420 -0.02631579  7.43271338  3.19195576
## SENGKANG WEST                  2.28479768 -0.02631579  7.43271338  0.84771053
## SENJA                          0.09648908 -0.02631579  7.43271338  0.04504451
## SENNETT                        0.52602943 -0.02631579  7.43271338  0.20259882
## SENOKO NORTH                  -0.45538991 -0.02631579  7.43271338 -0.15738329
## SENOKO SOUTH                  -0.89549745 -0.02631579  7.43271338 -0.31881362
## SENOKO WEST                   -3.24059557 -0.02631579  7.43271338 -1.17898963
## SENTOSA                        1.57222995 -0.02631579  7.43271338  0.58634250
## SERANGOON CENTRAL              0.18975183 -0.02631579  7.43271338  0.07925305
## SERANGOON GARDEN               1.76094241 -0.02631579  7.43271338  0.65556175
## SERANGOON NORTH                0.85745044 -0.02631579  7.43271338  0.32416320
## SERANGOON NORTH IND ESTATE    -2.45658303 -0.02631579  7.43271338 -0.89141582
## SHANGRI-LA                     0.04763764 -0.02631579  7.43271338  0.02712593
## SHIPYARD                       3.80555256 -0.02631579  7.43271338  1.40551954
## SIGLAP                        -5.55954117 -0.02631579  7.43271338 -2.02957296
## SIMEI                         15.47847364 -0.02631579  7.43271338  5.68711722
## SINGAPORE GENERAL HOSPITAL     0.44040231 -0.02631579  7.43271338  0.17119101
## SINGAPORE POLYTECHNIC         -0.33386737 -0.02631579  7.43271338 -0.11280914
## SOMERSET                      -0.39249639 -0.02631579  7.43271338 -0.13431411
## SPRINGLEAF                     1.34842174 -0.02631579  7.43271338  0.50425022
## STRAITS VIEW                   4.46178137 -0.02631579  7.43271338  1.64622259
## SUNGEI ROAD                    1.10052419 -0.02631579  7.43271338  0.41332203
## SUNSET WAY                    -0.97210569 -0.02631579  7.43271338 -0.34691332
## SWISS CLUB                     0.66639066 -0.02631579  7.43271338  0.25408296
## TAGORE                         0.12616626 -0.02631579  7.43271338  0.05593003
## TAI SENG                      -0.03647951 -0.02631579  7.43271338 -0.00372803
## TAMAN JURONG                   1.29576437 -0.02631579  7.43271338  0.48493563
## TAMPINES EAST                 31.13435495 -0.02631579  7.43271338 11.42965455
## TAMPINES NORTH                -5.44390666 -0.02631579  7.43271338 -1.98715851
## TAMPINES WEST                 36.68440151 -0.02631579  7.43271338 13.46539747
## TANGLIN                        2.64238688 -0.02631579  7.43271338  0.97887333
## TANGLIN HALT                   0.40998039 -0.02631579  7.43271338  0.16003233
## TANJONG PAGAR                  3.02941660 -0.02631579  7.43271338  1.12083485
## TANJONG RHU                   -0.07421434 -0.02631579  7.43271338 -0.01756906
## TEBAN GARDENS                 -0.15583006 -0.02631579  7.43271338 -0.04750551
## TECK WHYE                      0.42731655 -0.02631579  7.43271338  0.16639118
## TELOK BLANGAH DRIVE           -0.14676699 -0.02631579  7.43271338 -0.04418119
## TELOK BLANGAH RISE             0.01407831 -0.02631579  7.43271338  0.01481645
## TELOK BLANGAH WAY             -0.49792096 -0.02631579  7.43271338 -0.17298357
## TENGAH                        -1.31176323 -0.02631579  7.43271338 -0.47149884
## TENGEH                         4.04380849 -0.02631579  7.43271338  1.49291120
## THE WHARVES                    1.56944907 -0.02631579  7.43271338  0.58532248
## TIONG BAHRU                    0.43964168 -0.02631579  7.43271338  0.17091201
## TIONG BAHRU STATION           -1.38082819 -0.02631579  7.43271338 -0.49683169
## TOA PAYOH CENTRAL              0.78269895 -0.02631579  7.43271338  0.29674454
## TOA PAYOH WEST                -1.10079539 -0.02631579  7.43271338 -0.39411638
## TOH GUAN                       0.03048442 -0.02631579  7.43271338  0.02083417
## TOH TUCK                       0.09078552 -0.02631579  7.43271338  0.04295246
## TOWNSVILLE                    -0.62605576 -0.02631579  7.43271338 -0.21998309
## TRAFALGAR                      2.68430065 -0.02631579  7.43271338  0.99424720
## TUAS BAY                       2.71752085 -0.02631579  7.43271338  1.00643228
## TUAS NORTH                     3.06679006 -0.02631579  7.43271338  1.13454334
## TUAS PROMENADE                 3.08249555 -0.02631579  7.43271338  1.14030407
## TUAS VIEW                      3.05403267 -0.02631579  7.43271338  1.12986396
## TUAS VIEW EXTENSION            3.98892388 -0.02631579  7.43271338  1.47277967
## TUKANG                        -2.58497098 -0.02631579  7.43271338 -0.93850820
## TURF CLUB                      0.22721918 -0.02631579  7.43271338  0.09299598
## TYERSALL                       2.02597185 -0.02631579  7.43271338  0.75277387
## ULU PANDAN                     1.02434736 -0.02631579  7.43271338  0.38538056
## UPPER PAYA LEBAR              -0.04041201 -0.02631579  7.43271338 -0.00517046
## UPPER THOMSON                  2.65278867 -0.02631579  7.43271338  0.98268868
## VICTORIA                      -0.34713167 -0.02631579  7.43271338 -0.11767445
## WATERWAY EAST                 -0.98047659 -0.02631579  7.43271338 -0.34998375
## WENYA                         -3.88732289 -0.02631579  7.43271338 -1.41620756
## WEST COAST                    -0.32615205 -0.02631579  7.43271338 -0.10997918
## WESTERN WATER CATCHMENT        2.05582483 -0.02631579  7.43271338  0.76372387
## WOODGROVE                     -0.08306680 -0.02631579  7.43271338 -0.02081613
## WOODLANDS EAST                 5.77517818 -0.02631579  7.43271338  2.12797319
## WOODLANDS REGIONAL CENTRE     16.09816954 -0.02631579  7.43271338  5.91442009
## WOODLANDS SOUTH                1.18518542 -0.02631579  7.43271338  0.44437555
## WOODLANDS WEST                 4.94683055 -0.02631579  7.43271338  1.82413739
## WOODLEIGH                      1.66363917 -0.02631579  7.43271338  0.61987117
## XILIN                         -7.08698701 -0.02631579  7.43271338 -2.58983620
## YEW TEE                        0.12334626 -0.02631579  7.43271338  0.05489566
## YIO CHU KANG                   0.00121495 -0.02631579  7.43271338  0.01009820
## YIO CHU KANG EAST             -0.06927511 -0.02631579  7.43271338 -0.01575737
## YIO CHU KANG NORTH             0.38946872 -0.02631579  7.43271338  0.15250870
## YIO CHU KANG WEST              0.03379906 -0.02631579  7.43271338  0.02204997
## YISHUN CENTRAL                 7.57077067 -0.02631579  7.43271338  2.78659194
## YISHUN EAST                    4.43231892 -0.02631579  7.43271338  1.63541584
## YISHUN SOUTH                   2.32369149 -0.02631579  7.43271338  0.86197667
## YISHUN WEST                    7.22975445 -0.02631579  7.43271338  2.66150806
## YUHUA EAST                     0.46338463 -0.02631579  7.43271338  0.17962086
## YUHUA WEST                     0.73535209 -0.02631579  7.43271338  0.27937784
## YUNNAN                         3.80691103 -0.02631579  7.43271338  1.40601782
##                               Pr.z...0.
## ADMIRALTY                        0.4169
## AIRPORT ROAD                     0.7249
## ALEXANDRA HILL                   0.6568
## ALEXANDRA NORTH                  0.4497
## ALJUNIED                         0.2973
## ANAK BUKIT                       0.6305
## ANCHORVALE                       0.3474
## ANG MO KIO TOWN CENTRE           0.2013
## ANSON                            0.1858
## BALESTIER                        0.1635
## BANGKIT                          0.4944
## BAYFRONT SUBZONE                 0.1341
## BAYSHORE                         0.9926
## BEDOK NORTH                      0.0000
## BEDOK RESERVOIR                  0.0697
## BEDOK SOUTH                      0.0000
## BENCOOLEN                        0.2108
## BENDEMEER                        0.4324
## BENOI SECTOR                     0.0848
## BIDADARI                         0.4604
## BISHAN EAST                      0.5173
## BOAT QUAY                        0.1591
## BOON KENG                        0.5323
## BOON LAY PLACE                   0.0500
## BOON TECK                        0.5530
## BOULEVARD                        0.9566
## BRADDELL                         0.6191
## BRAS BASAH                       0.4246
## BRICKWORKS                       0.5070
## BUGIS                            0.5665
## BUKIT BATOK CENTRAL              0.5728
## BUKIT BATOK EAST                 0.5196
## BUKIT BATOK SOUTH                0.5055
## BUKIT BATOK WEST                 0.5778
## BUKIT HO SWEE                    0.3594
## BUKIT MERAH                      0.5092
## CECIL                            0.1775
## CENTRAL SUBZONE                  0.1790
## CENTRAL WATER CATCHMENT          0.3994
## CHANGI AIRPORT                   0.6188
## CHANGI POINT                     0.5343
## CHANGI WEST                      0.9119
## CHATSWORTH                       0.2884
## CHENG SAN                        0.2352
## CHIN BEE                         0.9327
## CHINA SQUARE                     0.2383
## CHINATOWN                        0.5204
## CHOA CHU KANG CENTRAL            0.4741
## CHOA CHU KANG NORTH              0.5336
## CHONG BOON                       0.0741
## CITY HALL                        0.4978
## CITY TERMINALS                   0.2016
## CLARKE QUAY                      0.2523
## CLEMENTI CENTRAL                 0.9324
## CLEMENTI NORTH                   0.6124
## CLEMENTI WEST                    0.4978
## CLEMENTI WOODS                   0.4956
## CLIFFORD PIER                    0.1656
## COMMONWEALTH                     0.3468
## COMPASSVALE                      0.6359
## CORONATION ROAD                  0.3110
## CRAWFORD                         0.4360
## DAIRY FARM                       0.5044
## DEFU INDUSTRIAL PARK             0.5623
## DEPOT ROAD                       0.5352
## DHOBY GHAUT                      0.4708
## DOVER                            0.4440
## DUNEARN                          0.1700
## EAST COAST                       0.8526
## EVERTON PARK                     0.3373
## FABER                            0.4757
## FAJAR                            0.5077
## FARRER COURT                     0.1902
## FARRER PARK                      0.5803
## FERNVALE                         0.5183
## FLORA DRIVE                      0.8837
## FORT CANNING                     0.2045
## FRANKEL                          0.0000
## GALI BATU                        0.4442
## GEYLANG BAHRU                    0.5254
## GEYLANG EAST                     0.0004
## GHIM MOH                         0.3324
## GOMBAK                           0.5766
## GOODWOOD PARK                    0.2549
## GREENWOOD PARK                   0.9842
## GUILIN                           0.4958
## GUL BASIN                        0.0804
## GUL CIRCLE                       0.0954
## HENDERSON HILL                   0.4765
## HILLCREST                        0.1992
## HILLVIEW                         0.4816
## HOLLAND DRIVE                    0.3502
## HOLLAND ROAD                     0.5303
## HONG KAH                         0.3268
## HONG KAH NORTH                   0.4962
## HOUGANG CENTRAL                  0.0697
## HOUGANG EAST                     0.4838
## HOUGANG WEST                     0.0391
## INSTITUTION HILL                 0.1617
## INTERNATIONAL BUSINESS PARK      0.5539
## ISTANA NEGARA                    0.1764
## JELEBU                           0.7355
## JOO KOON                         0.5012
## JOO SENG                         0.4502
## JURONG GATEWAY                   0.5159
## JURONG PORT                      0.2802
## JURONG RIVER                     0.5150
## JURONG WEST CENTRAL              0.0967
## KAKI BUKIT                       0.0221
## KALLANG BAHRU                    0.4979
## KALLANG WAY                      0.6772
## KAMPONG BUGIS                    0.3650
## KAMPONG GLAM                     0.2905
## KAMPONG JAVA                     0.3575
## KAMPONG TIONG BAHRU              0.4524
## KAMPONG UBI                      0.0234
## KANGKAR                          0.4711
## KATONG                           0.6946
## KEAT HONG                        0.3912
## KEBUN BAHRU                      0.5128
## KEMBANGAN                        0.0002
## KENT RIDGE                       0.3458
## KHATIB                           0.2906
## KIAN TECK                        0.7036
## KIM KEAT                         0.5760
## KOVAN                            0.3328
## KRANJI                           0.7133
## LAKESIDE                         0.6051
## LAVENDER                         0.6763
## LEEDON PARK                      0.2404
## LEONIE HILL                      0.2394
## LIM CHU KANG                     0.4214
## LITTLE INDIA                     0.2351
## LIU FANG                         0.2190
## LORONG 8 TOA PAYOH               0.4960
## LORONG AH SOO                    0.0560
## LORONG CHUAN                     0.7300
## LORONG HALUS                     0.6750
## LOWER SELETAR                    0.6906
## LOYANG EAST                      0.9786
## LOYANG WEST                      0.9184
## MACKENZIE                        0.1790
## MACPHERSON                       0.2395
## MALCOLM                          0.4378
## MANDAI EAST                      0.8843
## MANDAI ESTATE                    0.9587
## MANDAI WEST                      0.9849
## MARGARET DRIVE                   0.3823
## MARINA CENTRE                    0.3869
## MARINA EAST (MP)                 0.4947
## MARINA SOUTH                     0.1009
## MARINE PARADE                    0.2917
## MARITIME SQUARE                  0.6154
## MARYMOUNT                        0.3038
## MATILDA                          0.1399
## MAXWELL                          0.1138
## MEI CHIN                         0.4668
## MIDVIEW                          0.2187
## MONK'S HILL                      0.3311
## MOULMEIN                         0.5433
## MOUNT PLEASANT                   0.4720
## MOUNTBATTEN                      0.6878
## NASSIM                           0.3302
## NATIONAL UNIVERSITY OF S'PORE    0.4152
## NATURE RESERVE                   0.4571
## NEE SOON                         0.8078
## NEWTON CIRCUS                    0.3286
## NORTH COAST                      0.0000
## NORTHLAND                        0.3207
## NORTHSHORE                       0.8976
## ONE NORTH                        0.4876
## ONE TREE HILL                    0.2226
## ORANGE GROVE                     0.1488
## OXLEY                            0.1827
## PANDAN                           0.5804
## PANG SUA                         0.5191
## PASIR PANJANG 1                  0.4530
## PASIR PANJANG 2                  0.3506
## PASIR RIS CENTRAL                0.0002
## PASIR RIS DRIVE                  0.0067
## PASIR RIS PARK                   0.9129
## PASIR RIS WAFER FAB PARK         0.6359
## PASIR RIS WEST                   0.1516
## PATERSON                         0.2247
## PAYA LEBAR EAST                  0.6027
## PAYA LEBAR NORTH                 0.2955
## PAYA LEBAR WEST                  0.4676
## PEARL'S HILL                     0.3452
## PEI CHUN                         0.4908
## PENG SIANG                       0.4811
## PENJURU CRESCENT                 0.3623
## PEOPLE'S PARK                    0.4221
## PHILLIP                          0.1029
## PIONEER SECTOR                   0.0843
## PLAB                             0.2160
## PORT                             0.2918
## POTONG PASIR                     0.4308
## PUNGGOL FIELD                    0.3715
## PUNGGOL TOWN CENTRE              0.8126
## QUEENSWAY                        0.3306
## RAFFLES PLACE                    0.0805
## REDHILL                          0.4800
## RESERVOIR VIEW                   0.4285
## RIDOUT                           0.2083
## RIVERVALE                        0.0703
## ROBERTSON QUAY                   0.2445
## ROCHOR CANAL                     0.2885
## SAFTI                            0.8152
## SAMULUN                          0.0915
## SAUJANA                          0.6114
## SELEGIE                          0.2317
## SELETAR                          0.6282
## SELETAR AEROSPACE PARK           0.3365
## SELETAR HILLS                    0.5412
## SEMBAWANG CENTRAL                0.5297
## SEMBAWANG EAST                   0.5427
## SEMBAWANG HILLS                  0.6550
## SEMBAWANG NORTH                  0.5242
## SEMBAWANG SPRINGS                0.5682
## SEMBAWANG STRAITS                0.6426
## SENGKANG TOWN CENTRE             0.0007
## SENGKANG WEST                    0.1983
## SENJA                            0.4820
## SENNETT                          0.4197
## SENOKO NORTH                     0.5625
## SENOKO SOUTH                     0.6251
## SENOKO WEST                      0.8808
## SENTOSA                          0.2788
## SERANGOON CENTRAL                0.4684
## SERANGOON GARDEN                 0.2561
## SERANGOON NORTH                  0.3729
## SERANGOON NORTH IND ESTATE       0.8136
## SHANGRI-LA                       0.4892
## SHIPYARD                         0.0799
## SIGLAP                           0.9788
## SIMEI                            0.0000
## SINGAPORE GENERAL HOSPITAL       0.4320
## SINGAPORE POLYTECHNIC            0.5449
## SOMERSET                         0.5534
## SPRINGLEAF                       0.3070
## STRAITS VIEW                     0.0499
## SUNGEI ROAD                      0.3397
## SUNSET WAY                       0.6357
## SWISS CLUB                       0.3997
## TAGORE                           0.4777
## TAI SENG                         0.5015
## TAMAN JURONG                     0.3139
## TAMPINES EAST                    0.0000
## TAMPINES NORTH                   0.9765
## TAMPINES WEST                    0.0000
## TANGLIN                          0.1638
## TANGLIN HALT                     0.4364
## TANJONG PAGAR                    0.1312
## TANJONG RHU                      0.5070
## TEBAN GARDENS                    0.5189
## TECK WHYE                        0.4339
## TELOK BLANGAH DRIVE              0.5176
## TELOK BLANGAH RISE               0.4941
## TELOK BLANGAH WAY                0.5687
## TENGAH                           0.6814
## TENGEH                           0.0677
## THE WHARVES                      0.2792
## TIONG BAHRU                      0.4321
## TIONG BAHRU STATION              0.6903
## TOA PAYOH CENTRAL                0.3833
## TOA PAYOH WEST                   0.6533
## TOH GUAN                         0.4917
## TOH TUCK                         0.4829
## TOWNSVILLE                       0.5871
## TRAFALGAR                        0.1601
## TUAS BAY                         0.1571
## TUAS NORTH                       0.1283
## TUAS PROMENADE                   0.1271
## TUAS VIEW                        0.1293
## TUAS VIEW EXTENSION              0.0704
## TUKANG                           0.8260
## TURF CLUB                        0.4630
## TYERSALL                         0.2258
## ULU PANDAN                       0.3500
## UPPER PAYA LEBAR                 0.5021
## UPPER THOMSON                    0.1629
## VICTORIA                         0.5468
## WATERWAY EAST                    0.6368
## WENYA                            0.9216
## WEST COAST                       0.5438
## WESTERN WATER CATCHMENT          0.2225
## WOODGROVE                        0.5083
## WOODLANDS EAST                   0.0167
## WOODLANDS REGIONAL CENTRE        0.0000
## WOODLANDS SOUTH                  0.3284
## WOODLANDS WEST                   0.0341
## WOODLEIGH                        0.2677
## XILIN                            0.9952
## YEW TEE                          0.4781
## YIO CHU KANG                     0.4960
## YIO CHU KANG EAST                0.5063
## YIO CHU KANG NORTH               0.4394
## YIO CHU KANG WEST                0.4912
## YISHUN CENTRAL                   0.0027
## YISHUN EAST                      0.0510
## YISHUN SOUTH                     0.1944
## YISHUN WEST                      0.0039
## YUHUA EAST                       0.4287
## YUHUA WEST                       0.3900
## YUNNAN                           0.0799

Mapping Local Moran’s I values and p-values for Tap Out

The red zones on the left map and the dark blue zones on the right map indicate the subzones responsible for the clusters.

new_overall.localMI2 <- cbind(new_overall, localMI2)

localMI2.map <- tm_shape(new_overall.localMI2) +
  tm_fill(col = "Ii", 
          breaks = c(-Inf, -5, 10, Inf),
          palette = "-RdBu",
          title = "local Moran's I statistics") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.position = c("RIGHT", "BOTTOM"))

pvalue.map <- tm_shape(new_overall.localMI2) +
  tm_fill(col = "Pr.z...0.", 
          breaks=c(-Inf, 0.05, Inf),
          palette="-Blues", 
          title = "local Moran's I p-values") +
  tm_borders(alpha = 0.5) + 
  tm_layout(legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(localMI2.map, pvalue.map, asp = 1, ncol = 2)

Spatially lagged Tap Out values

TAP_OUT.lag <- lag.listw(rswm_knn8, new_overall$TAP_OUT)
TAP_OUT.lag
##   [1]  2289401  3987285  2006909  2839789  3252319  2511011  5273948  3717216
##   [9]  1490427  3731967  3069444  1053980  7480573  6000923  8476530  7436300
##  [17]  1535837  3348510   779656  2869637  2993041   960415  4158088  6525117
##  [25]  4158885   871048  4485587  2004077  3266874  1507921  2831454  3305803
##  [33]  3533648  4316143  1987746  2234066   867905   758472  1298480  2612084
##  [41]  3246823  6328602  1109803  4055098  6043145  1200377   960297  3076283
##  [49]  3702263  4723559  1675889  1464052  1388630  2005633  2536968  3202036
##  [57]  3214812  1139133  1809588  6461055  1513076  2066129  3074336  3582311
##  [65]  3240224  1411742  2086565  1130333  4597497  1574210  2926645  3165565
##  [73]  1256893  1269176  2526014  6962639  1445786  7198053  2524642  3945790
##  [81]  5002051  1877199  3611569  1935935  7087524  3018788   666685   736270
##  [89]  2319638  1240995  2645702  1711775  1900111  3309386  3119209  4330668
##  [97]  5089233  4904078  1346952  3278334  1653962  2554244  4016379  2603492
## [105]  2992910  2025310  3124578  3364559  4804725  2315247  4366235  2235507
## [113]  2038149  1747900  2572120  6120897  3637226  6651466  4363955  3706273
## [121]  8126364  2319750  3803380  4344694  3404990  6459115  4760133  4005176
## [129]  1654008  1500370  1859121  2743038  1871402  1640662  2496402  4504089
## [137]  4194561  3724547  4404995  6432105  6335205  1301132  5103322  2567910
## [145]  5184465  5739513  6328115  2046202  2055615  3027125  1111364  3856273
## [153]  2643032  4449357  3995630  1153668  2041763  6673384  2383236  2261941
## [161]  2926796  4407032  1449739  2258204  2826650  4501019  1888181  6027175
## [169]  4888390  4981245  1727897  1668313  1441284  1607379  3413180  3121592
## [177]  1711489  2138777  5936653  5590372  6744076  3686944  6172696  1683218
## [185]  3449739  1906464  2921431  1728992  2972584  3344571  2408654  1192256
## [193]  1127507   903062  1842121  1940690  2155742  3867286  4885662  2178929
## [201]   778938  2596945  2753826  1308787  4514036  1023124  2042813  4396408
## [209]   834603  4096324  1713179  3874069  2339081  3359736  2912786  3430682
## [217]  3959943  1870218  3519213  3621888  4665647  1740761  4122890  2121365
## [225]  3457892  3871411  5864047  2111199  3077521  4318819  4948904  5005998
## [233]  4384347   859111  6957098 10146964  2512499  3478599  1401592  2180265
## [241]   556139  2141047  3651375  1948778  2922294  3164159  3407368  4972955
## [249]  8092886  9207701  1525932  1740300  1300687  3108509  2747469  4251469
## [257]  2696325  3000118  3569939  3875918   821806  2144888  2392458  2104394
## [265]  3177907  5342472  3679354  2864241  5937183  4190611   834033   822575
## [273]   824244   498919   604363  4728211  2494397  1107810  2239402  3296953
## [281]  4238076  1190261  4658062  6981215  3259042  6280100  4373834  3969435
## [289]  5400621  5481320  4540169  1746997 11036414  3157567  3034207  3098345
## [297]  2764008  2830913  4348599  5138934  5188771  4657827  3768576  4131017
## [305]  4059399
new_overall$TAP_OUT_lag <- TAP_OUT.lag

Plotting Tap Out values alongside Tap Out lag values

tap_out <- tm_shape(new_overall) +
          tm_fill(col = "TAP_OUT",
                  n = 6,
                  style = "equal",
                  palette = "Reds") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tap_out_lag <- tm_shape(new_overall) +
          tm_fill(col = "TAP_OUT_lag",
                  n = 6 ,
                  style = "equal",
                  palette = "Blues") +
          tm_borders(alpha = 0.5)+
          tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(tap_out, tap_out_lag, asp = 1, ncol = 2)

Plotting Moran scatterplot as standardised variables

new_overall$Z.TAP_OUT <- scale(new_overall$TAP_OUT) %>% as.vector()

nci3 <- moran.plot(new_overall$Z.TAP_OUT, rswm_knn8, labels = as.character(new_overall$SUBZONE_N), xlab = "z-TAP_OUT", ylab = "Spatially Lag z-TAP_OUT")

Creating the quadrants

quadrant2 <- vector(mode="numeric",length=nrow(localMI2))

DV2 <- new_overall$TAP_OUT

C_mI2 <- new_overall$TAP_OUT_lag

signif <- 0.05       
quadrant2[DV2 >0 & C_mI2>0] <- 4      
quadrant2[DV2 <0 & C_mI2<0] <- 1      
quadrant2[DV2 <0 & C_mI2>0] <- 2
quadrant2[DV2 >0 & C_mI2<0] <- 3
quadrant2[localMI2[,5]>signif] <- 0

Mapping LISA Cluster

new_overall.localMI2$quadrant2 <- quadrant2
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")

tm_shape(new_overall.localMI2) +
  tm_fill(col = "quadrant2", style = "cat", palette = colors[c(sort(unique(quadrant2)))+1], labels = clusters[c(sort(unique(quadrant2)))+1], popup.vars = c("SUBZONE_N")) +
  tm_view(set.zoom.limits = c(11,17)) +
  tm_borders(alpha=0.5)+
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

Hot Spot and Cold Spot Area Analysis

Create adaptive proximity matrix

coords <- st_centroid(new_overall)
## Warning in st_centroid.sf(new_overall): st_centroid assumes attributes are
## constant over geometries of x
knb2 <- knn2nb(knearneigh(coords, k = 8, longlat = FALSE), row.names = row.names(new_overall$TAP_OUT))
## Warning in knearneigh(coords, k = 8, longlat = FALSE): dnearneigh: longlat
## argument overrides object
knb_lw2 <- nb2listw(knb, style = 'B')

summary(knb_lw2)
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 305 
## Number of nonzero links: 2440 
## Percentage nonzero weights: 2.622951 
## Average number of links: 8 
## Non-symmetric neighbours list
## Link number distribution:
## 
##   8 
## 305 
## 305 least connected regions:
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 with 8 links
## 305 most connected regions:
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 with 8 links
## 
## Weights style: B 
## Weights constants summary:
##     n    nn   S0   S1    S2
## B 305 93025 2440 4412 79922

Plotting the subzones and their neighbours

plot(new_overall$geometry, border = "lightgrey")
plot(knb, st_centroid(new_overall$geometry), pch = 19, cex = 0.6, add = TRUE, col = "red")

Gi stats using adaptive distance

fips <- order(new_overall$SUBZONE_N)

gi.adaptive2 <- localG(new_overall$TAP_OUT, knb_lw2)

new_overall.gi2 <- cbind(new_overall, as.matrix(gi.adaptive2))

names(new_overall.gi2)[8] <- "gstat_adaptive2"

Mapping out the hot and cold spots

tm_shape(new_overall.gi2) +
  tm_fill(col = "gstat_adaptive2",
          style = "equal",
          palette = "-RdBu",
          title = "local Gi") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

Tap In vs Tap Out LISA Cluster Mapping

The Tap In and Tap Out maps share similar clustering patterns below

tap_in <- tm_shape(new_overall.localMI) +
  tm_fill(col = "quadrant", style = "cat", palette = colors[c(sort(unique(quadrant)))+1], labels = clusters[c(sort(unique(quadrant)))+1], popup.vars = c("SUBZONE_N")) +
  tm_view(set.zoom.limits = c(11,17)) +
  tm_borders(alpha=0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM")) 

tap_out <- tm_shape(new_overall.localMI2) +
  tm_fill(col = "quadrant2", style = "cat", palette = colors[c(sort(unique(quadrant2)))+1], labels = clusters[c(sort(unique(quadrant2)))+1], popup.vars = c("SUBZONE_N")) +
  tm_view(set.zoom.limits = c(11,17)) +
  tm_borders(alpha=0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(tap_in, tap_out, asp = 1, ncol = 2)

Tap In vs Tap Out Hot and Cold Spot Analysis

The Tap In and Tap Out maps have similar outliers as indicated by the hotspots below

tap_in <- tm_shape(new_overall.gi) +
  tm_fill(col = "gstat_adaptive",
          style = "pretty",
          palette = "-RdBu",
          title = "local Gi") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tap_out <- tm_shape(new_overall.gi2) +
  tm_fill(col = "gstat_adaptive2",
          style = "pretty",
          palette = "-RdBu",
          title = "local Gi") +
  tm_borders(alpha = 0.5) +
  tm_layout(legend.width = 0.5, legend.position = c("RIGHT", "BOTTOM"))

tmap_arrange(tap_in, tap_out, asp = 1, ncol = 2)