Overview

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.

The first null hypothesis is that the Tap In vs Population regression model conforms to the randomization assumption
The alternate hypothesis is that the Tap In vs Population regression model does not conform to the randomization assumption

The second null hypothesis is that the Tap Out vs Population regression model conforms to the randomization assumption
The alternate hypothesis is that the Tap In vs Population regression model does not conform to the randomization assumption
Confidence interval: 95%

Setting up: Installing and Launching R packages

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

Importing data

passenger_vol <- read_csv("data/aspatial/passenger volume by busstop.csv")

The busstop shapefile is downloaded from the LTA datamall which can be downloaded via https://www.mytransport.sg/content/dam/datamall/datasets/Geospatial/BusStopLocation.zip This dataset consist of the bus stop numbers in Singapore and its respective point coordinate.

busstop <- st_read(dsn = "data/geospatial/BusStopLocation/BusStopLocation_Jan2020", layer = "BusStop")
## Reading layer `BusStop' from data source `C:\Year 3\term 3\gis\Take hom assignments\Take-home_Ex01\data\geospatial\BusStopLocation\BusStopLocation_Jan2020' 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
## epsg (SRID):    NA
## 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


The residential population data is obtained from singstat and can be downloaded via https://www.singstat.gov.sg/find-data/search-by-theme/population/geographic-distribution/latest-data This dataset consists of the residential population by subzone from 2011 to 2019, with 2019 being the most updated data.

residents <- read_csv("data/aspatial/Singapore Residents by Planning AreaSubzone Age Group Sex and Type of Dwelling June 20112019/respopagesextod2011to2019.csv")


The subzone dataset is obtained frmo datagov.sg and can be downloaded via https://data.gov.sg/dataset/subzone-census-2010 This dataset consists of the subzones in Singapore with its respective polygon geometry.

subzone <- st_read(dsn = "data/geospatial/master-plan-2014-subzone-boundary-web/master-plan-2014-subzone-boundary-web-shp", layer = "MP14_SUBZONE_WEB_PL")
## Reading layer `MP14_SUBZONE_WEB_PL' from data source `C:\Year 3\term 3\gis\Take hom assignments\Take-home_Ex01\data\geospatial\master-plan-2014-subzone-boundary-web\master-plan-2014-subzone-boundary-web-shp' 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
## epsg (SRID):    NA
## 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

Data Manipulation

Check crs and input for the 2 spatial maps

st_crs(subzone)
## Coordinate Reference System:
##   No EPSG code
##   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"


As seen from the Coordinate Reference System, there is no epsg code. Hence, we set the crs to Singapore’s EPSG code which is 3414.

subzone3414 <- st_transform(subzone,3414)
st_crs(busstop)
## Coordinate Reference System:
##   No EPSG code
##   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"


Similar to the subzoone data, there is no epsg code for the busstop data. Hence, we set the crs 3414 as well.

busstop3414 <- st_set_crs(busstop,3414)

Check for unique busstop codes to ensure there are no multi joining of passenger data to the busstop point coordinate data

Count number of rows for each BUS_STOP_N

count_busstop <- busstop3414 %>%
  group_by(BUS_STOP_N)%>%
  tally()
count_busstop
## Simple feature collection with 5034 features and 2 fields
## geometry type:  GEOMETRY
## dimension:      XY
## bbox:           xmin: 4427.938 ymin: 26482.1 xmax: 48282.5 ymax: 52983.82
## epsg (SRID):    3414
## proj4string:    +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs
## # A tibble: 5,034 x 3
##    BUS_STOP_N     n            geometry
##  * <fct>      <int>         <POINT [m]>
##  1 01012          1  (30140.8 31031.95)
##  2 01013          1 (30218.75 31126.49)
##  3 01019          1 (30187.77 31034.55)
##  4 01029          1 (30345.83 31007.64)
##  5 01039          1 (30471.08 31175.63)
##  6 01059          1 (30570.37 31494.55)
##  7 01109          1 (30603.56 31759.58)
##  8 01112          1 (30434.46 31386.45)
##  9 01113          1 (30542.33 31509.91)
## 10 01119          1 (30422.02 31320.02)
## # ... with 5,024 more rows

Filter to those with more than 1

count_morethan1_busstop <- count_busstop %>%
  filter(n>1)
count_morethan1_busstop
## Simple feature collection with 6 features and 2 fields
## geometry type:  MULTIPOINT
## dimension:      XY
## bbox:           xmin: 28300.11 ymin: 34460.06 xmax: 35245.61 ymax: 43320.34
## epsg (SRID):    3414
## proj4string:    +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs
## # A tibble: 6 x 3
##   BUS_STOP_N     n                               geometry
## * <fct>      <int>                       <MULTIPOINT [m]>
## 1 51071          2  (28300.11 36045.9, 28305.37 36036.67)
## 2 52059          2  (30566.62 36131.26, 30770.3 34460.06)
## 3 65331          2 (34709.62 42698.59, 35245.61 42735.63)
## 4 65339          2  (34708.61 42675.41, 35206.23 42785.7)
## 5 68091          2 (32038.84 43298.68, 32164.11 42695.98)
## 6 68099          2  (32004.05 43320.34, 32154.9 42742.82)

Join back to busstop to obtain the other fields

morethan1 <- st_join(count_morethan1_busstop,busstop3414)
view(morethan1)


As seen from above, the data of the geometry is the same for the duplicate BUS_STOP_N codes despite the different namings of the LOC_DESC. Hence, we obtain the distinct busstop code and geometry before proceeding to join the data.

busstop_distinct <- count_busstop [1]
busstop_distinct
## Simple feature collection with 5034 features and 1 field
## geometry type:  GEOMETRY
## dimension:      XY
## bbox:           xmin: 4427.938 ymin: 26482.1 xmax: 48282.5 ymax: 52983.82
## epsg (SRID):    3414
## proj4string:    +proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs
## # A tibble: 5,034 x 2
##    BUS_STOP_N            geometry
##    <fct>              <POINT [m]>
##  1 01012       (30140.8 31031.95)
##  2 01013      (30218.75 31126.49)
##  3 01019      (30187.77 31034.55)
##  4 01029      (30345.83 31007.64)
##  5 01039      (30471.08 31175.63)
##  6 01059      (30570.37 31494.55)
##  7 01109      (30603.56 31759.58)
##  8 01112      (30434.46 31386.45)
##  9 01113      (30542.33 31509.91)
## 10 01119      (30422.02 31320.02)
## # ... with 5,024 more rows

Sum all tap in and tap out data by PT_Code

passenger_vol_sum <- passenger_vol %>%
    group_by(PT_CODE)%>%
  summarise(TOTAL_TAP_IN_VOLUME=sum(TOTAL_TAP_IN_VOLUME), TOTAL_TAP_OUT_VOLUME=sum(TOTAL_TAP_OUT_VOLUME))

Obtain sum of population by subzone in 2019

Sum all residents by area and filter by year first

residents_2019 <- residents %>%
  filter(Time == 2019) %>%
  group_by(PA, SZ)%>%
  summarise(Pop=sum(Pop))

Join busstop tap in data to busstop to get busstop point coordinates

We perform a left join as we would only like to include busstops with point coordinates within Singapore.

busstop_passenger<- left_join(busstop_distinct, passenger_vol_sum, by = c("BUS_STOP_N" = "PT_CODE"))


In the case that there are busstops with no tap in and tap out data, we treat the NA values as 0 as this indicates that there are no passengers activity (tap in/tap out) at that paticular busstop. Thus, we replace all NA values with 0.

busstop_passenger[is.na(busstop_passenger)] = 0

Join busstop_passenger to obtain subzone by checking which polygon contains the point

bustop_passenger_subzone <- st_join(subzone3414, busstop_passenger, join = st_contains)


As some busstops may not be within the subzone are (out of singapore boundaries such as jb busstop), we exclude those with NA. Also, those subzones with no busstops, we omit those from the analysis as well as it is not relevant in analsying commuters’ flow when there is no busstop.

bustop_passenger_subzone_o<- na.omit(bustop_passenger_subzone)

Change the subzone to uppercase to join to subzone

residents2 <- mutate_all(residents, funs(toupper))

residents2 <-residents_2019%>%mutate(SZ = toupper(SZ))
view(residents2)

Join residents population data to subzone to get geometry polygon

resident_subzone<- full_join(subzone3414, residents2, by = c("SUBZONE_N"="SZ"))
tmap_mode("view")

Remove point from bustop_passenger_subzone. Join by subzone name to resident data

bustop_passenger_subzone_n <- subset(as.data.frame(bustop_passenger_subzone_o),select=-c(geometry))

Join data: bustop_passenger_subzone_polygon and resident_subzone

Sum up tap in bustop_passenger_subzone_polygon

bustop_passenger_subzone_n_tap <- bustop_passenger_subzone_n  %>%
  group_by(SUBZONE_N,SUBZONE_C)%>%
  summarise(TOTAL_TAP_IN_VOLUME=sum(TOTAL_TAP_IN_VOLUME),TOTAL_TAP_OUT_VOLUME=sum(TOTAL_TAP_OUT_VOLUME))
bustop_passenger_subzone_n_tap
## # A tibble: 305 x 4
## # Groups:   SUBZONE_N [305]
##    SUBZONE_N              SUBZONE_C TOTAL_TAP_IN_VOLUME TOTAL_TAP_OUT_VOLU~
##    <fct>                  <fct>                   <dbl>               <dbl>
##  1 ADMIRALTY              SBSZ05                 178509              228889
##  2 AIRPORT ROAD           PLSZ04                  22692               24524
##  3 ALEXANDRA HILL         BMSZ07                 497549              603813
##  4 ALEXANDRA NORTH        BMSZ06                  59359               41292
##  5 ALJUNIED               GLSZ04                1613882             1704099
##  6 ANAK BUKIT             BTSZ01                 799579              745657
##  7 ANCHORVALE             SESZ04                 472053              474260
##  8 ANG MO KIO TOWN CENTRE AMSZ01                1100348             1052820
##  9 ANSON                  DTSZ10                  73701               59522
## 10 BALESTIER              NVSZ01                 979175              979036
## # ... with 295 more rows

Join bustop_passenger_subzone_polygon_tapin and resident_subzone

We perform an inner join as previously we have already omitted the polygons that have do not contain any busstop point coordinate. Hence, we perform an inner join to analyse the subzones with busstop point coordinates and whereby these coordinates lie within the singapore subzone.

passenger_resident_tap <- inner_join(resident_subzone,bustop_passenger_subzone_n_tap,  by = c("SUBZONE_N"="SUBZONE_N"))

The 3 choropleth graphs below shows:
1. Population by Subzone
2. Tap in by Subzone
3. Tap Out by Subzone

res.map <- tm_shape(passenger_resident_tap) + 
tm_polygons("Pop",palette = "Blues" ,id="SZ", title = "Population by Subzone", border.col = "grey", id=subzone, auto.palette.mapping = FALSE, n=8, style="jenks" , alpha = 0.9)

in.map<- tm_shape(passenger_resident_tap) + 
tm_polygons("TOTAL_TAP_IN_VOLUME",palette = "Reds" ,id="SZ", title = "Tap In by Subzone", border.col = "grey", auto.palette.mapping = FALSE, style="quantile" , alpha = 0.9)

out.map<- tm_shape(passenger_resident_tap) + 
tm_polygons("TOTAL_TAP_OUT_VOLUME",palette = "Greens" ,id="SZ", title = "Tap Out by Subzone", border.col = "grey", auto.palette.mapping = FALSE, style="quantile" , alpha = 0.9)


tmap_arrange(res.map, in.map, out.map, asp=1, ncol=3, sync = TRUE)


As there are some subzones with a recorded value of 0 residents, Hence, let’s plot a scatterplot to see the distribution of those subzones with 0. Those with a population of 0 are marked in red. The sctterplot below displays the Tap In vs population

plot(passenger_resident_tap$Pop, passenger_resident_tap$TOTAL_TAP_IN_VOLUME, col= ifelse(passenger_resident_tap$Pop ==0, "red", "black"))


The sctterplot below displays the Tap Out vs population

plot(passenger_resident_tap$Pop, passenger_resident_tap$TOTAL_TAP_OUT_VOLUME, col= ifelse(passenger_resident_tap$Pop ==0, "red", "black"))


passenger_resident_tap.s1 <- passenger_resident_tap[passenger_resident_tap$Pop ==0,]
view(passenger_resident_tap.s1)


Lets compare on the map to see how the data is affected when we remove those wth 0 population.

passenger_resident_tap_o <- passenger_resident_tap[passenger_resident_tap$Pop != 0, ]


omitted.map <- tm_shape(passenger_resident_tap_o) +
  tm_fill(col = "Pop", 
          palette="-Blues", 
          id = "SUBZONE_N",
          title = "Residual Values") +
  tm_borders(alpha = 0.5)

notomit.map <- tm_shape(passenger_resident_tap) +
  tm_fill(col = "Pop", 
          palette="-Blues", 
          id = "SUBZONE_N",
          title = "Residual Values") +
  tm_borders(alpha = 0.5)

tmap_arrange(notomit.map, omitted.map, asp=1, ncol=2, sync = TRUE)


As seen above, most of the subzone areas are non-residential. There are also some which are such as paya lebar. As we are anlsysing the relationship between the residential population and the commuters’ flow, the subzones with 0 population will not be relevant as no matter how many commuters there are, the population remains 0, which there are no relationnship. If the government/LTA would simply like to analyse which areas have a volume, they can simply use look at the commuters’ flow data. However, if we simply use those with population 0 in the analysis, it shows 0 reationship. Hence, we remove those with 0 population.

Linear Regression Modelling

The scatterplot on the left below shows the relatioship and correlation between Total tap in volume and population, and the scatterplot on the right shows the relationship between total tap out volume and population.

pop_tapin_corr <- round(cor(passenger_resident_tap_o$Pop, passenger_resident_tap_o$TOTAL_TAP_IN_VOLUME),digits=4)
pop_tapout_corr <- round(cor(passenger_resident_tap_o$Pop, passenger_resident_tap_o$TOTAL_TAP_OUT_VOLUME),digits=4)

tapin_scatter <- ggplot(passenger_resident_tap_o, aes(x = Pop, y = TOTAL_TAP_IN_VOLUME)) +
  geom_point() +
  labs(x="Poplation", y= "Total Tap In Volume",
       title="Tap in volume vs population by Subzone", subtitle=paste("Correlation: ", pop_tapin_corr))+
  stat_smooth()

tapout_scatter <- ggplot(passenger_resident_tap_o, aes(x = Pop, y = TOTAL_TAP_OUT_VOLUME)) +
  geom_point() +
  labs(x="Poplation", y= "Total Tap Out Volume",
       title="Tap in volume vs population by Subzone", subtitle= paste("Correlation: ", pop_tapout_corr))+
  stat_smooth()
 

grid.arrange(tapin_scatter, tapout_scatter, ncol=2)

LM model for Tap in vs Population

model <- lm(Pop ~ TOTAL_TAP_IN_VOLUME, data = passenger_resident_tap_o)
model
## 
## Call:
## lm(formula = Pop ~ TOTAL_TAP_IN_VOLUME, data = passenger_resident_tap_o)
## 
## Coefficients:
##         (Intercept)  TOTAL_TAP_IN_VOLUME  
##           3.471e+03            3.053e-02


summary(model)
## 
## Call:
## lm(formula = Pop ~ TOTAL_TAP_IN_VOLUME, data = passenger_resident_tap_o)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -45970  -5632   -902   5229  48953 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         3.471e+03  1.107e+03   3.134  0.00195 ** 
## TOTAL_TAP_IN_VOLUME 3.053e-02  1.675e-03  18.229  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12240 on 230 degrees of freedom
## Multiple R-squared:  0.591,  Adjusted R-squared:  0.5892 
## F-statistic: 332.3 on 1 and 230 DF,  p-value: < 2.2e-16


ggplot(passenger_resident_tap_o, aes(Pop, TOTAL_TAP_IN_VOLUME)) +
  geom_point() +
  stat_smooth(method = lm)


In a lineaer model, there are we need to check if the assumptions are true:
1. Linearity: The relationship between X and the mean of Y is linear.
2. Homoscedasticity: The variance of residual is the same for any value of X.
3. Independence: Observations are independent of each other.
4. Normality: For any fixed value of X, Y is normally distributed.

lm_model <- autoplot(lm(Pop ~ TOTAL_TAP_IN_VOLUME, data = passenger_resident_tap_o), label.size = 3)
lm_model


The above shows 4 charts:
1. Residuals vs Fitted. Used to check the linear relationship assumptions. The blue line for this graph deos not show any distinct patterns. Hence, there is an indication for a possible linear relationship.
2. Normal Q-Q. Used to examine whether the residuals are normally distributed. It’s good if residuals points follow the straight dashed line. As seen from the Normal Q-Q graph, the datapoints do follow the direction of the dotted line, however not all datapoints fall on the line.
3. Scale-Location (or Spread-Location). Used to check the homogeneity of variance of the residuals (homoscedasticity). Horizontal line with equally spread points is a good indication of homoscedasticity. This is not the case in our example, where we have a heteroscedasticity problem. It can be seen that the variability (variances) of the residual points increases with the value of the fitted outcome variable, suggesting non-constant variances in the residuals errors (or heteroscedasticity).A way to solve it is to reduce the heteroscedasticity problem is to use a log or square root transformation of the outcome variable (y).
4. Residuals vs Leverage. Used to identify influential cases, that is extreme values that might influence the regression results when included or excluded from the analysis. This plot will be described further in the next sections.

To further analyse on the Residuals vs Leverage

# Cook's distance
plot(model, 4, id.n = 5)

# Residuals vs Leverage
plot(model, 5)


As seen from above, the extreme values do not present any influential points. Cook’s distance lines (a red dashed line) are not shown on the Residuals vs Leverage plot because all points are well inside of the Cook’s distance lines.

LM model for Tap out vs Population

model_out <- lm(Pop ~ TOTAL_TAP_OUT_VOLUME, data = passenger_resident_tap_o)
model_out
## 
## Call:
## lm(formula = Pop ~ TOTAL_TAP_OUT_VOLUME, data = passenger_resident_tap_o)
## 
## Coefficients:
##          (Intercept)  TOTAL_TAP_OUT_VOLUME  
##            3.298e+03             3.094e-02


summary(model_out)
## 
## Call:
## lm(formula = Pop ~ TOTAL_TAP_OUT_VOLUME, data = passenger_resident_tap_o)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -49412  -5659   -866   4951  44585 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          3.298e+03  1.106e+03   2.983  0.00316 ** 
## TOTAL_TAP_OUT_VOLUME 3.095e-02  1.682e-03  18.403  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12170 on 230 degrees of freedom
## Multiple R-squared:  0.5956, Adjusted R-squared:  0.5938 
## F-statistic: 338.7 on 1 and 230 DF,  p-value: < 2.2e-16


ggplot(passenger_resident_tap_o, aes(Pop, TOTAL_TAP_OUT_VOLUME)) +
  geom_point() +
  stat_smooth(method = lm)


lm_model_out <- autoplot(lm(Pop ~ TOTAL_TAP_OUT_VOLUME, data = passenger_resident_tap_o), label.size = 3)
lm_model_out

As seen from the above, the results are similar to tap in.

Spatial Autocorrelation Analysis

Before proceeding with the analysis, we join residual data for both tap in and tap out data to the dataset

passenger_resident_tap_o$residuals <- residuals(model)
passenger_resident_tap_o$residuals_out <- residuals(model_out)

Modelling Spatial Neighbours

To proceed with the analysis, we convert the data to a SpatialPolygonDataframe

passenger_resident_tap_sp <- as_Spatial(passenger_resident_tap_o)

Modelling using fixed distance

Determine the cut-off distance

To choose a distance for the fixed distance method to define the neighbours, we have to determine the cut off by obtaining the furthest distance among all the distances between each subzone and its nearest neighbour.

coords <- coordinates(passenger_resident_tap_sp)
k1 <- knn2nb(knearneigh(coords,k=1))
k1dists <- unlist(nbdists(k1, coords, longlat = FALSE))
summary(k1dists)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   182.5   616.6   879.3   914.3  1096.8  4597.9

The summary report shows that the largest first nearest neighbour distance is 4597.9 , so using this as the upper threshold gives certainty that all units will have at least one neighbour. #### Computing fixed distance weight matrix

passenger_resident_tapin_q_4598 <- dnearneigh(coords, 0, 4598, longlat = FALSE)
passenger_resident_tapin_q_4598
## Neighbour list object:
## Number of regions: 232 
## Number of nonzero links: 8736 
## Percentage nonzero weights: 16.23068 
## Average number of links: 37.65517

As seen from the data above, the average number of links per subzone is about 38. #### Plotting fixed distance weight matrix

par(mfrow=c(1,2))
plot(passenger_resident_tap_sp, border="lightgrey")
plot(k1, coords, add=TRUE, col="red", length=0.08, main="1st nearest neighbours")
plot(passenger_resident_tap_sp, border="lightgrey")
plot(passenger_resident_tapin_q_4598, coords, add=TRUE, pch = 19, cex = 0.6, main="Distance link")

Modelling Spatial Neighbours using Queens

passenger_resident_tap_sp_q <- poly2nb(passenger_resident_tap_sp, queen=TRUE)
summary(passenger_resident_tap_sp_q)
## Neighbour list object:
## Number of regions: 232 
## Number of nonzero links: 1182 
## Percentage nonzero weights: 2.196046 
## Average number of links: 5.094828 
## Link number distribution:
## 
##  1  2  3  4  5  6  7  8  9 
##  4 10 26 35 69 41 31 12  4 
## 4 least connected regions:
## 15 263 285 302 with 1 link
## 4 most connected regions:
## 89 94 162 174 with 9 links
plot(passenger_resident_tap_sp, border="lightgrey")
plot(passenger_resident_tap_sp_q, coordinates(passenger_resident_tap_sp), pch = 19, cex = 0.6, add = TRUE, col= "red")

Modelling Spatial Neighbours using ROOK

passenger_resident_tap_sp_r <- poly2nb(passenger_resident_tap_sp, queen=FALSE)
summary(passenger_resident_tap_sp_r)
## Neighbour list object:
## Number of regions: 232 
## Number of nonzero links: 1014 
## Percentage nonzero weights: 1.883918 
## Average number of links: 4.37069 
## Link number distribution:
## 
##  1  2  3  4  5  6  7  8 
##  7 17 39 66 50 33 16  4 
## 7 least connected regions:
## 15 263 268 271 285 295 302 with 1 link
## 4 most connected regions:
## 84 89 160 162 with 8 links
plot(passenger_resident_tap_sp, border="lightgrey")
plot(passenger_resident_tap_sp_r, coordinates(passenger_resident_tap_sp), pch = 19, cex = 0.6, add = TRUE, col= "red")

Modelling Spatial Neighbours using k=8

We use the number 8 as for for values that are not normally distributed,it is important to evaluate each feature within the cnotext of at least 8 neighbours as a rule of thumb.

passenger_resident_tap_sp_knn8 <- knn2nb(knearneigh(coords, k=8))
passenger_resident_tap_sp_knn8
## Neighbour list object:
## Number of regions: 232 
## Number of nonzero links: 1856 
## Percentage nonzero weights: 3.448276 
## Average number of links: 8 
## Non-symmetric neighbours list

Plotting distance based neighbours

plot(passenger_resident_tap_sp, border="lightgrey")
plot(passenger_resident_tap_sp_knn8, coords, pch = 19, cex = 0.6, add = TRUE, col = "red")


Based on the above, I decided to use Queens method. The fixed distance is not suitable as the average links is 37.6, which is too many neighbours.

Row-standardised weights matrix

Next, we need to assign weights to each neighboring polygon. In our case, each neighboring polygon will be assigned equal weight (style=“W”)

rpassenger_resident_tap_sp_q<- nb2listw(passenger_resident_tap_sp_q, style="W", zero.policy = TRUE)
rpassenger_resident_tap_sp_q
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 232 
## Number of nonzero links: 1182 
## Percentage nonzero weights: 2.196046 
## Average number of links: 5.094828 
## 
## Weights style: W 
## Weights constants summary:
##     n    nn  S0     S1       S2
## W 232 53824 232 99.897 957.3532

Compute lag residuals for Tap In vs Population

Calculate the spatially lag residual values for Tap In vs Population

residuals.lag <- lag.listw(rpassenger_resident_tap_sp_q, passenger_resident_tap_sp$residuals)
residuals.lag
##   [1]  -4786.59127  -7367.99684  -4179.85792  -3950.13670  -2694.86431
##   [6]  -3980.25707  -5544.10238  -4321.66777  -3332.63470   -785.98129
##  [11]  -4136.98519  -3263.39362 -24879.71489  -2096.20443  -5791.74296
##  [16]  -5769.44877  -3561.89294  -8141.61359  -9171.39910  -5975.11903
##  [21]  -4379.99506  -6357.35819  -3156.87489  -5953.04402  -7142.72489
##  [26]  -2724.66855  -1360.66664  -8122.63401  -4214.45665  -5338.12299
##  [31]  -8915.54594  -9293.57137  -9612.48017  -9023.69795  -9452.14412
##  [36]  -7656.77812  -8583.77321  -6791.40206 -10793.64396  -6903.61284
##  [41]  -7008.24848  -2686.13989  -1398.42921  -6620.75565  -8957.54359
##  [46]   -964.45896  -5041.42009  -6832.17343   1553.80897  -5915.84224
##  [51]  -1920.47010  -8828.34961  -9557.03072   -292.40769  -8039.10987
##  [56] -10188.84557  -5574.97848  -5564.47255 -10146.26409  -6910.25341
##  [61]  -4090.38684  -6947.14404  -6641.77212   2114.26069  -2651.42858
##  [66]  -9192.53503  -8502.31618  -7611.24631  -2433.88015  -7874.68637
##  [71]   -382.29046  -1320.45548  -8312.26126  -6560.87624  -1029.07614
##  [76]  -2849.25218  -3650.45246  -2574.55365  -5011.26668  -4546.97998
##  [81]  -1430.02280  -5117.08703  -5177.46760  -3579.99034  -2207.49716
##  [86]  -9220.97377   2403.62109   1405.81839  -4861.06001  -6894.29470
##  [91]  -1891.78166   -486.10613  -1390.19550  -1533.82112   2590.64339
##  [96]    145.38649    -29.96132  -4930.52325   -434.10293   3655.56022
## [101]  -2104.37239  -4340.51721  -5219.10323  -8671.94395    -37.45432
## [106]  11760.64423   9733.26428  -5547.89157  -4433.29057  -1601.71975
## [111]   -107.18841  -6822.19637  -4320.50628  -3918.83843  -2047.09172
## [116]  -3595.38268  -1065.35248  -8499.42815  -1744.29630   -214.33022
## [121]  -3013.54301   5505.14907    909.29954    677.41726   1811.89519
## [126]  -3956.69282    567.54112   5693.78242   2734.34149   2580.40681
## [131]   2338.59701   1743.41876   1572.94173   2532.42754   -400.47280
## [136]   5696.50497   -379.78281   3653.62027  -7425.44333  -1289.34016
## [141]  -3273.82101  -2504.05167  -8937.01111   -477.45919   9131.99722
## [146]  -1041.31411   7662.75050   3971.87599   4137.90975   7089.11564
## [151]   2317.37052   3903.94464   3667.36313   -710.78003  -3536.39895
## [156]   3766.80159   8170.67691   1748.71118  -3056.57445  -6192.39578
## [161]  13122.82801   3820.75517   8889.80905   -397.55803   4585.70925
## [166]   3413.28374   5948.39763   9481.36407  20886.72008  -9592.52066
## [171]   3186.82176   2861.99451  -3593.39332   3892.38363  -1044.02051
## [176]   2905.84689   6029.48995  -3085.41098  -1090.90621  -2019.00629
## [181]  -2413.72799   -418.60193   8940.27404  -2994.91464   -207.03451
## [186]    931.29099  16308.60076  -1388.01507   2893.76473  -2809.18446
## [191]  11323.38492   8861.56324   5922.52408   7482.74542   1681.40162
## [196]  14972.17281  12412.46219  22941.94466    748.87046  22195.56430
## [201]  14017.15251  -8944.09344  22551.44136  19649.16636   -823.20451
## [206]   7639.74021  26340.48577   1585.45514  11145.66621  11942.85400
## [211]  27040.95172   9001.94087  -3761.61344   8862.20227  -4126.52755
## [216]  14559.69993  16343.59660   3946.09321   3291.08657 -17039.24821
## [221]   5056.66709   -995.24661  28972.93170  -8385.12518   6101.21397
## [226]   2604.44469  15083.69889  -1841.24319  24148.90535  -3105.19300
## [231]   8194.62478   4010.12128


We can append the spatially lag residual values onto passenger_resident_tap_sp SpatialPolygonDataFrame

lag.list <- list(passenger_resident_tap_sp$SUBZONE_N, lag.listw(rpassenger_resident_tap_sp_q, passenger_resident_tap_sp$residuals))
lag.res <- as.data.frame(lag.list)


The table show the lag residuals of tap in vs Population for the respective subzones

colnames(lag.res) <- c("SUBZONE_N", "lag residuals")
print(lag.res)
##                         SUBZONE_N lag residuals
## 1                    PEARL'S HILL   -4786.59127
## 2                       BOAT QUAY   -7367.99684
## 3                  HENDERSON HILL   -4179.85792
## 4                         REDHILL   -3950.13670
## 5                  ALEXANDRA HILL   -2694.86431
## 6                   BUKIT HO SWEE   -3980.25707
## 7                     CLARKE QUAY   -5544.10238
## 8                 PASIR PANJANG 1   -4321.66777
## 9                       QUEENSWAY   -3332.63470
## 10                ALEXANDRA NORTH    -785.98129
## 11               INSTITUTION HILL   -4136.98519
## 12                 ROBERTSON QUAY   -3263.39362
## 13                        SENTOSA  -24879.71489
## 14                MARITIME SQUARE   -2096.20443
## 15              TELOK BLANGAH WAY   -5791.74296
## 16                          CECIL   -5769.44877
## 17            KAMPONG TIONG BAHRU   -3561.89294
## 18            TELOK BLANGAH DRIVE   -8141.61359
## 19                PASIR PANJANG 2   -9171.39910
## 20                CENTRAL SUBZONE   -5975.11903
## 21                     DEPOT ROAD   -4379.99506
## 22                  PEOPLE'S PARK   -6357.35819
## 23                    BUKIT MERAH   -3156.87489
## 24                      CHINATOWN   -5953.04402
## 25                   CHINA SQUARE   -7142.72489
## 26                    TIONG BAHRU   -2724.66855
## 27            TIONG BAHRU STATION   -1360.66664
## 28                          OXLEY   -8122.63401
## 29                       MEI CHIN   -4214.45665
## 30  NATIONAL UNIVERSITY OF S'PORE   -5338.12299
## 31                  ONE TREE HILL   -8915.54594
## 32                       SOMERSET   -9293.57137
## 33                      BENCOOLEN   -9612.48017
## 34                    LEONIE HILL   -9023.69795
## 35                           PORT   -9452.14412
## 36                    DHOBY GHAUT   -7656.77812
## 37                          BUGIS   -8583.77321
## 38                       VICTORIA   -6791.40206
## 39                       PATERSON  -10793.64396
## 40             TELOK BLANGAH RISE   -6903.61284
## 41                  TANJONG PAGAR   -7008.24848
## 42                   EVERTON PARK   -2686.13989
## 43                   TANGLIN HALT   -1398.42921
## 44                      MACKENZIE   -6620.75565
## 45                    SUNGEI ROAD   -8957.54359
## 46                      ONE NORTH    -964.45896
## 47                    TANJONG RHU   -5041.42009
## 48                    MOUNTBATTEN   -6832.17343
## 49                   COMMONWEALTH    1553.80897
## 50                          DOVER   -5915.84224
## 51                         RIDOUT   -1920.47010
## 52                  CLEMENTI WEST   -8828.34961
## 53                    MONK'S HILL   -9557.03072
## 54                         SIGLAP    -292.40769
## 55                 CLEMENTI WOODS   -8039.10987
## 56                   ORANGE GROVE  -10188.84557
## 57                  KAMPONG BUGIS   -5574.97848
## 58                      BOULEVARD   -5564.47255
## 59                   LITTLE INDIA  -10146.26409
## 60                   FORT CANNING   -6910.25341
## 61                   FARRER COURT   -4090.38684
## 62                         NASSIM   -6947.14404
## 63                     WEST COAST   -6641.77212
## 64                       BAYSHORE    2114.26069
## 65                     CHATSWORTH   -2651.42858
## 66                   KAMPONG GLAM   -9192.53503
## 67                        SELEGIE   -8502.31618
## 68                       CRAWFORD   -7611.24631
## 69                 MARGARET DRIVE   -2433.88015
## 70                        TANGLIN   -7874.68637
## 71                  MARINE PARADE    -382.29046
## 72                  GEYLANG BAHRU   -1320.45548
## 73                          FABER   -8312.26126
## 74                        MALCOLM   -6560.87624
## 75                    BEDOK SOUTH   -1029.07614
## 76                      BENDEMEER   -2849.25218
## 77                      BALESTIER   -3650.45246
## 78                CORONATION ROAD   -2574.55365
## 79                      KEMBANGAN   -5011.26668
## 80                         KATONG   -4546.97998
## 81                  HOLLAND DRIVE   -1430.02280
## 82                    FARRER PARK   -5117.08703
## 83                  NEWTON CIRCUS   -5177.46760
## 84                       GHIM MOH   -3579.99034
## 85                       LAVENDER   -2207.49716
## 86                  GOODWOOD PARK   -9220.97377
## 87          SINGAPORE POLYTECHNIC    2403.62109
## 88               CLEMENTI CENTRAL    1405.81839
## 89                   KAMPONG JAVA   -4861.06001
## 90                      BOON KENG   -6894.29470
## 91                     ULU PANDAN   -1891.78166
## 92                 JURONG GATEWAY    -486.10613
## 93                   HOLLAND ROAD   -1390.19550
## 94                    KAMPONG UBI   -1533.82112
## 95                        SENNETT    2590.64339
## 96                   POTONG PASIR     145.38649
## 97                       PEI CHUN     -29.96132
## 98                      BOON TECK   -4930.52325
## 99                      WOODLEIGH    -434.10293
## 100                  TAMAN JURONG    3655.56022
## 101                      LAKESIDE   -2104.37239
## 102                TOA PAYOH WEST   -4340.51721
## 103                    KAKI BUKIT   -5219.10323
## 104                    YUHUA EAST   -8671.94395
## 105             BUKIT BATOK SOUTH     -37.45432
## 106           JURONG WEST CENTRAL   11760.64423
## 107               BEDOK RESERVOIR    9733.26428
## 108                MOUNT PLEASANT   -5547.89157
## 109                     HILLCREST   -4433.29057
## 110                      JOO SENG   -1601.71975
## 111            LORONG 8 TOA PAYOH    -107.18841
## 112                      TOH GUAN   -6822.19637
## 113                      BRADDELL   -4320.50628
## 114                      ALJUNIED   -3918.83843
## 115                      TYERSALL   -2047.09172
## 116                      MOULMEIN   -3595.38268
## 117                       FRANKEL   -1065.35248
## 118                CLEMENTI NORTH   -8499.42815
## 119                   LEEDON PARK   -1744.29630
## 120                  GEYLANG EAST    -214.33022
## 121                 TEBAN GARDENS   -3013.54301
## 122                BOON LAY PLACE    5505.14907
## 123              BUKIT BATOK EAST     909.29954
## 124              BUKIT BATOK WEST     677.41726
## 125           BUKIT BATOK CENTRAL    1811.89519
## 126              UPPER PAYA LEBAR   -3956.69282
## 127                      HONG KAH     567.54112
## 128             SERANGOON CENTRAL    5693.78242
## 129                   BISHAN EAST    2734.34149
## 130                 TAMPINES WEST    2580.40681
## 131                    BRICKWORKS    2338.59701
## 132                        GUILIN    1743.41876
## 133                     MARYMOUNT    1572.94173
## 134                         WENYA    2532.42754
## 135                NATURE RESERVE    -400.47280
## 136                 TAMPINES EAST    5696.50497
## 137                      TAI SENG    -379.78281
## 138                    YUHUA WEST    3653.62027
## 139                        YUNNAN   -7425.44333
## 140                  LORONG CHUAN   -1289.34016
## 141                       DUNEARN   -3273.82101
## 142                    SUNSET WAY   -2504.05167
## 143                    MACPHERSON   -8937.01111
## 144                      KIM KEAT    -477.45919
## 145                   BEDOK NORTH    9131.99722
## 146             TOA PAYOH CENTRAL   -1041.31411
## 147                  HOUGANG EAST    7662.75050
## 148                       KANGKAR    3971.87599
## 149               SEMBAWANG HILLS    4137.90975
## 150                        JELEBU    7089.11564
## 151                     KEAT HONG    2317.37052
## 152                  HOUGANG WEST    3903.94464
## 153                       BANGKIT    3667.36313
## 154                    ANAK BUKIT    -710.78003
## 155                    SWISS CLUB   -3536.39895
## 156                         XILIN    3766.80159
## 157                         SIMEI    8170.67691
## 158                    PENG SIANG    1748.71118
## 159                PASIR RIS WEST   -3056.57445
## 160             YIO CHU KANG WEST   -6192.39578
## 161                     TRAFALGAR   13122.82801
## 162                     TECK WHYE    3820.75517
## 163         CHOA CHU KANG CENTRAL    8889.80905
## 164                   CHANGI WEST    -397.55803
## 165                         FAJAR    4585.70925
## 166                         SENJA    3413.28374
## 167                       SAUJANA    5948.39763
## 168                 SELETAR HILLS    9481.36407
## 169                   COMPASSVALE   20886.72008
## 170             YIO CHU KANG EAST   -9592.52066
## 171                   LOYANG WEST    3186.82176
## 172                        TAGORE    2861.99451
## 173                 LORONG AH SOO   -3593.39332
## 174                   FLORA DRIVE    3892.38363
## 175                      HILLVIEW   -1044.02051
## 176                 UPPER THOMSON    2905.84689
## 177                HONG KAH NORTH    6029.48995
## 178                    TOWNSVILLE   -3085.41098
## 179                         KOVAN   -1090.90621
## 180                    CHONG BOON   -2019.00629
## 181                    SHANGRI-LA   -2413.72799
## 182              SERANGOON GARDEN    -418.60193
## 183               HOUGANG CENTRAL    8940.27404
## 184                   LOYANG EAST   -2994.91464
## 185                    DAIRY FARM    -207.03451
## 186               PASIR RIS DRIVE     931.29099
## 187                TAMPINES NORTH   16308.60076
## 188                     CHENG SAN   -1388.01507
## 189        ANG MO KIO TOWN CENTRE    2893.76473
## 190                   KEBUN BAHRU   -2809.18446
## 191               SERANGOON NORTH   11323.38492
## 192             PASIR RIS CENTRAL    8861.56324
## 193                        GOMBAK    5922.52408
## 194                PASIR RIS PARK    7482.74542
## 195           CHOA CHU KANG NORTH    1681.40162
## 196                     RIVERVALE   14972.17281
## 197                      FERNVALE   12412.46219
## 198                 PUNGGOL FIELD   22941.94466
## 199                       YEW TEE     748.87046
## 200                       MATILDA   22195.56430
## 201                 WATERWAY EAST   14017.15251
## 202                  CHANGI POINT   -8944.09344
## 203          SENGKANG TOWN CENTRE   22551.44136
## 204                    ANCHORVALE   19649.16636
## 205                  YISHUN SOUTH    -823.20451
## 206                 LOWER SELETAR    7639.74021
## 207                    NORTHSHORE   26340.48577
## 208                 MANDAI ESTATE    1585.45514
## 209                YISHUN CENTRAL   11145.66621
## 210                     TURF CLUB   11942.85400
## 211               WOODLANDS SOUTH   27040.95172
## 212                     WOODGROVE    9001.94087
## 213                   YISHUN EAST   -3761.61344
## 214       WESTERN WATER CATCHMENT    8862.20227
## 215                   YISHUN WEST   -4126.52755
## 216                WOODLANDS EAST   14559.69993
## 217             SEMBAWANG CENTRAL   16343.59660
## 218                SEMBAWANG EAST    3946.09321
## 219                     ADMIRALTY    3291.08657
## 220                  LIM CHU KANG  -17039.24821
## 221               SEMBAWANG NORTH    5056.66709
## 222                     NORTHLAND    -995.24661
## 223                       MIDVIEW   28972.93170
## 224                WOODLANDS WEST   -8385.12518
## 225             SEMBAWANG SPRINGS    6101.21397
## 226                    SPRINGLEAF    2604.44469
## 227           PUNGGOL TOWN CENTRE   15083.69889
## 228                      NEE SOON   -1841.24319
## 229                       SELETAR   24148.90535
## 230                        KHATIB   -3105.19300
## 231                   NORTH COAST    8194.62478
## 232             SEMBAWANG STRAITS    4010.12128

Compute lag residuals for Tap out vs population

Calculate the spatially lag residual values

residualsout.lag <- lag.listw(rpassenger_resident_tap_sp_q, passenger_resident_tap_sp$residuals_out)
residualsout.lag
##   [1]  -4758.84448  -6128.26706  -4141.81335  -4044.33734  -2691.24482
##   [6]  -3221.14746  -5882.74453  -3973.85321  -5184.95708   -606.18647
##  [11]  -4212.24320  -2640.86214 -25061.04737  -1964.10767  -6706.22101
##  [16]  -5162.90681  -3348.88337  -7465.17264  -9848.50328  -5450.22844
##  [21]  -5440.03827  -4013.17529  -3135.95587  -6065.09311  -5704.80682
##  [26]  -2080.24111  -1759.61156  -7972.41755  -4466.04336  -6035.33588
##  [31]  -8455.11846  -9131.78063  -9101.24559  -8439.37216  -9517.19694
##  [36]  -7044.64071  -7785.16747  -6775.12493 -10661.28005  -7116.19215
##  [41]  -6551.09878  -2080.89388  -1246.06478  -6434.64264  -7869.69845
##  [46]  -1372.12796  -6170.52830  -6092.25771   1552.12907  -5740.57107
##  [51]  -1081.76179  -8187.44241  -8221.55845  -1046.13902  -7469.61904
##  [56] -10880.03274  -6012.42678  -4610.28595  -9229.43590  -6566.41881
##  [61]  -3459.55190  -7108.28710  -6434.22094    625.27522  -1915.13122
##  [66]  -9764.01469  -8037.13624  -7520.41619  -2793.21868  -8259.15139
##  [71]  -1702.37713  -2048.55858  -7291.19423  -5927.67122  -2368.91606
##  [76]  -2454.73748  -3303.11635  -2465.07232  -6049.43742  -4427.96684
##  [81]  -1617.53342  -4635.16143  -4975.22264  -3780.36449  -2466.48051
##  [86]  -9118.60532   2196.63027   1013.77011  -4351.04693  -8209.95357
##  [91]  -1285.16377  -1325.48919  -1458.35637  -1443.27426   1951.17084
##  [96]     81.54298   -592.60513  -4512.82332  -1924.41623   2996.86718
## [101]  -2471.55048  -4433.60685  -4635.60829  -8611.77171    304.42788
## [106]  11925.26177   8159.05931  -5002.11456  -4089.96134  -1954.89881
## [111]  -1700.20152  -6664.39359  -5683.61725  -3501.68882  -1481.69413
## [116]  -3574.08562    -25.86989  -7135.94075   -987.47353  -1996.47160
## [121]  -4443.01239   5338.64808    398.29508    704.06464   1294.34411
## [126]  -3430.27180     26.04693   4903.69999   2663.55500   3208.21202
## [131]   2298.14264   2945.72121    -56.80216   2446.28361  -1001.70309
## [136]   5429.18974  -1564.12971   2766.10555  -7421.06791  -2947.34743
## [141]  -2805.07350  -1847.70707  -8508.44004  -1261.68195   7580.37474
## [146]   -985.97546   7139.94890   3024.48358   4295.27947   7433.34394
## [151]   4418.56569   3615.36844   3596.27232  -1154.00965  -2694.20595
## [156]   4402.49531   7533.25442   1444.34251  -3503.84619  -5551.61836
## [161]  12819.72349   3935.63886   8746.08785   -557.53420   4996.18839
## [166]   4499.97960   5117.92749  10378.59906  21515.32722  -8214.53534
## [171]   3654.56506   2946.44885  -3437.38539   4670.57775   -589.30186
## [176]   2901.26306   5215.38549  -3306.99831  -1000.07138  -1016.55996
## [181]   -862.77430   -587.81016   9224.98526  -3062.37202    576.98000
## [186]    537.27013  15805.99655  -2011.50805   3255.07157  -2457.44666
## [191]  11685.53398   9706.56947   5135.47208   7008.73012   2184.95331
## [196]  15334.68377  11981.65320  22568.76361    737.92414  22616.79847
## [201]  14230.83440  -6588.38148  22175.62052  19548.53235  -2424.67391
## [206]   6883.07357  26406.23518  -2511.72706  11169.05828   8490.67383
## [211]  27015.42877   6379.64429  -2663.04663   9592.83654  -5255.47697
## [216]  15602.48635  14498.19335   4466.02760   3221.70784 -18354.33504
## [221]   5369.71848   -946.48575  29042.43801  -6097.11313   6692.68639
## [226]   1849.16934  14828.99922  -5714.10221  23798.35672  -2082.44827
## [231]  -2622.27984   2729.81062


lagout.list <- list(passenger_resident_tap_sp$SUBZONE_N, lag.listw(rpassenger_resident_tap_sp_q, passenger_resident_tap_sp$residuals_out))
lagout.res <- as.data.frame(lagout.list)


The table show the lag residuals Tap Out vs Populationfor the respective subzones

colnames(lagout.res) <- c("SUBZONE_N", "lag residuals")
print(lagout.res)
##                         SUBZONE_N lag residuals
## 1                    PEARL'S HILL   -4758.84448
## 2                       BOAT QUAY   -6128.26706
## 3                  HENDERSON HILL   -4141.81335
## 4                         REDHILL   -4044.33734
## 5                  ALEXANDRA HILL   -2691.24482
## 6                   BUKIT HO SWEE   -3221.14746
## 7                     CLARKE QUAY   -5882.74453
## 8                 PASIR PANJANG 1   -3973.85321
## 9                       QUEENSWAY   -5184.95708
## 10                ALEXANDRA NORTH    -606.18647
## 11               INSTITUTION HILL   -4212.24320
## 12                 ROBERTSON QUAY   -2640.86214
## 13                        SENTOSA  -25061.04737
## 14                MARITIME SQUARE   -1964.10767
## 15              TELOK BLANGAH WAY   -6706.22101
## 16                          CECIL   -5162.90681
## 17            KAMPONG TIONG BAHRU   -3348.88337
## 18            TELOK BLANGAH DRIVE   -7465.17264
## 19                PASIR PANJANG 2   -9848.50328
## 20                CENTRAL SUBZONE   -5450.22844
## 21                     DEPOT ROAD   -5440.03827
## 22                  PEOPLE'S PARK   -4013.17529
## 23                    BUKIT MERAH   -3135.95587
## 24                      CHINATOWN   -6065.09311
## 25                   CHINA SQUARE   -5704.80682
## 26                    TIONG BAHRU   -2080.24111
## 27            TIONG BAHRU STATION   -1759.61156
## 28                          OXLEY   -7972.41755
## 29                       MEI CHIN   -4466.04336
## 30  NATIONAL UNIVERSITY OF S'PORE   -6035.33588
## 31                  ONE TREE HILL   -8455.11846
## 32                       SOMERSET   -9131.78063
## 33                      BENCOOLEN   -9101.24559
## 34                    LEONIE HILL   -8439.37216
## 35                           PORT   -9517.19694
## 36                    DHOBY GHAUT   -7044.64071
## 37                          BUGIS   -7785.16747
## 38                       VICTORIA   -6775.12493
## 39                       PATERSON  -10661.28005
## 40             TELOK BLANGAH RISE   -7116.19215
## 41                  TANJONG PAGAR   -6551.09878
## 42                   EVERTON PARK   -2080.89388
## 43                   TANGLIN HALT   -1246.06478
## 44                      MACKENZIE   -6434.64264
## 45                    SUNGEI ROAD   -7869.69845
## 46                      ONE NORTH   -1372.12796
## 47                    TANJONG RHU   -6170.52830
## 48                    MOUNTBATTEN   -6092.25771
## 49                   COMMONWEALTH    1552.12907
## 50                          DOVER   -5740.57107
## 51                         RIDOUT   -1081.76179
## 52                  CLEMENTI WEST   -8187.44241
## 53                    MONK'S HILL   -8221.55845
## 54                         SIGLAP   -1046.13902
## 55                 CLEMENTI WOODS   -7469.61904
## 56                   ORANGE GROVE  -10880.03274
## 57                  KAMPONG BUGIS   -6012.42678
## 58                      BOULEVARD   -4610.28595
## 59                   LITTLE INDIA   -9229.43590
## 60                   FORT CANNING   -6566.41881
## 61                   FARRER COURT   -3459.55190
## 62                         NASSIM   -7108.28710
## 63                     WEST COAST   -6434.22094
## 64                       BAYSHORE     625.27522
## 65                     CHATSWORTH   -1915.13122
## 66                   KAMPONG GLAM   -9764.01469
## 67                        SELEGIE   -8037.13624
## 68                       CRAWFORD   -7520.41619
## 69                 MARGARET DRIVE   -2793.21868
## 70                        TANGLIN   -8259.15139
## 71                  MARINE PARADE   -1702.37713
## 72                  GEYLANG BAHRU   -2048.55858
## 73                          FABER   -7291.19423
## 74                        MALCOLM   -5927.67122
## 75                    BEDOK SOUTH   -2368.91606
## 76                      BENDEMEER   -2454.73748
## 77                      BALESTIER   -3303.11635
## 78                CORONATION ROAD   -2465.07232
## 79                      KEMBANGAN   -6049.43742
## 80                         KATONG   -4427.96684
## 81                  HOLLAND DRIVE   -1617.53342
## 82                    FARRER PARK   -4635.16143
## 83                  NEWTON CIRCUS   -4975.22264
## 84                       GHIM MOH   -3780.36449
## 85                       LAVENDER   -2466.48051
## 86                  GOODWOOD PARK   -9118.60532
## 87          SINGAPORE POLYTECHNIC    2196.63027
## 88               CLEMENTI CENTRAL    1013.77011
## 89                   KAMPONG JAVA   -4351.04693
## 90                      BOON KENG   -8209.95357
## 91                     ULU PANDAN   -1285.16377
## 92                 JURONG GATEWAY   -1325.48919
## 93                   HOLLAND ROAD   -1458.35637
## 94                    KAMPONG UBI   -1443.27426
## 95                        SENNETT    1951.17084
## 96                   POTONG PASIR      81.54298
## 97                       PEI CHUN    -592.60513
## 98                      BOON TECK   -4512.82332
## 99                      WOODLEIGH   -1924.41623
## 100                  TAMAN JURONG    2996.86718
## 101                      LAKESIDE   -2471.55048
## 102                TOA PAYOH WEST   -4433.60685
## 103                    KAKI BUKIT   -4635.60829
## 104                    YUHUA EAST   -8611.77171
## 105             BUKIT BATOK SOUTH     304.42788
## 106           JURONG WEST CENTRAL   11925.26177
## 107               BEDOK RESERVOIR    8159.05931
## 108                MOUNT PLEASANT   -5002.11456
## 109                     HILLCREST   -4089.96134
## 110                      JOO SENG   -1954.89881
## 111            LORONG 8 TOA PAYOH   -1700.20152
## 112                      TOH GUAN   -6664.39359
## 113                      BRADDELL   -5683.61725
## 114                      ALJUNIED   -3501.68882
## 115                      TYERSALL   -1481.69413
## 116                      MOULMEIN   -3574.08562
## 117                       FRANKEL     -25.86989
## 118                CLEMENTI NORTH   -7135.94075
## 119                   LEEDON PARK    -987.47353
## 120                  GEYLANG EAST   -1996.47160
## 121                 TEBAN GARDENS   -4443.01239
## 122                BOON LAY PLACE    5338.64808
## 123              BUKIT BATOK EAST     398.29508
## 124              BUKIT BATOK WEST     704.06464
## 125           BUKIT BATOK CENTRAL    1294.34411
## 126              UPPER PAYA LEBAR   -3430.27180
## 127                      HONG KAH      26.04693
## 128             SERANGOON CENTRAL    4903.69999
## 129                   BISHAN EAST    2663.55500
## 130                 TAMPINES WEST    3208.21202
## 131                    BRICKWORKS    2298.14264
## 132                        GUILIN    2945.72121
## 133                     MARYMOUNT     -56.80216
## 134                         WENYA    2446.28361
## 135                NATURE RESERVE   -1001.70309
## 136                 TAMPINES EAST    5429.18974
## 137                      TAI SENG   -1564.12971
## 138                    YUHUA WEST    2766.10555
## 139                        YUNNAN   -7421.06791
## 140                  LORONG CHUAN   -2947.34743
## 141                       DUNEARN   -2805.07350
## 142                    SUNSET WAY   -1847.70707
## 143                    MACPHERSON   -8508.44004
## 144                      KIM KEAT   -1261.68195
## 145                   BEDOK NORTH    7580.37474
## 146             TOA PAYOH CENTRAL    -985.97546
## 147                  HOUGANG EAST    7139.94890
## 148                       KANGKAR    3024.48358
## 149               SEMBAWANG HILLS    4295.27947
## 150                        JELEBU    7433.34394
## 151                     KEAT HONG    4418.56569
## 152                  HOUGANG WEST    3615.36844
## 153                       BANGKIT    3596.27232
## 154                    ANAK BUKIT   -1154.00965
## 155                    SWISS CLUB   -2694.20595
## 156                         XILIN    4402.49531
## 157                         SIMEI    7533.25442
## 158                    PENG SIANG    1444.34251
## 159                PASIR RIS WEST   -3503.84619
## 160             YIO CHU KANG WEST   -5551.61836
## 161                     TRAFALGAR   12819.72349
## 162                     TECK WHYE    3935.63886
## 163         CHOA CHU KANG CENTRAL    8746.08785
## 164                   CHANGI WEST    -557.53420
## 165                         FAJAR    4996.18839
## 166                         SENJA    4499.97960
## 167                       SAUJANA    5117.92749
## 168                 SELETAR HILLS   10378.59906
## 169                   COMPASSVALE   21515.32722
## 170             YIO CHU KANG EAST   -8214.53534
## 171                   LOYANG WEST    3654.56506
## 172                        TAGORE    2946.44885
## 173                 LORONG AH SOO   -3437.38539
## 174                   FLORA DRIVE    4670.57775
## 175                      HILLVIEW    -589.30186
## 176                 UPPER THOMSON    2901.26306
## 177                HONG KAH NORTH    5215.38549
## 178                    TOWNSVILLE   -3306.99831
## 179                         KOVAN   -1000.07138
## 180                    CHONG BOON   -1016.55996
## 181                    SHANGRI-LA    -862.77430
## 182              SERANGOON GARDEN    -587.81016
## 183               HOUGANG CENTRAL    9224.98526
## 184                   LOYANG EAST   -3062.37202
## 185                    DAIRY FARM     576.98000
## 186               PASIR RIS DRIVE     537.27013
## 187                TAMPINES NORTH   15805.99655
## 188                     CHENG SAN   -2011.50805
## 189        ANG MO KIO TOWN CENTRE    3255.07157
## 190                   KEBUN BAHRU   -2457.44666
## 191               SERANGOON NORTH   11685.53398
## 192             PASIR RIS CENTRAL    9706.56947
## 193                        GOMBAK    5135.47208
## 194                PASIR RIS PARK    7008.73012
## 195           CHOA CHU KANG NORTH    2184.95331
## 196                     RIVERVALE   15334.68377
## 197                      FERNVALE   11981.65320
## 198                 PUNGGOL FIELD   22568.76361
## 199                       YEW TEE     737.92414
## 200                       MATILDA   22616.79847
## 201                 WATERWAY EAST   14230.83440
## 202                  CHANGI POINT   -6588.38148
## 203          SENGKANG TOWN CENTRE   22175.62052
## 204                    ANCHORVALE   19548.53235
## 205                  YISHUN SOUTH   -2424.67391
## 206                 LOWER SELETAR    6883.07357
## 207                    NORTHSHORE   26406.23518
## 208                 MANDAI ESTATE   -2511.72706
## 209                YISHUN CENTRAL   11169.05828
## 210                     TURF CLUB    8490.67383
## 211               WOODLANDS SOUTH   27015.42877
## 212                     WOODGROVE    6379.64429
## 213                   YISHUN EAST   -2663.04663
## 214       WESTERN WATER CATCHMENT    9592.83654
## 215                   YISHUN WEST   -5255.47697
## 216                WOODLANDS EAST   15602.48635
## 217             SEMBAWANG CENTRAL   14498.19335
## 218                SEMBAWANG EAST    4466.02760
## 219                     ADMIRALTY    3221.70784
## 220                  LIM CHU KANG  -18354.33504
## 221               SEMBAWANG NORTH    5369.71848
## 222                     NORTHLAND    -946.48575
## 223                       MIDVIEW   29042.43801
## 224                WOODLANDS WEST   -6097.11313
## 225             SEMBAWANG SPRINGS    6692.68639
## 226                    SPRINGLEAF    1849.16934
## 227           PUNGGOL TOWN CENTRE   14828.99922
## 228                      NEE SOON   -5714.10221
## 229                       SELETAR   23798.35672
## 230                        KHATIB   -2082.44827
## 231                   NORTH COAST   -2622.27984
## 232             SEMBAWANG STRAITS    2729.81062

Measure of Global Spatial Autocorrelation for TOTAL_TAP_IN vs Population

Computing Moran’s I

moran.test(passenger_resident_tap_sp$residuals, listw=rpassenger_resident_tap_sp_q, zero.policy = TRUE, na.action=na.omit)
## 
##  Moran I test under randomisation
## 
## data:  passenger_resident_tap_sp$residuals  
## weights: rpassenger_resident_tap_sp_q    
## 
## Moran I statistic standard deviate = 4.4376, p-value = 4.548e-06
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##       0.183667846      -0.004329004       0.001794758


As the p-value is smaller than the alpha value, we reject the first null hypothesis at the 95% confidence interval whereby the Tap In vs Population regression model does not conform to the randomization assumption.

Visualising spatial lag value using Moran Scatterplot

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


The Moran’s scatterplot is split into 4 quadrants:
1. Top left: Low-High Outliers
2. Top Right: High-High (above average)
3. Bottom left: Low-Low (below average)
4. Bottom right: High-Low Outliers

en from the scatterplot, there is a relationship between the spatially lagged residuals and residuals. The slope of the linear regression line is positive, with alot of observations in the high-high quadrant and low=low quadrant.

Spatial Correlogram

Compute Moran’s I correlogram and plot

MI_corr <- sp.correlogram(passenger_resident_tap_sp_q, passenger_resident_tap_sp$residuals, order=6, method="I", style="B")
plot(MI_corr)


The correlogram shows that with more neighbours of higher degree is added to the analysis, moran I become ssmaller. This shows that the residuals per subzone gradually decreases as more lags are added, showing a trickling effect.

Measure of Global Spatial Autocorrelation for TOTAL_TAP_OUT vs Population

Computing Moran’s I

moran.test(passenger_resident_tap_sp$residuals_out, listw=rpassenger_resident_tap_sp_q, zero.policy = TRUE, na.action=na.omit)
## 
##  Moran I test under randomisation
## 
## data:  passenger_resident_tap_sp$residuals_out  
## weights: rpassenger_resident_tap_sp_q    
## 
## Moran I statistic standard deviate = 4.7195, p-value = 1.182e-06
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##       0.195690804      -0.004329004       0.001796160


As the p-value is smaller than the alpha value, we reject the second null hypothesis at the 95% confidence interval whereby the Tap Out vs Population regression model does not conform to the randomization assumption.

Visualising spatial lag value using Moran Scatterplot

MS_OUT <- moran.plot(passenger_resident_tap_sp$residuals_out, rpassenger_resident_tap_sp_q, zero.policy = TRUE, spChk=FALSE, labels=as.character(passenger_resident_tap_sp$SUBZONE_N), xlab="Residuals", ylab="Spatially Lag Residuals")


As seen from the scatterplot, there is a relationship between the spatially lagged residuals and residuals. The slope of the linear regression line is positive, with alot of observations in the high-high quadrant and low=low quadrant.

Spatial Correlogram

Compute Moran’s I correlogram and plot

MI_corr_OUT <- sp.correlogram(passenger_resident_tap_sp_q, passenger_resident_tap_sp$residuals_out, order=6, method="I", style="B")
plot(MI_corr_OUT)


Similar to the tap in, the correlogram shows a trickling effect.

Localized Geospatial Statistics Analysis

Computing local Moran’s I for TOTAL_TAP_IN_VOLUME VS Population

Next, we compute local Moran’s I of the Tap In vs Population residuals at subzone level with given a set of zi values and a listw object providing neighbour weighting information for the polygon associated with the zi values.

fips <- order(passenger_resident_tap_sp$SUBZONE_N)
localMI <- localmoran(passenger_resident_tap_sp$residuals, rpassenger_resident_tap_sp_q)
head(localMI)
##            Ii         E.Ii    Var.Ii       Z.Ii Pr(z > 0)
## 2  0.16637276 -0.004329004 0.1188163  0.4952221 0.3102217
## 3  0.24664660 -0.004329004 0.3237963  0.4410579 0.3295855
## 4  0.05249309 -0.004329004 0.1598123  0.1421386 0.4434853
## 5  0.08105888 -0.004329004 0.1926091  0.1945619 0.4228680
## 6  0.08858649 -0.004329004 0.1363860  0.2515957 0.4006768
## 7 -0.14914057 -0.004329004 0.1363860 -0.3921194 0.6525150


The code chunk below list the content of the local Moran matrix derived by using printCoefmat() for each subzone.

printCoefmat(data.frame(localMI[fips,], row.names=passenger_resident_tap_sp$SUBZONE_N[fips]), check.names=FALSE)
##                                        Ii        E.Ii      Var.Ii
## ADMIRALTY                      0.11495082 -0.00432900  0.19260909
## ALEXANDRA HILL                 0.08858649 -0.00432900  0.13638602
## ALEXANDRA NORTH                0.01674034 -0.00432900  0.15981230
## ALJUNIED                       0.33129812 -0.00432900  0.11881631
## ANAK BUKIT                     0.02696254 -0.00432900  0.15981230
## ANCHORVALE                     3.79981737 -0.00432900  0.24180428
## ANG MO KIO TOWN CENTRE        -0.62686473 -0.00432900  0.13638602
## BALESTIER                      0.01494986 -0.00432900  0.15981230
## BANGKIT                        0.10865735 -0.00432900  0.32379627
## BAYSHORE                      -0.00274148 -0.00432900  0.24180428
## BEDOK NORTH                   -0.62074045 -0.00432900  0.11881631
## BEDOK RESERVOIR                0.29572545 -0.00432900  0.19260909
## BEDOK SOUTH                   -0.10970803 -0.00432900  0.19260909
## BENCOOLEN                      0.33394814 -0.00432900  0.15981230
## BENDEMEER                     -0.27396867 -0.00432900  0.13638602
## BISHAN EAST                   -0.07568480 -0.00432900  0.10515098
## BOAT QUAY                      0.24664660 -0.00432900  0.32379627
## BOON KENG                      0.10163501 -0.00432900  0.32379627
## BOON LAY PLACE                 0.24532852 -0.00432900  0.19260909
## BOON TECK                     -0.11405578 -0.00432900  0.19260909
## BOULEVARD                      0.96276092 -0.00432900  0.11881631
## BRADDELL                       0.04937863 -0.00432900  0.19260909
## BRICKWORKS                     0.04003661 -0.00432900  0.24180428
## BUGIS                          0.90185664 -0.00432900  0.32379627
## BUKIT BATOK CENTRAL           -0.06577114 -0.00432900  0.19260909
## BUKIT BATOK EAST              -0.00029696 -0.00432900  0.24180428
## BUKIT BATOK SOUTH             -0.00027776 -0.00432900  0.13638602
## BUKIT BATOK WEST               0.01710493 -0.00432900  0.15981230
## BUKIT HO SWEE                 -0.14914057 -0.00432900  0.13638602
## BUKIT MERAH                    0.27907800 -0.00432900  0.13638602
## CECIL                          0.30424996 -0.00432900  0.32379627
## CENTRAL SUBZONE                0.22685943 -0.00432900  0.48778023
## CHANGI POINT                   0.40303145 -0.00432900  0.97973213
## CHANGI WEST                    0.02393797 -0.00432900  0.15981230
## CHATSWORTH                     0.06744104 -0.00432900  0.10515098
## CHENG SAN                      0.03268992 -0.00432900  0.15981230
## CHINA SQUARE                   0.29126716 -0.00432900  0.24180428
## CHINATOWN                      0.30264458 -0.00432900  0.15981230
## CHOA CHU KANG CENTRAL         -0.98778714 -0.00432900  0.19260909
## CHOA CHU KANG NORTH            0.20982685 -0.00432900  0.19260909
## CHONG BOON                    -0.03780801 -0.00432900  0.13638602
## CLARKE QUAY                    0.40621627 -0.00432900  0.19260909
## CLEMENTI CENTRAL              -0.28857249 -0.00432900  0.19260909
## CLEMENTI NORTH                -0.21935264 -0.00432900  0.19260909
## CLEMENTI WEST                 -0.14755721 -0.00432900  0.19260909
## CLEMENTI WOODS                -0.01086948 -0.00432900  0.13638602
## COMMONWEALTH                  -0.04513220 -0.00432900  0.19260909
## COMPASSVALE                    1.13333343 -0.00432900  0.13638602
## CORONATION ROAD                0.06986074 -0.00432900  0.15981230
## CRAWFORD                       0.14236682 -0.00432900  0.19260909
## DAIRY FARM                    -0.00097525 -0.00432900  0.19260909
## DEPOT ROAD                    -0.00003676 -0.00432900  0.19260909
## DHOBY GHAUT                    0.66889573 -0.00432900  0.19260909
## DOVER                          0.02166199 -0.00432900  0.19260909
## DUNEARN                        0.09645287 -0.00432900  0.19260909
## EVERTON PARK                   0.02240004 -0.00432900  0.32379627
## FABER                          0.06765185 -0.00432900  0.32379627
## FAJAR                          0.51909535 -0.00432900  0.32379627
## FARRER COURT                  -0.00187512 -0.00432900  0.24180428
## FARRER PARK                    0.53290945 -0.00432900  0.15981230
## FERNVALE                       3.16400340 -0.00432900  0.15981230
## FLORA DRIVE                    0.14905969 -0.00432900  0.19260909
## FORT CANNING                   0.24751729 -0.00432900  0.19260909
## FRANKEL                       -0.00756253 -0.00432900  0.11881631
## GEYLANG BAHRU                  0.01598340 -0.00432900  0.19260909
## GEYLANG EAST                   0.02741630 -0.00432900  0.11881631
## GHIM MOH                      -0.12856532 -0.00432900  0.19260909
## GOMBAK                        -0.08532447 -0.00432900  0.11881631
## GOODWOOD PARK                  0.20010731 -0.00432900  0.15981230
## GUILIN                         0.02010113 -0.00432900  0.15981230
## HENDERSON HILL                 0.05249309 -0.00432900  0.15981230
## HILLCREST                     -0.05244571 -0.00432900  0.19260909
## HILLVIEW                      -0.04368171 -0.00432900  0.13638602
## HOLLAND DRIVE                 -0.02385796 -0.00432900  0.15981230
## HOLLAND ROAD                   0.06340648 -0.00432900  0.15981230
## HONG KAH                       0.04621235 -0.00432900  0.19260909
## HONG KAH NORTH                 0.37680913 -0.00432900  0.24180428
## HOUGANG CENTRAL               -1.60400490 -0.00432900  0.19260909
## HOUGANG EAST                   0.49305508 -0.00432900  0.19260909
## HOUGANG WEST                   0.34361840 -0.00432900  0.13638602
## INSTITUTION HILL               0.03798351 -0.00432900  0.24180428
## JELEBU                        -0.31080021 -0.00432900  0.13638602
## JOO SENG                       0.02153822 -0.00432900  0.19260909
## JURONG GATEWAY                 0.12650795 -0.00432900  0.32379627
## JURONG WEST CENTRAL           -1.46304269 -0.00432900  0.32379627
## KAKI BUKIT                    -0.20117577 -0.00432900  0.19260909
## KAMPONG BUGIS                  0.23746540 -0.00432900  0.19260909
## KAMPONG GLAM                   0.35729727 -0.00432900  0.48778023
## KAMPONG JAVA                  -0.04052045 -0.00432900  0.13638602
## KAMPONG TIONG BAHRU            0.01186342 -0.00432900  0.13638602
## KAMPONG UBI                    0.12662500 -0.00432900  0.13638602
## KANGKAR                        0.38700602 -0.00432900  0.19260909
## KATONG                         0.08444909 -0.00432900  0.24180428
## KEAT HONG                      0.34325261 -0.00432900  0.19260909
## KEBUN BAHRU                   -0.12340584 -0.00432900  0.19260909
## KEMBANGAN                     -0.36274112 -0.00432900  0.15981230
## KHATIB                         0.11612137 -0.00432900  0.13638602
## KIM KEAT                       0.00126732 -0.00432900  0.15981230
## KOVAN                         -0.05354995 -0.00432900  0.13638602
## LAKESIDE                       0.10976458 -0.00432900  0.15981230
## LAVENDER                       0.18196784 -0.00432900  0.13638602
## LEEDON PARK                    0.01633000 -0.00432900  0.10515098
## LEONIE HILL                    0.11543457 -0.00432900  0.11881631
## LIM CHU KANG                   0.47870228 -0.00432900  0.97973213
## LITTLE INDIA                   0.08372681 -0.00432900  0.15981230
## LORONG 8 TOA PAYOH             0.00101977 -0.00432900  0.13638602
## LORONG AH SOO                 -0.00735629 -0.00432900  0.15981230
## LORONG CHUAN                  -0.02431289 -0.00432900  0.13638602
## LOWER SELETAR                  0.42615083 -0.00432900  0.19260909
## LOYANG EAST                    0.06731192 -0.00432900  0.32379627
## LOYANG WEST                   -0.12291216 -0.00432900  0.19260909
## MACKENZIE                      0.34226629 -0.00432900  0.32379627
## MACPHERSON                    -0.41121506 -0.00432900  0.15981230
## MALCOLM                        0.24762763 -0.00432900  0.13638602
## MANDAI ESTATE                 -0.02505051 -0.00432900  0.48778023
## MARGARET DRIVE                -0.05395738 -0.00432900  0.10515098
## MARINE PARADE                  0.00447567 -0.00432900  0.24180428
## MARITIME SQUARE                0.35109888 -0.00432900  0.15981230
## MARYMOUNT                      0.05831032 -0.00432900  0.15981230
## MATILDA                        3.21947041 -0.00432900  0.11881631
## MEI CHIN                      -0.10882592 -0.00432900  0.15981230
## MIDVIEW                        3.21421511 -0.00432900  0.32379627
## MONK'S HILL                    0.16942299 -0.00432900  0.24180428
## MOULMEIN                       0.23419156 -0.00432900  0.15981230
## MOUNT PLEASANT                 0.17376108 -0.00432900  0.19260909
## MOUNTBATTEN                   -0.06888334 -0.00432900  0.19260909
## NASSIM                         0.07680993 -0.00432900  0.11881631
## NATIONAL UNIVERSITY OF S'PORE  0.38660299 -0.00432900  0.24180428
## NATURE RESERVE                 0.00808487 -0.00432900  0.24180428
## NEE SOON                       0.04819548 -0.00432900  0.32379627
## NEWTON CIRCUS                  0.37430613 -0.00432900  0.32379627
## NORTH COAST                   -1.64980071 -0.00432900  0.97973213
## NORTHLAND                     -0.05919530 -0.00432900  0.19260909
## NORTHSHORE                    -0.63539517 -0.00432900  0.48778023
## ONE NORTH                      0.07976133 -0.00432900  0.13638602
## ONE TREE HILL                  0.21230358 -0.00432900  0.19260909
## ORANGE GROVE                   0.13457779 -0.00432900  0.32379627
## OXLEY                          0.17061121 -0.00432900  0.19260909
## PASIR PANJANG 1                0.25384115 -0.00432900  0.19260909
## PASIR PANJANG 2                0.41285540 -0.00432900  0.24180428
## PASIR RIS CENTRAL             -0.09006209 -0.00432900  0.19260909
## PASIR RIS DRIVE                0.14216525 -0.00432900  0.15981230
## PASIR RIS PARK                -0.00741744 -0.00432900  0.24180428
## PASIR RIS WEST                -0.29824971 -0.00432900  0.32379627
## PATERSON                       0.68526473 -0.00432900  0.19260909
## PEARL'S HILL                   0.16637276 -0.00432900  0.11881631
## PEI CHUN                      -0.00012106 -0.00432900  0.19260909
## PENG SIANG                     0.17084192 -0.00432900  0.24180428
## PEOPLE'S PARK                  0.48400672 -0.00432900  0.48778023
## PORT                           0.43571543 -0.00432900  0.24180428
## POTONG PASIR                   0.00114698 -0.00432900  0.13638602
## PUNGGOL FIELD                  3.87188331 -0.00432900  0.19260909
## PUNGGOL TOWN CENTRE            1.32378796 -0.00432900  0.19260909
## QUEENSWAY                      0.14920851 -0.00432900  0.24180428
## REDHILL                        0.08105888 -0.00432900  0.19260909
## RIDOUT                         0.06095903 -0.00432900  0.13638602
## RIVERVALE                      2.95894339 -0.00432900  0.15981230
## ROBERTSON QUAY                 0.13636649 -0.00432900  0.13638602
## SAUJANA                        0.63545554 -0.00432900  0.32379627
## SELEGIE                        0.32230000 -0.00432900  0.19260909
## SELETAR                       -1.17997578 -0.00432900  0.32379627
## SELETAR HILLS                  0.44035451 -0.00432900  0.19260909
## SEMBAWANG CENTRAL              0.54188877 -0.00432900  0.24180428
## SEMBAWANG EAST                 0.07523279 -0.00432900  0.19260909
## SEMBAWANG HILLS                0.01410910 -0.00432900  0.19260909
## SEMBAWANG NORTH                0.39886827 -0.00432900  0.48778023
## SEMBAWANG SPRINGS             -0.01986174 -0.00432900  0.19260909
## SEMBAWANG STRAITS             -0.06843625 -0.00432900  0.48778023
## SENGKANG TOWN CENTRE           1.68919143 -0.00432900  0.19260909
## SENJA                          0.17332308 -0.00432900  0.24180428
## SENNETT                       -0.12748336 -0.00432900  0.15981230
## SENTOSA                        0.30085926 -0.00432900  0.97973213
## SERANGOON CENTRAL             -0.82044198 -0.00432900  0.19260909
## SERANGOON GARDEN              -0.03621122 -0.00432900  0.11881631
## SERANGOON NORTH               -0.02160508 -0.00432900  0.19260909
## SHANGRI-LA                    -0.05486783 -0.00432900  0.15981230
## SIGLAP                         0.00260322 -0.00432900  0.32379627
## SIMEI                          0.61609844 -0.00432900  0.15981230
## SINGAPORE POLYTECHNIC         -0.19534420 -0.00432900  0.15981230
## SOMERSET                       1.19198614 -0.00432900  0.15981230
## SPRINGLEAF                    -0.00605808 -0.00432900  0.19260909
## SUNGEI ROAD                    0.31192990 -0.00432900  0.24180428
## SUNSET WAY                    -0.01811112 -0.00432900  0.15981230
## SWISS CLUB                     0.06860893 -0.00432900  0.19260909
## TAGORE                         0.00725696 -0.00432900  0.19260909
## TAI SENG                       0.00126149 -0.00432900  0.19260909
## TAMAN JURONG                   0.12912933 -0.00432900  0.32379627
## TAMPINES EAST                  0.56749943 -0.00432900  0.11881631
## TAMPINES NORTH                -0.82483966 -0.00432900  0.19260909
## TAMPINES WEST                  0.53999117 -0.00432900  0.19260909
## TANGLIN                        0.19975286 -0.00432900  0.19260909
## TANGLIN HALT                   0.00421073 -0.00432900  0.19260909
## TANJONG PAGAR                  0.19423714 -0.00432900  0.32379627
## TANJONG RHU                   -0.06433769 -0.00432900  0.24180428
## TEBAN GARDENS                 -0.05376961 -0.00432900  0.48778023
## TECK WHYE                      0.16557197 -0.00432900  0.15981230
## TELOK BLANGAH DRIVE           -0.20643464 -0.00432900  0.24180428
## TELOK BLANGAH RISE             0.00055776 -0.00432900  0.24180428
## TELOK BLANGAH WAY              0.03904065 -0.00432900  0.15981230
## TIONG BAHRU                   -0.05727715 -0.00432900  0.24180428
## TIONG BAHRU STATION            0.09899161 -0.00432900  0.19260909
## TOA PAYOH CENTRAL              0.15245609 -0.00432900  0.13638602
## TOA PAYOH WEST                -0.06527106 -0.00432900  0.15981230
## TOH GUAN                       0.01042365 -0.00432900  0.24180428
## TOWNSVILLE                    -0.09342325 -0.00432900  0.13638602
## TRAFALGAR                      1.45788673 -0.00432900  0.19260909
## TURF CLUB                     -0.87965296 -0.00432900  0.48778023
## TYERSALL                       0.08579113 -0.00432900  0.13638602
## ULU PANDAN                    -0.05759574 -0.00432900  0.15981230
## UPPER PAYA LEBAR              -0.13911238 -0.00432900  0.15981230
## UPPER THOMSON                  0.01290273 -0.00432900  0.24180428
## VICTORIA                       0.78635883 -0.00432900  0.24180428
## WATERWAY EAST                  3.74104665 -0.00432900  0.24180428
## WENYA                         -0.01369346 -0.00432900  0.19260909
## WEST COAST                    -0.07694700 -0.00432900  0.24180428
## WESTERN WATER CATCHMENT       -1.01658220 -0.00432900  0.13638602
## WOODGROVE                      0.95091017 -0.00432900  0.24180428
## WOODLANDS EAST                 4.79821508 -0.00432900  0.32379627
## WOODLANDS SOUTH                4.05499046 -0.00432900  0.32379627
## WOODLANDS WEST                -0.46258233 -0.00432900  0.32379627
## WOODLEIGH                      0.00862222 -0.00432900  0.13638602
## XILIN                         -0.18031880 -0.00432900  0.15981230
## YEW TEE                        0.10588313 -0.00432900  0.48778023
## YIO CHU KANG EAST              0.20522180 -0.00432900  0.32379627
## YIO CHU KANG WEST             -0.40651332 -0.00432900  0.24180428
## YISHUN CENTRAL                -3.44930324 -0.00432900  0.19260909
## YISHUN EAST                   -0.75767115 -0.00432900  0.24180428
## YISHUN SOUTH                  -0.07649366 -0.00432900  0.15981230
## YISHUN WEST                   -0.24240354 -0.00432900  0.13638602
## YUHUA EAST                    -0.38044343 -0.00432900  0.19260909
## YUHUA WEST                    -0.01175133 -0.00432900  0.24180428
## YUNNAN                        -1.47294954 -0.00432900  0.24180428
##                                      Z.Ii Pr.z...0.
## ADMIRALTY                      0.27178696    0.3929
## ALEXANDRA HILL                 0.25159570    0.4007
## ALEXANDRA NORTH                0.05270428    0.4790
## ALJUNIED                       0.97368623    0.1651
## ANAK BUKIT                     0.07827479    0.4688
## ANCHORVALE                     7.73615610    0.0000
## ANG MO KIO TOWN CENTRE        -1.68569637    0.9541
## BALESTIER                      0.04822546    0.4808
## BANGKIT                        0.19855924    0.4213
## BAYSHORE                       0.00322841    0.4987
## BEDOK NORTH                   -1.78826827    0.9631
## BEDOK RESERVOIR                0.68369387    0.2471
## BEDOK SOUTH                   -0.24011306    0.5949
## BENCOOLEN                      0.84618936    0.1987
## BENDEMEER                     -0.73012774    0.7673
## BISHAN EAST                   -0.22005061    0.5871
## BOAT QUAY                      0.44105789    0.3296
## BOON KENG                      0.18621835    0.4261
## BOON LAY PLACE                 0.56886115    0.2847
## BOON TECK                     -0.25001970    0.5987
## BOULEVARD                      2.80561989    0.0025
## BRADDELL                       0.12237639    0.4513
## BRICKWORKS                     0.09022242    0.4641
## BUGIS                          1.59250667    0.0556
## BUKIT BATOK CENTRAL           -0.13999996    0.5557
## BUKIT BATOK EAST               0.00819962    0.4967
## BUKIT BATOK SOUTH              0.01096992    0.4956
## BUKIT BATOK WEST               0.05361629    0.4786
## BUKIT HO SWEE                 -0.39211938    0.6525
## BUKIT MERAH                    0.76740681    0.2214
## CECIL                          0.54228850    0.2938
## CENTRAL SUBZONE                0.33101983    0.3703
## CHANGI POINT                   0.41155245    0.3403
## CHANGI WEST                    0.07070892    0.4718
## CHATSWORTH                     0.22132811    0.4124
## CHENG SAN                      0.09260164    0.4631
## CHINA SQUARE                   0.60112778    0.2739
## CHINATOWN                      0.76788450    0.2213
## CHOA CHU KANG CENTRAL         -2.24087424    0.9875
## CHOA CHU KANG NORTH            0.48796825    0.3128
## CHONG BOON                    -0.09065413    0.5361
## CLARKE QUAY                    0.93545449    0.1748
## CLEMENTI CENTRAL              -0.64766754    0.7414
## CLEMENTI NORTH                -0.48994554    0.6879
## CLEMENTI WEST                 -0.32635491    0.6279
## CLEMENTI WOODS                -0.01771025    0.5071
## COMMONWEALTH                  -0.09297277    0.5370
## COMPASSVALE                    3.08055161    0.0010
## CORONATION ROAD                0.18558325    0.4264
## CRAWFORD                       0.33425610    0.3691
## DAIRY FARM                     0.00764176    0.4970
## DEPOT ROAD                     0.00978016    0.4961
## DHOBY GHAUT                    1.53398698    0.0625
## DOVER                          0.05922219    0.4764
## DUNEARN                        0.22963815    0.4092
## EVERTON PARK                   0.04697292    0.4813
## FABER                          0.12649726    0.4497
## FAJAR                          0.91985211    0.1788
## FARRER COURT                   0.00499025    0.4980
## FARRER PARK                    1.34388464    0.0895
## FERNVALE                       7.92548117    0.0000
## FLORA DRIVE                    0.34950626    0.3634
## FORT CANNING                   0.57384839    0.2830
## FRANKEL                       -0.00938076    0.5037
## GEYLANG BAHRU                  0.04628316    0.4815
## GEYLANG EAST                   0.09209615    0.4633
## GHIM MOH                      -0.28308063    0.6114
## GOMBAK                        -0.23497556    0.5929
## GOODWOOD PARK                  0.51139084    0.3045
## GUILIN                         0.06111120    0.4756
## HENDERSON HILL                 0.14213863    0.4435
## HILLCREST                     -0.10963710    0.5437
## HILLVIEW                      -0.10655888    0.5424
## HOLLAND DRIVE                 -0.04885105    0.5195
## HOLLAND ROAD                   0.16943813    0.4327
## HONG KAH                       0.11516180    0.4542
## HONG KAH NORTH                 0.77508692    0.2191
## HOUGANG CENTRAL               -3.64496706    0.9999
## HOUGANG EAST                   1.13332245    0.1285
## HOUGANG WEST                   0.94216869    0.1731
## INSTITUTION HILL               0.08604723    0.4657
## JELEBU                        -0.82985985    0.7967
## JOO SENG                       0.05894018    0.4765
## JURONG GATEWAY                 0.22992940    0.4091
## JURONG WEST CENTRAL           -2.56350482    0.9948
## KAKI BUKIT                    -0.44852834    0.6731
## KAMPONG BUGIS                  0.55094451    0.2908
## KAMPONG GLAM                   0.51778311    0.3023
## KAMPONG JAVA                  -0.09799886    0.5390
## KAMPONG TIONG BAHRU            0.04384569    0.4825
## KAMPONG UBI                    0.35459601    0.3614
## KANGKAR                        0.89168267    0.1863
## KATONG                         0.18054016    0.4284
## KEAT HONG                      0.79198763    0.2142
## KEBUN BAHRU                   -0.27132442    0.6069
## KEMBANGAN                     -0.89655632    0.8150
## KHATIB                         0.32615439    0.3722
## KIM KEAT                       0.01399902    0.4944
## KOVAN                         -0.13328001    0.5530
## LAKESIDE                       0.28540141    0.3877
## LAVENDER                       0.50445284    0.3070
## LEEDON PARK                    0.06370929    0.4746
## LEONIE HILL                    0.34744552    0.3641
## LIM CHU KANG                   0.48800198    0.3128
## LITTLE INDIA                   0.22026878    0.4128
## LORONG 8 TOA PAYOH             0.01448336    0.4942
## LORONG AH SOO                 -0.00757267    0.5030
## LORONG CHUAN                  -0.05411217    0.5216
## LOWER SELETAR                  0.98087669    0.1633
## LOYANG EAST                    0.12589987    0.4499
## LOYANG WEST                   -0.27019954    0.6065
## MACKENZIE                      0.60909741    0.2712
## MACPHERSON                    -1.01781231    0.8456
## MALCOLM                        0.68224579    0.2475
## MANDAI ESTATE                 -0.02966944    0.5118
## MARGARET DRIVE                -0.15304649    0.5608
## MARINE PARADE                  0.01790528    0.4929
## MARITIME SQUARE                0.88909138    0.1870
## MARYMOUNT                      0.15669025    0.4377
## MATILDA                        9.35254883    0.0000
## MEI CHIN                      -0.26139566    0.6031
## MIDVIEW                        5.65618425    0.0000
## MONK'S HILL                    0.35334407    0.3619
## MOULMEIN                       0.59665150    0.2754
## MOUNT PLEASANT                 0.40579000    0.3424
## MOUNTBATTEN                   -0.14709131    0.5585
## NASSIM                         0.23539176    0.4070
## NATIONAL UNIVERSITY OF S'PORE  0.79500383    0.2133
## NATURE RESERVE                 0.02524500    0.4899
## NEE SOON                       0.09230513    0.4632
## NEWTON CIRCUS                  0.66540337    0.2529
## NORTH COAST                   -1.66240464    0.9518
## NORTHLAND                     -0.12501646    0.5497
## NORTHSHORE                    -0.90357207    0.8169
## ONE NORTH                      0.22769902    0.4099
## ONE TREE HILL                  0.49361164    0.3108
## ORANGE GROVE                   0.24411112    0.4036
## OXLEY                          0.39861282    0.3451
## PASIR PANJANG 1                0.58825772    0.2782
## PASIR PANJANG 2                0.84839103    0.1981
## PASIR RIS CENTRAL             -0.19534849    0.5774
## PASIR RIS DRIVE                0.36645063    0.3570
## PASIR RIS PARK                -0.00628068    0.5025
## PASIR RIS WEST                -0.51652847    0.6973
## PATERSON                       1.57128482    0.0581
## PEARL'S HILL                   0.49522206    0.3102
## PEI CHUN                       0.00958808    0.4962
## PENG SIANG                     0.35622963    0.3608
## PEOPLE'S PARK                  0.69920802    0.2422
## PORT                           0.89487945    0.1854
## POTONG PASIR                   0.01482781    0.4941
## PUNGGOL FIELD                  8.83220546    0.0000
## PUNGGOL TOWN CENTRE            3.02620210    0.0012
## QUEENSWAY                      0.31223567    0.3774
## REDHILL                        0.19456193    0.4229
## RIDOUT                         0.17678631    0.4298
## RIVERVALE                      7.41253017    0.0000
## ROBERTSON QUAY                 0.38097393    0.3516
## SAUJANA                        1.12434043    0.1304
## SELEGIE                        0.74424573    0.2284
## SELETAR                       -2.06605053    0.9806
## SELETAR HILLS                  1.01324073    0.1555
## SEMBAWANG CENTRAL              1.11079478    0.1333
## SEMBAWANG EAST                 0.18128679    0.4281
## SEMBAWANG HILLS                0.04201243    0.4832
## SEMBAWANG NORTH                0.57730523    0.2819
## SEMBAWANG SPRINGS             -0.03539237    0.5141
## SEMBAWANG STRAITS             -0.09178993    0.5366
## SENGKANG TOWN CENTRE           3.85879803    0.0001
## SENJA                          0.36127533    0.3589
## SENNETT                       -0.30806665    0.6210
## SENTOSA                        0.30832884    0.3789
## SERANGOON CENTRAL             -1.85956726    0.9685
## SERANGOON GARDEN              -0.09249335    0.5368
## SERANGOON NORTH               -0.03936468    0.5157
## SHANGRI-LA                    -0.12642124    0.5503
## SIGLAP                         0.01218251    0.4951
## SIMEI                          1.55197921    0.0603
## SINGAPORE POLYTECHNIC         -0.47781833    0.6836
## SOMERSET                       2.99254368    0.0014
## SPRINGLEAF                    -0.00393981    0.5016
## SUNGEI ROAD                    0.64314778    0.2601
## SUNSET WAY                    -0.03447550    0.5138
## SWISS CLUB                     0.16619390    0.4340
## TAGORE                         0.02639938    0.4895
## TAI SENG                       0.01273831    0.4949
## TAMAN JURONG                   0.23453614    0.4073
## TAMPINES EAST                  1.65892870    0.0486
## TAMPINES NORTH                -1.86958765    0.9692
## TAMPINES WEST                  1.24026942    0.1074
## TANGLIN                        0.46501400    0.3210
## TANGLIN HALT                   0.01945836    0.4922
## TANJONG PAGAR                  0.34895489    0.3636
## TANJONG RHU                   -0.12203436    0.5486
## TEBAN GARDENS                 -0.07078996    0.5282
## TECK WHYE                      0.42500180    0.3354
## TELOK BLANGAH DRIVE           -0.41100435    0.6595
## TELOK BLANGAH RISE             0.00993779    0.4960
## TELOK BLANGAH WAY              0.10848780    0.4568
## TIONG BAHRU                   -0.10767596    0.5429
## TIONG BAHRU STATION            0.23542283    0.4069
## TOA PAYOH CENTRAL              0.42454121    0.3356
## TOA PAYOH WEST                -0.15244459    0.5606
## TOH GUAN                       0.03000117    0.4880
## TOWNSVILLE                    -0.24124856    0.5953
## TRAFALGAR                      3.33175502    0.0004
## TURF CLUB                     -1.25330484    0.8950
## TYERSALL                       0.24402644    0.4036
## ULU PANDAN                    -0.13324503    0.5530
## UPPER PAYA LEBAR              -0.33715627    0.6320
## UPPER THOMSON                  0.03504266    0.4860
## VICTORIA                       1.60795193    0.0539
## WATERWAY EAST                  7.61663929    0.0000
## WENYA                         -0.02133753    0.5085
## WEST COAST                    -0.14767681    0.5587
## WESTERN WATER CATCHMENT       -2.74096966    0.9969
## WOODGROVE                      1.94258545    0.0260
## WOODLANDS EAST                 8.43986388    0.0000
## WOODLANDS SOUTH                7.13374060    0.0000
## WOODLANDS WEST                -0.80532226    0.7897
## WOODLEIGH                      0.03506921    0.4860
## XILIN                         -0.44023278    0.6701
## YEW TEE                        0.15780375    0.4373
## YIO CHU KANG EAST              0.36825905    0.3563
## YIO CHU KANG WEST             -0.81788668    0.7933
## YISHUN CENTRAL                -7.84960106    1.0000
## YISHUN EAST                   -1.53200531    0.9372
## YISHUN SOUTH                  -0.18051756    0.5716
## YISHUN WEST                   -0.64465598    0.7404
## YUHUA EAST                    -0.85700152    0.8043
## YUHUA WEST                    -0.01509412    0.5060
## YUNNAN                        -2.98660373    0.9986

Computing local Moran’s I for TOTAL_TAP_OUT_VOLUME VS Population

Next, we compute local Moran’s I of the Tap Out vs Population residuals at subzone level with given a set of zi values and a listw object providing neighbour weighting information for the polygon associated with the zi values.

localMI_OUT <- localmoran(passenger_resident_tap_sp$residuals_out, rpassenger_resident_tap_sp_q)
head(localMI_OUT)
##            Ii         E.Ii    Var.Ii        Z.Ii Pr(z > 0)
## 2  0.10538999 -0.004329004 0.1189055  0.31818588 0.3751720
## 3  0.28072819 -0.004329004 0.3240451  0.50075962 0.3082702
## 4  0.01285641 -0.004329004 0.1599334  0.04297248 0.4828617
## 5  0.07406694 -0.004329004 0.1927557  0.17856238 0.4291407
## 6  0.15030793 -0.004329004 0.1364889  0.41856665 0.3377664
## 7 -0.12149467 -0.004329004 0.1364889 -0.31714054 0.6244315


printCoefmat(data.frame(localMI_OUT[fips,], row.names=passenger_resident_tap_sp$SUBZONE_N[fips]), check.names=FALSE)
##                                        Ii        E.Ii      Var.Ii
## ADMIRALTY                      8.1788e-02 -4.3290e-03  1.9276e-01
## ALEXANDRA HILL                 1.5031e-01 -4.3290e-03  1.3649e-01
## ALEXANDRA NORTH                1.0137e-02 -4.3290e-03  1.5993e-01
## ALJUNIED                       3.7768e-01 -4.3290e-03  1.1891e-01
## ANAK BUKIT                     3.2391e-02 -4.3290e-03  1.5993e-01
## ANCHORVALE                     3.8112e+00 -4.3290e-03  2.4199e-01
## ANG MO KIO TOWN CENTRE        -6.8674e-01 -4.3290e-03  1.3649e-01
## BALESTIER                      1.8768e-02 -4.3290e-03  1.5993e-01
## BANGKIT                        1.3505e-01 -4.3290e-03  3.2405e-01
## BAYSHORE                       7.8810e-03 -4.3290e-03  2.4199e-01
## BEDOK NORTH                   -6.1078e-01 -4.3290e-03  1.1891e-01
## BEDOK RESERVOIR                3.3044e-01 -4.3290e-03  1.9276e-01
## BEDOK SOUTH                   -2.4659e-01 -4.3290e-03  1.9276e-01
## BENCOOLEN                      2.8960e-01 -4.3290e-03  1.5993e-01
## BENDEMEER                     -2.2209e-01 -4.3290e-03  1.3649e-01
## BISHAN EAST                   -1.7167e-01 -4.3290e-03  1.0523e-01
## BOAT QUAY                      2.8073e-01 -4.3290e-03  3.2405e-01
## BOON KENG                      9.4373e-02 -4.3290e-03  3.2405e-01
## BOON LAY PLACE                 2.3817e-01 -4.3290e-03  1.9276e-01
## BOON TECK                     -4.3701e-02 -4.3290e-03  1.9276e-01
## BOULEVARD                      8.8972e-01 -4.3290e-03  1.1891e-01
## BRADDELL                       5.2802e-02 -4.3290e-03  1.9276e-01
## BRICKWORKS                     3.2846e-02 -4.3290e-03  2.4199e-01
## BUGIS                          8.5348e-01 -4.3290e-03  3.2405e-01
## BUKIT BATOK CENTRAL           -3.7156e-02 -4.3290e-03  1.9276e-01
## BUKIT BATOK EAST               4.2312e-03 -4.3290e-03  2.4199e-01
## BUKIT BATOK SOUTH              1.7505e-03 -4.3290e-03  1.3649e-01
## BUKIT BATOK WEST               1.3127e-02 -4.3290e-03  1.5993e-01
## BUKIT HO SWEE                 -1.2149e-01 -4.3290e-03  1.3649e-01
## BUKIT MERAH                    3.1250e-01 -4.3290e-03  1.3649e-01
## CECIL                          2.6477e-01 -4.3290e-03  3.2405e-01
## CENTRAL SUBZONE                2.7263e-01 -4.3290e-03  4.8816e-01
## CHANGI POINT                   3.0727e-01 -4.3290e-03  9.8049e-01
## CHANGI WEST                    2.5009e-02 -4.3290e-03  1.5993e-01
## CHATSWORTH                     4.3788e-02 -4.3290e-03  1.0523e-01
## CHENG SAN                     -1.6077e-02 -4.3290e-03  1.5993e-01
## CHINA SQUARE                   2.7450e-01 -4.3290e-03  2.4199e-01
## CHINATOWN                      1.9712e-01 -4.3290e-03  1.5993e-01
## CHOA CHU KANG CENTRAL         -8.4423e-01 -4.3290e-03  1.9276e-01
## CHOA CHU KANG NORTH            2.9499e-01 -4.3290e-03  1.9276e-01
## CHONG BOON                     1.9054e-02 -4.3290e-03  1.3649e-01
## CLARKE QUAY                    3.2300e-01 -4.3290e-03  1.9276e-01
## CLEMENTI CENTRAL              -1.8108e-01 -4.3290e-03  1.9276e-01
## CLEMENTI NORTH                -1.9291e-01 -4.3290e-03  1.9276e-01
## CLEMENTI WEST                 -5.4602e-02 -4.3290e-03  1.9276e-01
## CLEMENTI WOODS                -2.8413e-02 -4.3290e-03  1.3649e-01
## COMMONWEALTH                  -2.5212e-02 -4.3290e-03  1.9276e-01
## COMPASSVALE                    1.1733e+00 -4.3290e-03  1.3649e-01
## CORONATION ROAD                5.0183e-02 -4.3290e-03  1.5993e-01
## CRAWFORD                       1.7541e-01 -4.3290e-03  1.9276e-01
## DAIRY FARM                     1.1658e-03 -4.3290e-03  1.9276e-01
## DEPOT ROAD                     1.4410e-02 -4.3290e-03  1.9276e-01
## DHOBY GHAUT                    6.7485e-01 -4.3290e-03  1.9276e-01
## DOVER                          5.8402e-02 -4.3290e-03  1.9276e-01
## DUNEARN                        4.8139e-02 -4.3290e-03  1.9276e-01
## EVERTON PARK                   3.1227e-02 -4.3290e-03  3.2405e-01
## FABER                          4.1297e-02 -4.3290e-03  3.2405e-01
## FAJAR                          5.7574e-01 -4.3290e-03  3.2405e-01
## FARRER COURT                   3.7138e-03 -4.3290e-03  2.4199e-01
## FARRER PARK                    4.5590e-01 -4.3290e-03  1.5993e-01
## FERNVALE                       3.1225e+00 -4.3290e-03  1.5993e-01
## FLORA DRIVE                    1.5598e-01 -4.3290e-03  1.9276e-01
## FORT CANNING                   2.6847e-01 -4.3290e-03  1.9276e-01
## FRANKEL                        9.7398e-04 -4.3290e-03  1.1891e-01
## GEYLANG BAHRU                  2.6827e-02 -4.3290e-03  1.9276e-01
## GEYLANG EAST                   1.9264e-01 -4.3290e-03  1.1891e-01
## GHIM MOH                      -1.3093e-01 -4.3290e-03  1.9276e-01
## GOMBAK                         3.6850e-02 -4.3290e-03  1.1891e-01
## GOODWOOD PARK                  2.2482e-01 -4.3290e-03  1.5993e-01
## GUILIN                        -1.5461e-02 -4.3290e-03  1.5993e-01
## HENDERSON HILL                 1.2856e-02 -4.3290e-03  1.5993e-01
## HILLCREST                     -6.2686e-02 -4.3290e-03  1.9276e-01
## HILLVIEW                      -2.3013e-02 -4.3290e-03  1.3649e-01
## HOLLAND DRIVE                 -3.0535e-02 -4.3290e-03  1.5993e-01
## HOLLAND ROAD                   5.5824e-02 -4.3290e-03  1.5993e-01
## HONG KAH                       2.0777e-03 -4.3290e-03  1.9276e-01
## HONG KAH NORTH                 4.0626e-01 -4.3290e-03  2.4199e-01
## HOUGANG CENTRAL               -1.8704e+00 -4.3290e-03  1.9276e-01
## HOUGANG EAST                   4.8037e-01 -4.3290e-03  1.9276e-01
## HOUGANG WEST                   3.5324e-01 -4.3290e-03  1.3649e-01
## INSTITUTION HILL               4.5863e-02 -4.3290e-03  2.4199e-01
## JELEBU                        -3.2559e-01 -4.3290e-03  1.3649e-01
## JOO SENG                       2.8060e-02 -4.3290e-03  1.9276e-01
## JURONG GATEWAY                 3.2604e-01 -4.3290e-03  3.2405e-01
## JURONG WEST CENTRAL           -1.4123e+00 -4.3290e-03  3.2405e-01
## KAKI BUKIT                    -1.0290e-01 -4.3290e-03  1.9276e-01
## KAMPONG BUGIS                  2.8101e-01 -4.3290e-03  1.9276e-01
## KAMPONG GLAM                   3.6754e-01 -4.3290e-03  4.8816e-01
## KAMPONG JAVA                  -1.5040e-02 -4.3290e-03  1.3649e-01
## KAMPONG TIONG BAHRU            3.6348e-02 -4.3290e-03  1.3649e-01
## KAMPONG UBI                    1.3726e-01 -4.3290e-03  1.3649e-01
## KANGKAR                        3.0878e-01 -4.3290e-03  1.9276e-01
## KATONG                         9.5455e-02 -4.3290e-03  2.4199e-01
## KEAT HONG                      5.5591e-01 -4.3290e-03  1.9276e-01
## KEBUN BAHRU                   -1.5359e-01 -4.3290e-03  1.9276e-01
## KEMBANGAN                     -4.4683e-01 -4.3290e-03  1.5993e-01
## KHATIB                         2.3685e-01 -4.3290e-03  1.3649e-01
## KIM KEAT                      -2.0221e-02 -4.3290e-03  1.5993e-01
## KOVAN                         -5.3071e-02 -4.3290e-03  1.3649e-01
## LAKESIDE                       1.5612e-01 -4.3290e-03  1.5993e-01
## LAVENDER                       1.8951e-01 -4.3290e-03  1.3649e-01
## LEEDON PARK                    5.2314e-03 -4.3290e-03  1.0523e-01
## LEONIE HILL                    1.0031e-01 -4.3290e-03  1.1891e-01
## LIM CHU KANG                   4.6354e-01 -4.3290e-03  9.8049e-01
## LITTLE INDIA                   7.0329e-02 -4.3290e-03  1.5993e-01
## LORONG 8 TOA PAYOH             2.5628e-02 -4.3290e-03  1.3649e-01
## LORONG AH SOO                  2.1006e-02 -4.3290e-03  1.5993e-01
## LORONG CHUAN                  -5.3267e-02 -4.3290e-03  1.3649e-01
## LOWER SELETAR                  4.3284e-01 -4.3290e-03  1.9276e-01
## LOYANG EAST                    5.2864e-02 -4.3290e-03  3.2405e-01
## LOYANG WEST                   -1.8671e-01 -4.3290e-03  1.9276e-01
## MACKENZIE                      2.5741e-01 -4.3290e-03  3.2405e-01
## MACPHERSON                    -4.0406e-01 -4.3290e-03  1.5993e-01
## MALCOLM                        2.6559e-01 -4.3290e-03  1.3649e-01
## MANDAI ESTATE                  3.1563e-02 -4.3290e-03  4.8816e-01
## MARGARET DRIVE                -1.0517e-01 -4.3290e-03  1.0523e-01
## MARINE PARADE                 -6.2610e-03 -4.3290e-03  2.4199e-01
## MARITIME SQUARE                3.3512e-01 -4.3290e-03  1.5993e-01
## MARYMOUNT                     -3.4170e-03 -4.3290e-03  1.5993e-01
## MATILDA                        2.9093e+00 -4.3290e-03  1.1891e-01
## MEI CHIN                      -5.7048e-02 -4.3290e-03  1.5993e-01
## MIDVIEW                        3.3333e+00 -4.3290e-03  3.2405e-01
## MONK'S HILL                    1.4741e-01 -4.3290e-03  2.4199e-01
## MOULMEIN                       2.1099e-01 -4.3290e-03  1.5993e-01
## MOUNT PLEASANT                 1.5174e-01 -4.3290e-03  1.9276e-01
## MOUNTBATTEN                   -6.0152e-02 -4.3290e-03  1.9276e-01
## NASSIM                         3.2582e-02 -4.3290e-03  1.1891e-01
## NATIONAL UNIVERSITY OF S'PORE  4.1637e-01 -4.3290e-03  2.4199e-01
## NATURE RESERVE                 2.0373e-02 -4.3290e-03  2.4199e-01
## NEE SOON                       1.4609e-01 -4.3290e-03  3.2405e-01
## NEWTON CIRCUS                  2.8053e-01 -4.3290e-03  3.2405e-01
## NORTH COAST                    4.6846e-01 -4.3290e-03  9.8049e-01
## NORTHLAND                     -6.0001e-02 -4.3290e-03  1.9276e-01
## NORTHSHORE                    -6.1278e-01 -4.3290e-03  4.8816e-01
## ONE NORTH                      1.3101e-01 -4.3290e-03  1.3649e-01
## ONE TREE HILL                  1.9661e-01 -4.3290e-03  1.9276e-01
## ORANGE GROVE                   1.5995e-01 -4.3290e-03  3.2405e-01
## OXLEY                          1.4861e-01 -4.3290e-03  1.9276e-01
## PASIR PANJANG 1                2.4843e-01 -4.3290e-03  1.9276e-01
## PASIR PANJANG 2                3.2219e-01 -4.3290e-03  2.4199e-01
## PASIR RIS CENTRAL             -2.3697e-01 -4.3290e-03  1.9276e-01
## PASIR RIS DRIVE                8.6499e-02 -4.3290e-03  1.5993e-01
## PASIR RIS PARK                -5.5140e-02 -4.3290e-03  2.4199e-01
## PASIR RIS WEST                -3.6923e-01 -4.3290e-03  3.2405e-01
## PATERSON                       3.8161e-01 -4.3290e-03  1.9276e-01
## PEARL'S HILL                   1.0539e-01 -4.3290e-03  1.1891e-01
## PEI CHUN                       2.5097e-03 -4.3290e-03  1.9276e-01
## PENG SIANG                     1.6031e-01 -4.3290e-03  2.4199e-01
## PEOPLE'S PARK                  3.5426e-01 -4.3290e-03  4.8816e-01
## PORT                           4.1920e-01 -4.3290e-03  2.4199e-01
## POTONG PASIR                  -5.9535e-05 -4.3290e-03  1.3649e-01
## PUNGGOL FIELD                  4.1816e+00 -4.3290e-03  1.9276e-01
## PUNGGOL TOWN CENTRE            1.4360e+00 -4.3290e-03  1.9276e-01
## QUEENSWAY                      2.1440e-01 -4.3290e-03  2.4199e-01
## REDHILL                        7.4067e-02 -4.3290e-03  1.9276e-01
## RIDOUT                         4.0532e-02 -4.3290e-03  1.3649e-01
## RIVERVALE                      2.9363e+00 -4.3290e-03  1.5993e-01
## ROBERTSON QUAY                 1.1435e-01 -4.3290e-03  1.3649e-01
## SAUJANA                        5.5425e-01 -4.3290e-03  3.2405e-01
## SELEGIE                        2.9357e-01 -4.3290e-03  1.9276e-01
## SELETAR                       -1.1574e+00 -4.3290e-03  3.2405e-01
## SELETAR HILLS                  3.6534e-01 -4.3290e-03  1.9276e-01
## SEMBAWANG CENTRAL              6.9202e-01 -4.3290e-03  2.4199e-01
## SEMBAWANG EAST                 5.2629e-02 -4.3290e-03  1.9276e-01
## SEMBAWANG HILLS               -1.9207e-02 -4.3290e-03  1.9276e-01
## SEMBAWANG NORTH                3.5677e-01 -4.3290e-03  4.8816e-01
## SEMBAWANG SPRINGS             -3.6212e-03 -4.3290e-03  1.9276e-01
## SEMBAWANG STRAITS             -4.2975e-02 -4.3290e-03  4.8816e-01
## SENGKANG TOWN CENTRE           1.9647e+00 -4.3290e-03  1.9276e-01
## SENJA                          1.4895e-01 -4.3290e-03  2.4199e-01
## SENNETT                       -7.8305e-02 -4.3290e-03  1.5993e-01
## SENTOSA                        4.0068e-01 -4.3290e-03  9.8049e-01
## SERANGOON CENTRAL             -5.5912e-01 -4.3290e-03  1.9276e-01
## SERANGOON GARDEN              -5.1179e-02 -4.3290e-03  1.1891e-01
## SERANGOON NORTH               -1.3603e-01 -4.3290e-03  1.9276e-01
## SHANGRI-LA                    -5.1029e-03 -4.3290e-03  1.5993e-01
## SIGLAP                        -3.1087e-03 -4.3290e-03  3.2405e-01
## SIMEI                          5.8282e-01 -4.3290e-03  1.5993e-01
## SINGAPORE POLYTECHNIC         -1.5243e-01 -4.3290e-03  1.5993e-01
## SOMERSET                       1.0222e+00 -4.3290e-03  1.5993e-01
## SPRINGLEAF                    -8.7502e-03 -4.3290e-03  1.9276e-01
## SUNGEI ROAD                    2.7890e-01 -4.3290e-03  2.4199e-01
## SUNSET WAY                    -1.2854e-02 -4.3290e-03  1.5993e-01
## SWISS CLUB                     1.0853e-01 -4.3290e-03  1.9276e-01
## TAGORE                         5.1800e-03 -4.3290e-03  1.9276e-01
## TAI SENG                      -9.9555e-03 -4.3290e-03  1.9276e-01
## TAMAN JURONG                   6.4237e-02 -4.3290e-03  3.2405e-01
## TAMPINES EAST                  6.0376e-01 -4.3290e-03  1.1891e-01
## TAMPINES NORTH                -6.2095e-01 -4.3290e-03  1.9276e-01
## TAMPINES WEST                  5.9318e-01 -4.3290e-03  1.9276e-01
## TANGLIN                        2.0067e-01 -4.3290e-03  1.9276e-01
## TANGLIN HALT                   1.3917e-02 -4.3290e-03  1.9276e-01
## TANJONG PAGAR                  1.5022e-01 -4.3290e-03  3.2405e-01
## TANJONG RHU                   -9.1535e-02 -4.3290e-03  2.4199e-01
## TEBAN GARDENS                 -1.0636e-02 -4.3290e-03  4.8816e-01
## TECK WHYE                      2.0025e-01 -4.3290e-03  1.5993e-01
## TELOK BLANGAH DRIVE           -6.7022e-02 -4.3290e-03  2.4199e-01
## TELOK BLANGAH RISE            -6.0596e-03 -4.3290e-03  2.4199e-01
## TELOK BLANGAH WAY             -1.8016e-02 -4.3290e-03  1.5993e-01
## TIONG BAHRU                   -3.3267e-02 -4.3290e-03  2.4199e-01
## TIONG BAHRU STATION            1.0799e-01 -4.3290e-03  1.9276e-01
## TOA PAYOH CENTRAL              1.3907e-01 -4.3290e-03  1.3649e-01
## TOA PAYOH WEST                -7.7198e-02 -4.3290e-03  1.5993e-01
## TOH GUAN                       2.6612e-02 -4.3290e-03  2.4199e-01
## TOWNSVILLE                    -1.7755e-01 -4.3290e-03  1.3649e-01
## TRAFALGAR                      1.5993e+00 -4.3290e-03  1.9276e-01
## TURF CLUB                     -6.7380e-01 -4.3290e-03  4.8816e-01
## TYERSALL                       4.6069e-02 -4.3290e-03  1.3649e-01
## ULU PANDAN                    -3.5311e-02 -4.3290e-03  1.5993e-01
## UPPER PAYA LEBAR              -5.0883e-02 -4.3290e-03  1.5993e-01
## UPPER THOMSON                  1.1194e-02 -4.3290e-03  2.4199e-01
## VICTORIA                       6.6427e-01 -4.3290e-03  2.4199e-01
## WATERWAY EAST                  3.7388e+00 -4.3290e-03  2.4199e-01
## WENYA                         -8.1321e-03 -4.3290e-03  1.9276e-01
## WEST COAST                    -1.7164e-02 -4.3290e-03  2.4199e-01
## WESTERN WATER CATCHMENT       -1.1987e+00 -4.3290e-03  1.3649e-01
## WOODGROVE                      8.5148e-01 -4.3290e-03  2.4199e-01
## WOODLANDS EAST                 4.7361e+00 -4.3290e-03  3.2405e-01
## WOODLANDS SOUTH                4.2192e+00 -4.3290e-03  3.2405e-01
## WOODLANDS WEST                 1.0885e-01 -4.3290e-03  3.2405e-01
## WOODLEIGH                      5.7887e-02 -4.3290e-03  1.3649e-01
## XILIN                         -2.3064e-01 -4.3290e-03  1.5993e-01
## YEW TEE                        9.8881e-02 -4.3290e-03  4.8816e-01
## YIO CHU KANG EAST              2.3336e-01 -4.3290e-03  3.2405e-01
## YIO CHU KANG WEST             -4.0076e-01 -4.3290e-03  2.4199e-01
## YISHUN CENTRAL                -3.7574e+00 -4.3290e-03  1.9276e-01
## YISHUN EAST                   -5.6833e-01 -4.3290e-03  2.4199e-01
## YISHUN SOUTH                  -3.3366e-01 -4.3290e-03  1.5993e-01
## YISHUN WEST                   -4.1800e-01 -4.3290e-03  1.3649e-01
## YUHUA EAST                    -3.4522e-01 -4.3290e-03  1.9276e-01
## YUHUA WEST                     3.6823e-03 -4.3290e-03  2.4199e-01
## YUNNAN                        -1.5012e+00 -4.3290e-03  2.4199e-01
##                                      Z.Ii Pr.z...0.
## ADMIRALTY                      1.9615e-01    0.4222
## ALEXANDRA HILL                 4.1857e-01    0.3378
## ALEXANDRA NORTH                3.6171e-02    0.4856
## ALJUNIED                       1.1078e+00    0.1340
## ANAK BUKIT                     9.1819e-02    0.4634
## ANCHORVALE                     7.7564e+00    0.0000
## ANG MO KIO TOWN CENTRE        -1.8471e+00    0.9676
## BALESTIER                      5.7754e-02    0.4770
## BANGKIT                        2.4485e-01    0.4033
## BAYSHORE                       2.4821e-02    0.4901
## BEDOK NORTH                   -1.7587e+00    0.9607
## BEDOK RESERVOIR                7.6250e-01    0.2229
## BEDOK SOUTH                   -5.5180e-01    0.7095
## BENCOOLEN                      7.3499e-01    0.2312
## BENDEMEER                     -5.8944e-01    0.7222
## BISHAN EAST                   -5.1585e-01    0.6970
## BOAT QUAY                      5.0076e-01    0.3083
## BOON KENG                      1.7339e-01    0.4312
## BOON LAY PLACE                 5.5233e-01    0.2904
## BOON TECK                     -8.9678e-02    0.5357
## BOULEVARD                      2.5928e+00    0.0048
## BRADDELL                       1.3013e-01    0.4482
## BRICKWORKS                     7.5570e-02    0.4699
## BUGIS                          1.5069e+00    0.0659
## BUKIT BATOK CENTRAL           -7.4769e-02    0.5298
## BUKIT BATOK EAST               1.7402e-02    0.4931
## BUKIT BATOK SOUTH              1.6456e-02    0.4934
## BUKIT BATOK WEST               4.3649e-02    0.4826
## BUKIT HO SWEE                 -3.1714e-01    0.6244
## BUKIT MERAH                    8.5760e-01    0.1956
## CECIL                          4.7273e-01    0.3182
## CENTRAL SUBZONE                3.9641e-01    0.3459
## CHANGI POINT                   3.1468e-01    0.3765
## CHANGI WEST                    7.3360e-02    0.4708
## CHATSWORTH                     1.4833e-01    0.4410
## CHENG SAN                     -2.9376e-02    0.5117
## CHINA SQUARE                   5.6682e-01    0.2854
## CHINATOWN                      5.0372e-01    0.3072
## CHOA CHU KANG CENTRAL         -1.9131e+00    0.9721
## CHOA CHU KANG NORTH            6.8176e-01    0.2477
## CHONG BOON                     6.3293e-02    0.4748
## CLARKE QUAY                    7.4556e-01    0.2280
## CLEMENTI CENTRAL              -4.0260e-01    0.6564
## CLEMENTI NORTH                -4.2954e-01    0.6662
## CLEMENTI WEST                 -1.1451e-01    0.5456
## CLEMENTI WOODS                -6.5191e-02    0.5260
## COMMONWEALTH                  -4.7565e-02    0.5190
## COMPASSVALE                    3.1876e+00    0.0007
## CORONATION ROAD                1.3631e-01    0.4458
## CRAWFORD                       4.0939e-01    0.3411
## DAIRY FARM                     1.2515e-02    0.4950
## DEPOT ROAD                     4.2683e-02    0.4830
## DHOBY GHAUT                    1.5470e+00    0.0609
## DOVER                          1.4288e-01    0.4432
## DUNEARN                        1.1951e-01    0.4524
## EVERTON PARK                   6.2460e-02    0.4751
## FABER                          8.0150e-02    0.4681
## FAJAR                          1.0190e+00    0.1541
## FARRER COURT                   1.6350e-02    0.4935
## FARRER PARK                    1.1508e+00    0.1249
## FERNVALE                       7.8187e+00    0.0000
## FLORA DRIVE                    3.6514e-01    0.3575
## FORT CANNING                   6.2136e-01    0.2672
## FRANKEL                        1.5379e-02    0.4939
## GEYLANG BAHRU                  7.0964e-02    0.4717
## GEYLANG EAST                   5.7121e-01    0.2839
## GHIM MOH                      -2.8837e-01    0.6135
## GOMBAK                         1.1942e-01    0.4525
## GOODWOOD PARK                  5.7299e-01    0.2833
## GUILIN                        -2.7835e-02    0.5111
## HENDERSON HILL                 4.2972e-02    0.4829
## HILLCREST                     -1.3292e-01    0.5529
## HILLVIEW                      -5.0574e-02    0.5202
## HOLLAND DRIVE                 -6.5528e-02    0.5261
## HOLLAND ROAD                   1.5041e-01    0.4402
## HONG KAH                       1.4592e-02    0.4942
## HONG KAH NORTH                 8.3466e-01    0.2020
## HOUGANG CENTRAL               -4.2504e+00    1.0000
## HOUGANG EAST                   1.1040e+00    0.1348
## HOUGANG WEST                   9.6786e-01    0.1666
## INSTITUTION HILL               1.0203e-01    0.4594
## JELEBU                        -8.6959e-01    0.8077
## JOO SENG                       7.3773e-02    0.4706
## JURONG GATEWAY                 5.8035e-01    0.2808
## JURONG WEST CENTRAL           -2.4733e+00    0.9933
## KAKI BUKIT                    -2.2451e-01    0.5888
## KAMPONG BUGIS                  6.4992e-01    0.2579
## KAMPONG GLAM                   5.3224e-01    0.2973
## KAMPONG JAVA                  -2.8991e-02    0.5116
## KAMPONG TIONG BAHRU            1.1010e-01    0.4562
## KAMPONG UBI                    3.8325e-01    0.3508
## KANGKAR                        7.1317e-01    0.2379
## KATONG                         2.0284e-01    0.4196
## KEAT HONG                      1.2761e+00    0.1010
## KEBUN BAHRU                   -3.3997e-01    0.6331
## KEMBANGAN                     -1.1065e+00    0.8657
## KHATIB                         6.5282e-01    0.2569
## KIM KEAT                      -3.9738e-02    0.5158
## KOVAN                         -1.3193e-01    0.5525
## LAKESIDE                       4.0121e-01    0.3441
## LAVENDER                       5.2467e-01    0.2999
## LEEDON PARK                    2.9472e-02    0.4882
## LEONIE HILL                    3.0346e-01    0.3808
## LIM CHU KANG                   4.7250e-01    0.3183
## LITTLE INDIA                   1.8668e-01    0.4260
## LORONG 8 TOA PAYOH             8.1087e-02    0.4677
## LORONG AH SOO                  6.3350e-02    0.4747
## LORONG CHUAN                  -1.3246e-01    0.5527
## LOWER SELETAR                  9.9573e-01    0.1597
## LOYANG EAST                    1.0047e-01    0.4600
## LOYANG WEST                   -4.1541e-01    0.6611
## MACKENZIE                      4.5979e-01    0.3228
## MACPHERSON                    -9.9954e-01    0.8412
## MALCOLM                        7.3062e-01    0.2325
## MANDAI ESTATE                  5.1372e-02    0.4795
## MARGARET DRIVE                -3.1087e-01    0.6220
## MARINE PARADE                 -3.9275e-03    0.5016
## MARITIME SQUARE                8.4881e-01    0.1980
## MARYMOUNT                      2.2805e-03    0.4991
## MATILDA                        8.4496e+00    0.0000
## MEI CHIN                      -1.3182e-01    0.5524
## MIDVIEW                        5.8633e+00    0.0000
## MONK'S HILL                    3.0847e-01    0.3789
## MOULMEIN                       5.3841e-01    0.2951
## MOUNT PLEASANT                 3.5548e-01    0.3611
## MOUNTBATTEN                   -1.2715e-01    0.5506
## NASSIM                         1.0704e-01    0.4574
## NATIONAL UNIVERSITY OF S'PORE  8.5520e-01    0.1962
## NATURE RESERVE                 5.0214e-02    0.4800
## NEE SOON                       2.6424e-01    0.3958
## NEWTON CIRCUS                  5.0041e-01    0.3084
## NORTH COAST                    4.7747e-01    0.3165
## NORTHLAND                     -1.2680e-01    0.5505
## NORTHSHORE                    -8.7086e-01    0.8081
## ONE NORTH                      3.6633e-01    0.3571
## ONE TREE HILL                  4.5768e-01    0.3236
## ORANGE GROVE                   2.8858e-01    0.3865
## OXLEY                          3.4836e-01    0.3638
## PASIR PANJANG 1                5.7570e-01    0.2824
## PASIR PANJANG 2                6.6377e-01    0.2534
## PASIR RIS CENTRAL             -5.2988e-01    0.7019
## PASIR RIS DRIVE                2.2712e-01    0.4102
## PASIR RIS PARK                -1.0329e-01    0.5411
## PASIR RIS WEST                -6.4102e-01    0.7392
## PATERSON                       8.7905e-01    0.1897
## PEARL'S HILL                   3.1819e-01    0.3752
## PEI CHUN                       1.5577e-02    0.4938
## PENG SIANG                     3.3468e-01    0.3689
## PEOPLE'S PARK                  5.1324e-01    0.3039
## PORT                           8.6097e-01    0.1946
## POTONG PASIR                   1.1556e-02    0.4954
## PUNGGOL FIELD                  9.5344e+00    0.0000
## PUNGGOL TOWN CENTRE            3.2807e+00    0.0005
## QUEENSWAY                      4.4464e-01    0.3283
## REDHILL                        1.7856e-01    0.4291
## RIDOUT                         1.2143e-01    0.4517
## RIVERVALE                      7.3531e+00    0.0000
## ROBERTSON QUAY                 3.2124e-01    0.3740
## SAUJANA                        9.8125e-01    0.1632
## SELEGIE                        6.7852e-01    0.2487
## SELETAR                       -2.0256e+00    0.9786
## SELETAR HILLS                  8.4199e-01    0.1999
## SEMBAWANG CENTRAL              1.4156e+00    0.0785
## SEMBAWANG EAST                 1.2973e-01    0.4484
## SEMBAWANG HILLS               -3.3887e-02    0.5135
## SEMBAWANG NORTH                5.1683e-01    0.3026
## SEMBAWANG SPRINGS              1.6122e-03    0.4994
## SEMBAWANG STRAITS             -5.5312e-02    0.5221
## SENGKANG TOWN CENTRE           4.4849e+00    0.0000
## SENJA                          3.1159e-01    0.3777
## SENNETT                       -1.8498e-01    0.5734
## SENTOSA                        4.0902e-01    0.3413
## SERANGOON CENTRAL             -1.2636e+00    0.8968
## SERANGOON GARDEN              -1.3587e-01    0.5540
## SERANGOON NORTH               -2.9997e-01    0.6179
## SHANGRI-LA                    -1.9352e-03    0.5008
## SIGLAP                         2.1436e-03    0.4991
## SIMEI                          1.4682e+00    0.0710
## SINGAPORE POLYTECHNIC         -3.7033e-01    0.6444
## SOMERSET                       2.5668e+00    0.0051
## SPRINGLEAF                    -1.0070e-02    0.5040
## SUNGEI ROAD                    5.7577e-01    0.2824
## SUNSET WAY                    -2.1318e-02    0.5085
## SWISS CLUB                     2.5706e-01    0.3986
## TAGORE                         2.1659e-02    0.4914
## TAI SENG                      -1.2816e-02    0.5051
## TAMAN JURONG                   1.2045e-01    0.4521
## TAMPINES EAST                  1.7635e+00    0.0389
## TAMPINES NORTH                -1.4045e+00    0.9199
## TAMPINES WEST                  1.3610e+00    0.0868
## TANGLIN                        4.6691e-01    0.3203
## TANGLIN HALT                   4.1558e-02    0.4834
## TANJONG PAGAR                  2.7149e-01    0.3930
## TANJONG RHU                   -1.7727e-01    0.5704
## TEBAN GARDENS                 -9.0265e-03    0.5036
## TECK WHYE                      5.1155e-01    0.3045
## TELOK BLANGAH DRIVE           -1.2744e-01    0.5507
## TELOK BLANGAH RISE            -3.5180e-03    0.5014
## TELOK BLANGAH WAY             -3.4224e-02    0.5137
## TIONG BAHRU                   -5.8826e-02    0.5235
## TIONG BAHRU STATION            2.5582e-01    0.3990
## TOA PAYOH CENTRAL              3.8816e-01    0.3489
## TOA PAYOH WEST                -1.8221e-01    0.5723
## TOH GUAN                       6.2898e-02    0.4749
## TOWNSVILLE                    -4.6886e-01    0.6804
## TRAFALGAR                      3.6526e+00    0.0001
## TURF CLUB                     -9.5819e-01    0.8310
## TYERSALL                       1.3642e-01    0.4457
## ULU PANDAN                    -7.7472e-02    0.5309
## UPPER PAYA LEBAR              -1.1641e-01    0.5463
## UPPER THOMSON                  3.1555e-02    0.4874
## VICTORIA                       1.3592e+00    0.0870
## WATERWAY EAST                  7.6092e+00    0.0000
## WENYA                         -8.6622e-03    0.5035
## WEST COAST                    -2.6092e-02    0.5104
## WESTERN WATER CATCHMENT       -3.2330e+00    0.9994
## WOODGROVE                      1.7397e+00    0.0410
## WOODLANDS EAST                 8.3275e+00    0.0000
## WOODLANDS SOUTH                7.4194e+00    0.0000
## WOODLANDS WEST                 1.9883e-01    0.4212
## WOODLEIGH                      1.6840e-01    0.4331
## XILIN                         -5.6590e-01    0.7143
## YEW TEE                        1.4772e-01    0.4413
## YIO CHU KANG EAST              4.1755e-01    0.3381
## YIO CHU KANG WEST             -8.0588e-01    0.7898
## YISHUN CENTRAL                -8.5484e+00    1.0000
## YISHUN EAST                   -1.1465e+00    0.8742
## YISHUN SOUTH                  -8.2350e-01    0.7949
## YISHUN WEST                   -1.1197e+00    0.8686
## YUHUA EAST                    -7.7644e-01    0.7813
## YUHUA WEST                     1.6286e-02    0.4935
## YUNNAN                        -3.0429e+00    0.9988

Mapping the local Moran’s I for TOTAL_TAP_IN_VOLUME VS Population

Before mapping the local Moran’s I map, it is wise to append the local Moran’s I dataframe (i.e. localMI) onto passenger_resident_tap_sp SpatialPolygonDataFrame.

passenger_resident_tap_sp.localMI <- cbind(passenger_resident_tap_sp,localMI)

Mapping both local Moran’s I values and p-values

Using choropleth mapping functions of tmap package, we can plot both the local Moran’s I values map and its correpence p-values map next to each other for Tap In vs Population.

localMI.map <- tm_shape(passenger_resident_tap_sp.localMI) +
  tm_fill(col = "Ii", 
          style = "pretty", 
          title = "local moran statistics") +
  tm_borders(alpha = 0.5)

pvalue.map <- tm_shape(passenger_resident_tap_sp.localMI) +
  tm_fill(col = "Pr.z...0.", 
          breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
          palette="-Blues", 
          title = "local Moran's I p-values") +
  tm_borders(alpha = 0.5)

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

Mapping the local Moran’s I for Tap In VS Population

passenger_resident_tap_sp.localMI_OUT <- cbind(passenger_resident_tap_sp,localMI_OUT)

Mapping both local Moran’s I values and p-values

Using choropleth mapping functions of tmap package, we can plot both the local Moran’s I values map and its correpence p-values map next to each other for Tap Out vs Population.

localMI_OUT.map <- tm_shape(passenger_resident_tap_sp.localMI_OUT) +
  tm_fill(col = "Ii", 
          style = "pretty", 
          title = "local moran statistics") +
  tm_borders(alpha = 0.5)

pvalue_OUT.map <- tm_shape(passenger_resident_tap_sp.localMI_OUT) +
  tm_fill(col = "Pr.z...0.", 
          breaks=c(-Inf, 0.001, 0.01, 0.05, 0.1, Inf),
          palette="-Blues", 
          title = "local Moran's I p-values") +
  tm_borders(alpha = 0.5)

tmap_arrange(localMI_OUT.map, pvalue_OUT.map, asp=1, ncol=2, sync = TRUE)

Creating a LISA Cluster Map for Tap out VS Population

The LISA Cluster Map shows the significant locations color coded by type of spatial autocorrelation. The first step before we can generate the LISA cluster map is to plot the Moran scatterplot.

Plotting Moran scatterplot

The code chunk below plots the Moran scatterplot of Tap in vs Population residuals to illustrate the relationship between the values of the chosen attribute at each location and the average value of the same attribute at neighboring locations

nci <- moran.plot(passenger_resident_tap_sp$TOTAL_TAP_IN_VOLUME, rpassenger_resident_tap_sp_q, labels=as.character(passenger_resident_tap_sp$SUBZONE_N), xlab="Residuals", ylab="Spatially Lag Residuals")


### Plotting Moran scatterplot with standardised variable Scaling the variable of interest by dividing the (centered) variable by their standard deviations.

passenger_resident_tap_sp$Z.TOTAL_TAP_IN_VOLUME <- scale(passenger_resident_tap_sp$TOTAL_TAP_IN_VOLUME) %>% as.vector 


We then plot the Moran scatterplot again with the scaled data.

nci2 <- moran.plot(passenger_resident_tap_sp$Z.TOTAL_TAP_IN_VOLUME, rpassenger_resident_tap_sp_q, labels=as.character(passenger_resident_tap_sp$SUBZONE_N), xlab="z-Residuals", ylab="Spatially Lag Residuals")


With the local Moran I values, we plot a LISA cluster map. But to do so, we have to create the quadrants such that we can view the clusters and outliers.As we are testing at the confidence interval oof 95%, we set the significance level to 0.05.

quadrant <- vector(mode="numeric",length=nrow(localMI))
DV <- passenger_resident_tap_sp$residuals - mean(passenger_resident_tap_sp$residuals)     
C_mI <- localMI[,1] - mean(localMI[,1])    
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

Creating a LISA Cluster Map for Tap Out VS Population

The LISA Cluster Map shows the significant locations color coded by type of spatial autocorrelation. The first step before we can generate the LISA cluster map is to plot the Moran scatterplot.

Plotting Moran scatterplot

The Moran scatterplot is an illustration of the relationship between the values of the chosen attribute at each location and the average value of the same attribute at neighboring locations.
The code chunk below plots the Moran scatterplot of GDPPC 2012 by using moran.plot() of spdep.

nci_OUT <- moran.plot(passenger_resident_tap_sp$TOTAL_TAP_OUT_VOLUME, rpassenger_resident_tap_sp_q, labels=as.character(passenger_resident_tap_sp$SUBZONE_N), xlab="Residuals", ylab="Spatially Lag Residuals")

Plotting Moran scatterplot with standardised variable

First we will use scale() to centers and scales the variable. here centering is done by subtracting the mean (omitting NAs) the corresponding columns, and scaling is done by dividing the (centered) variable by their standard deviations.

passenger_resident_tap_sp$Z.TOTAL_TAP_OUT_VOLUME <- scale(passenger_resident_tap_sp$TOTAL_TAP_OUT_VOLUME) %>% as.vector 


The as.vector() added to the end is to make sure that the data type we get out of this is a vector, that map neatly into out dataframe.

Now, we are ready to plot the Moran scatterplot again by using the code chunk below.

nci2_OUT <- moran.plot(passenger_resident_tap_sp$Z.TOTAL_TAP_OUT_VOLUME, rpassenger_resident_tap_sp_q, labels=as.character(passenger_resident_tap_sp$SUBZONE_N), xlab="z-Residuals", ylab="Spatially Lag Residuals")


quadrant_OUT <- vector(mode="numeric",length=nrow(localMI_OUT))
DV_OUT <- passenger_resident_tap_sp$residuals_out - mean(passenger_resident_tap_sp$residuals_out)     
C_mI_OUT <- localMI_OUT[,1] - mean(localMI_OUT[,1])    
signif <- 0.05       
quadrant_OUT[DV_OUT >0 & C_mI_OUT>0] <- 4      
quadrant_OUT[DV_OUT <0 & C_mI_OUT<0] <- 1      
quadrant_OUT[DV_OUT <0 & C_mI_OUT>0] <- 2
quadrant_OUT[DV_OUT >0 & C_mI_OUT<0] <- 3
quadrant_OUT[localMI_OUT[,5]>signif] <- 0

Plotting LISA map for bot Tap in vs Population residuals and Tap Out vs Population residuals

Now, we can build the LISA map by using the code chunks below.

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

lisa_in <- tm_shape(passenger_resident_tap_sp.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)

passenger_resident_tap_sp.localMI_OUT$quadrant_OUT <- quadrant_OUT
colors <- c("#ffffff", "#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
clusters <- c("insignificant", "low-low", "low-high", "high-low", "high-high")

lisa_out <- tm_shape(passenger_resident_tap_sp.localMI_OUT) +
  tm_fill(col = "quadrant_OUT", style = "cat", palette = colors[c(sort(unique(quadrant_OUT)))+1], labels = clusters[c(sort(unique(quadrant_OUT)))+1], popup.vars = c("SUBZONE_N")) +
  tm_view(set.zoom.limits = c(11,17)) +
  tm_borders(alpha=0.5)

tmap_arrange(lisa_in,lisa_out, sync = TRUE, asp=1, ncol=2)

As seen from both Tap in vs Population residuals and Tap Out vs Population residuals, the map displayed is very similar.

The above map shows the lisa map. The high-high indicates a cluster with subzones that are of high value and so are their neighbours, and low-high indicates outliers which the subzones are of low value but the neighbours are of high value.

As seen from both graphs:
1. Woodlands east, Midview, Woodlands South, Woord Groove and their resepctive neighbours belong to one cluster
2. Fernvale, Trafalgar, Compassvale, Rivervale, Sengkang Town Centre, Punggol field, Waterway East, Punggol Town Centre, Matilda, Anchorvale and their respective neighbours belong to one cluster
3. Tampines East and its neighbours belong to one cluster
4. Boulevard and Somerset are low outliers among high neighbours

Getis and Ord’s G-Statistics for Tap In VS Population

Beside detecting cluster and outliers, localised spatial statistics can be also used to detect hot spot and/or cold spot areas - Getis and Ord’s G-statistics. Here, statistically significant hot-spots are recognised as areas of high values where other areas within a neighbourhood range also share high values too.

The analysis consists of 2 steps using the queens weight matrix:
1. Computing Gi statistics
2. Mapping Gi statistics

Computing Gi statistics using queens contiguity

Here, we compute the Gi values for Tap in vs Population residuals by using queens contiguity. The Gi statistics is represented as a Z-score. Greater values represent a greater intensity of clustering and the direction (positive or negative) indicates high or low clusters. Next, we will join the Gi values to their correponding hunan SpatialPolygonDataFrame using the code chunk below.

fips <- order(passenger_resident_tap_sp$SUBZONE_N)
gi.queen <- localG(passenger_resident_tap_sp$residuals, rpassenger_resident_tap_sp_q)
gi.queen
##   [1] -1.131389104 -1.052851820 -0.849194744 -0.732067603 -0.596358263
##   [6] -0.868753109 -1.034401737 -0.806017875 -0.554398023 -0.162167392
##  [11] -0.682862528 -0.722604815 -2.037692923 -0.450953899 -1.175238522
##  [16] -0.827298893 -0.782293285 -1.339515873 -1.517418874 -0.696493779
##  [21] -0.808918913 -0.744762040 -0.707177452 -1.214686450 -1.182240589
##  [26] -0.446923893 -0.260378410 -1.502837304 -0.851345298 -0.889022673
##  [31] -1.649697458 -1.911237009 -1.954329071 -2.124206863 -1.563886636
##  [36] -1.427976055 -1.236585930 -1.136562061 -2.003563424 -1.137883724
##  [41] -1.000954011 -0.383352931 -0.258627410 -0.948528738 -1.480678723
##  [46] -0.223860190 -0.829633546 -1.260644606  0.283592816 -1.093007603
##  [51] -0.426153279 -1.628626136 -1.577258117 -0.042463393 -1.764360717
##  [56] -1.452464569 -1.035278219 -1.347833570 -2.058392681 -1.281003347
##  [61] -0.674141870 -1.635540429 -1.093537040  0.348341848 -0.667094002
##  [66] -1.070098944 -1.575481204 -1.408063713 -0.605009909 -1.457651504
##  [71] -0.064254000 -0.245317558 -1.184666519 -1.446074211 -0.178046076
##  [76] -0.613653998 -0.740709163 -0.525682787 -1.008354240 -0.751499341
##  [81] -0.287804050 -1.054811490 -0.745289323 -0.657178580 -0.497258607
##  [86] -1.872771533  0.477781133  0.238509291 -1.065829326 -0.983357104
##  [91] -0.379724102 -0.095165556 -0.288017589 -0.349085227  0.519271110
##  [96]  0.033025891 -0.005053576 -0.908003288 -0.098099629  0.524098390
## [101] -0.433866230 -0.878192957 -0.959771587 -1.597357699 -0.007174465
## [106]  1.671987678  1.801732189 -1.028657083 -0.817394653 -0.297428050
## [111] -0.024870947 -1.124618624 -0.799324081 -0.936557562 -0.455500434
## [116] -0.738506055 -0.249476264 -1.566988561 -0.437597356 -0.070119734
## [121] -0.348388312  1.022664649  0.149838998  0.140675192  0.330459172
## [126] -0.797998053  0.114731318  1.041419912  0.679312197  0.508627770
## [131]  0.387305909  0.355016657  0.323908605  0.467063910 -0.068155830
## [136]  1.359092780 -0.070534957  0.601862281 -1.218373501 -0.280375214
## [141] -0.608294695 -0.506790759 -1.807313130 -0.097156638  2.140532675
## [146] -0.250964221  1.424735329  0.747402860  0.764618151  1.550801463
## [151]  0.448751547  0.871496080  0.525195730 -0.149133775 -0.655503628
## [156]  0.758079545  1.669584978  0.299503156 -0.427715388 -1.015099834
## [161]  2.446512475  0.780823788  1.635123262 -0.088563486  0.666249856
## [166]  0.568441558  0.860162311  1.757802089  4.596558424 -1.368401014
## [171]  0.584257628  0.528870022 -0.728335870  0.723754611 -0.223378368
## [176]  0.479424467  1.001681730 -0.673159368 -0.232701197 -0.440569915
## [181] -0.486528111 -0.085569437  1.646962767 -0.428686748 -0.037677039
## [186]  0.210315256  3.008424684 -0.284557503  0.613927358 -0.513916484
## [191]  2.091036547  1.635446195  1.390751826  1.233224937  0.326991633
## [196]  3.100733614  2.605007582  4.296608095  0.098079600  5.277630656
## [201]  2.394110965 -0.735126286  4.181360860  3.299042278 -0.155230235
## [206]  1.418991130  3.055255947  0.182807973  2.086971738  1.382737039
## [211]  3.893365305  1.500316434 -0.606617890  1.937238377 -0.898461455
## [216]  2.181438969  2.698270960  0.731134316  0.612202928 -1.396876726
## [221]  0.593837929 -0.176945016  4.153174225 -1.190386541  1.126420660
## [226]  0.480726773  2.803107786 -0.264699595  3.437636712 -0.687163949
## [231]  0.669090997  0.464094524
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = passenger_resident_tap_sp$residuals, listw = rpassenger_resident_tap_sp_q)
## attr(,"class")
## [1] "localG"


Next, we bind the gi data into passenger_resident_tap_sp.gi. To change the data name, we have to count the number of data there are and changed the last index.

passenger_resident_tap_sp.gi<- cbind(passenger_resident_tap_sp, as.matrix(gi.queen))
a= names(passenger_resident_tap_sp.gi)
length(a)
## [1] 25


names(passenger_resident_tap_sp.gi)[25]="gstat"

Getis and Ord’s G-Statistics for Tap Out VS Population

Computing Gi statistics using queens contiguity

fips <- order(passenger_resident_tap_sp$SUBZONE_N)
gi.queen_out <- localG(passenger_resident_tap_sp$residuals_out, rpassenger_resident_tap_sp_q)
gi.queen_out
##   [1] -1.128994409 -0.882524742 -0.844947917 -0.753390121 -0.602489307
##   [6] -0.706046651 -1.100129877 -0.746366685 -0.864255012 -0.125784577
##  [11] -0.699369831 -0.589360258 -2.064398550 -0.426582785 -1.367097249
##  [16] -0.744786968 -0.740767935 -1.236467325 -1.636433150 -0.640223492
##  [21] -1.010683013 -0.476039305 -0.708442736 -1.241342828 -0.951366048
##  [26] -0.343150656 -0.334457359 -1.483067120 -0.909046543 -1.009179709
##  [31] -1.573369571 -1.884063170 -1.860528167 -1.997826557 -1.583131939
##  [36] -1.323567767 -1.129392757 -1.136816541 -1.985134951 -1.179447480
##  [41] -0.940572440 -0.299438667 -0.232757371 -0.925760976 -1.308691427
##  [46] -0.317198237 -1.021297471 -1.130372452  0.286379745 -1.067421856
##  [51] -0.244150755 -1.519871998 -1.364784987 -0.149570358 -1.648282445
##  [56] -1.559814735 -1.122976154 -1.132868347 -1.882965178 -1.225047996
##  [61] -0.573547737 -1.681842300 -1.066218793  0.104975510 -0.485228894
##  [66] -1.142698094 -1.497670918 -1.399749162 -0.696552669 -1.537114129
##  [71] -0.281789330 -0.382042188 -1.044858728 -1.315574870 -0.429162343
##  [76] -0.530531286 -0.674270645 -0.505350362 -1.226071872 -0.736333773
##  [81] -0.327415280 -0.960851808 -0.718472765 -0.698296075 -0.556267964
##  [86] -1.862900005  0.439583966  0.168913492 -0.959948241 -1.177024295
##  [91] -0.258553067 -0.216458485 -0.302472240 -0.332888168  0.392854533
##  [96]  0.017896947 -0.110564184 -0.837039441 -0.429131913  0.431262340
## [101] -0.512805920 -0.901870928 -0.858475834 -1.595529305  0.068005747
## [106]  1.704912375  1.520942579 -0.932888523 -0.757867330 -0.364798620
## [111] -0.377437398 -1.105076006 -1.056733489 -0.847524378 -0.331527940
## [116] -0.737250590 -0.011785297 -1.322459455 -0.249115006 -0.488131586
## [121] -0.518290903  0.997436586  0.067141010  0.145996809  0.237068177
## [126] -0.697580524  0.014286377  0.901021680  0.660227828  0.624514694
## [131]  0.382457360  0.599976634 -0.003787346  0.453952613 -0.168201826
## [136]  1.305895341 -0.289754912  0.458633478 -1.224790339 -0.648114423
## [141] -0.523056575 -0.375863385 -1.730010448 -0.255208146  1.784362750
## [146] -0.238952826  1.335958080  0.575699094  0.797231070  1.635651871
## [151]  0.839746010  0.814227495  0.518754005 -0.239009095 -0.505407734
## [156]  0.891683710  1.549061063  0.252092211 -0.494012940 -0.914110240
## [161]  2.407658180  0.809766072  1.617794407 -0.119577038  0.729193703
## [166]  0.749639083  0.745699157  1.932515827  4.761350154 -1.179474083
## [171]  0.673280952  0.547446477 -0.701706026  0.871710622 -0.124659239
## [176]  0.481304712  0.874368824 -0.723098976 -0.213494199 -0.227046773
## [181] -0.175160451 -0.126231216  1.711917396 -0.440243474  0.107400137
## [186]  0.131514557  2.932417419 -0.409131751  0.698858834 -0.449594787
## [191]  2.169050712  1.800240764  1.215661121  1.160918383  0.424216529
## [196]  3.189061162  2.532203961  4.260288742  0.096605883  5.396783642
## [201]  2.440665870 -0.545271126  4.139441347  3.300926940 -0.479460762
## [206]  1.287425831  3.080223179 -0.294047634  2.112091041  0.986890254
## [211]  3.914167281  1.077638222 -0.425119174  2.110442556 -1.151224017
## [216]  2.331756532  2.409909460  0.830895127  0.601482885 -1.512827555
## [221]  0.632425424 -0.168518166  4.187834374 -0.875016261  1.242956101
## [226]  0.342886328  2.773880413 -0.820941239  3.406819515 -0.477601315
## [231] -0.227577779  0.317406194
## attr(,"gstari")
## [1] FALSE
## attr(,"call")
## localG(x = passenger_resident_tap_sp$residuals_out, listw = rpassenger_resident_tap_sp_q)
## attr(,"class")
## [1] "localG"


Next, we bind the gi data into passenger_resident_tap_sp.gi. To change the data name, we have to count the number of data there are and changed the last index.

passenger_resident_tap_sp.gi<- cbind(passenger_resident_tap_sp.gi, as.matrix(gi.queen_out))
b = names(passenger_resident_tap_sp.gi)
length(b)
## [1] 26


names(passenger_resident_tap_sp.gi)[26]="gstat_out"

Visualising Hotspot and Cold spot areas for both tap in and tap out

We use choropleth map to discover hot spots and cold spots among the subzones.

Mapping Gi values with queens weights

The code chunk below shows the functions used to map the Gi values derived using fixed distance weight matrix.

hotcold_in <- tm_shape(passenger_resident_tap_sp.gi) +
  tm_fill(col = "gstat", 
          id = "SUBZONE_N", 
          style = "pretty",
          palette="-RdBu",
          title = "Tap In vs Population residuals local Gi") +
  tm_borders(alpha = 0.5)

hotcold_out <- tm_shape(passenger_resident_tap_sp.gi) +
  tm_fill(col = "gstat_out", 
          id = "SUBZONE_N", 
          style = "pretty",
          palette="-RdBu",
          title = "Tap Out vs Population residuals local Gi") +
  tm_borders(alpha = 0.5)



tmap_arrange(hotcold_in, hotcold_out, asp=1, ncol=2, sync = TRUE)

In the choropleth map above, counties shaded in red are to hot spot areas and counties shaded in blue are the cold spot areas. The darkness of the colours representing the intensity of the Gi values.

In conclusion, the choropleth above shows clear sign of divide among the top and bottom of the map (North and South divide) in both the Tap In vs Population and Tap Out vs Population by subzone of Singapore in 2020.

For Tap In vs Population residuals, the hot spot areas mainly consist of the North and North-East of Singapore: Compassvale,Seng Kang Town Centre, Punggol Field, Matilda and Midview. The cold spots mainly compromise of the Central and South of Singapore: Sentosa, Leonie Hill and Lavender.

For Tap-Out vs Population residuals, the areas also mainly consist of the North and East of Singapore: Compassvale,Seng Kang Town Centre, Punggol Field, Matilda and Midview. The cold spots mainly compromise of the south of Singapore: Sentosa.