In this task, we use first order and second order spatial point analysis to understand the distribution of Airbnb listing in Singapore.
packages = c('readr','rgdal', 'maptools', 'raster','spatstat', 'tmap', 'dplyr','sf')
for (p in packages){
if(!require(p, character.only = T)){
install.packages(p)
}
library(p,character.only = T)
}
Data required for this task:
listings <- read_csv("data/aspatial/listings.csv")
## Parsed with column specification:
## cols(
## id = col_double(),
## name = col_character(),
## host_id = col_double(),
## host_name = col_character(),
## neighbourhood_group = col_character(),
## neighbourhood = col_character(),
## latitude = col_double(),
## longitude = col_double(),
## room_type = col_character(),
## price = col_double(),
## minimum_nights = col_double(),
## number_of_reviews = col_double(),
## last_review = col_date(format = ""),
## reviews_per_month = col_double(),
## calculated_host_listings_count = col_double(),
## availability_365 = col_double()
## )
head(listings)
## Registered S3 method overwritten by 'cli':
## method from
## print.boxx spatstat
## # A tibble: 6 x 16
## id name host_id host_name neighbourhood_g~ neighbourhood latitude
## <dbl> <chr> <dbl> <chr> <chr> <chr> <dbl>
## 1 49091 COZI~ 266763 Francesca North Region Woodlands 1.44
## 2 50646 Plea~ 227796 Sujatha Central Region Bukit Timah 1.33
## 3 56334 COZI~ 266763 Francesca North Region Woodlands 1.44
## 4 71609 Ensu~ 367042 Belinda East Region Tampines 1.35
## 5 71896 B&B ~ 367042 Belinda East Region Tampines 1.35
## 6 71903 Room~ 367042 Belinda East Region Tampines 1.35
## # ... with 9 more variables: longitude <dbl>, room_type <chr>, price <dbl>,
## # minimum_nights <dbl>, number_of_reviews <dbl>, last_review <date>,
## # reviews_per_month <dbl>, calculated_host_listings_count <dbl>,
## # availability_365 <dbl>
sg <- readOGR(dsn = "data/geospatial", layer="CostalOutline")
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\weich\Downloads\SMU2020\IS415\IS415_Take-home_Ex02\data\geospatial", layer: "CostalOutline"
## with 60 features
## It has 4 fields
mpsz <- readOGR(dsn = "data/geospatial", layer="MP14_SUBZONE_WEB_PL")
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\weich\Downloads\SMU2020\IS415\IS415_Take-home_Ex02\data\geospatial", layer: "MP14_SUBZONE_WEB_PL"
## with 323 features
## It has 15 fields
crs(sg)
## CRS arguments:
## +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
## +ellps=WGS84 +towgs84=0,0,0
crs(mpsz)
## CRS arguments:
## +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
## +ellps=WGS84 +towgs84=0,0,0
listings_sf4326 <- st_as_sf(listings,
coords = c("longitude", "latitude"),
crs= 4326)
listings_sf <- st_transform(listings_sf4326, 3414)
class(listings_sf)
## [1] "sf" "tbl_df" "tbl" "data.frame"
crs(listings_sf)
## [1] "+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 "
any(is.na(listings_sf$room_type))
## [1] FALSE
There are no NAs in room_type variable.
table(listings_sf$room_type)
##
## Entire home/apt Hotel room Private room Shared room
## 3728 507 3206 272
There are four room types - Entire home/apt, Hotel room, Private room and Shared room.
From Airbnb’s website, we learn that the room types mean:
tmap_mode("view")
## tmap mode set to interactive viewing
tm_shape(sg) +
tm_borders(alpha = 0.5) +
tm_shape(listings_sf) +
tm_dots(col = 'room_type',
palette=c('blue', 'orange', 'red', 'green'),
size = 0.02)
## Warning: The shape sg is invalid. See sf::st_is_valid
tmap_mode("plot")
## tmap mode set to plotting
tm_shape(sg) +
tm_borders(alpha = 0.5) +
tm_shape(listings_sf) +
tm_dots(col = 'room_type',
palette=c('blue', 'orange', 'red', 'green'),
size = 0.05) +
tm_facets(by="room_type")
## Warning: The shape sg is invalid. See sf::st_is_valid
EDA findings:
Generally, for Housing Development Board (HDB) flats, the minimum rental period is 6 months and it cannot be rented to tourists. For private properties, the minimum rental period is 3 months. (Source: irblaw)
spatstat requires data in ppp object form.
listings_entire <- listings_sf %>%
filter(room_type == 'Entire home/apt')
listings_hotel <- listings_sf %>%
filter(room_type == 'Hotel room')
listings_private <- listings_sf %>%
filter(room_type == 'Private room')
listings_shared <- listings_sf %>%
filter(room_type == 'Shared room')
listings_spdf <- as(listings_sf, "Spatial")
listings_sp <- as(listings_spdf, "SpatialPoints")
listings_ppp <- as(listings_sp, "ppp")
class(listings_ppp)
## [1] "ppp"
listings_entire_spdf <- as(listings_entire, "Spatial")
listings_entire_sp <- as(listings_entire_spdf, "SpatialPoints")
listings_entire_ppp <- as(listings_entire_sp, "ppp")
listings_hotel_spdf <- as(listings_hotel, "Spatial")
listings_hotel_sp <- as(listings_hotel_spdf, "SpatialPoints")
listings_hotel_ppp <- as(listings_hotel_sp, "ppp")
listings_private_spdf <- as(listings_private, "Spatial")
listings_private_sp <- as(listings_private_spdf, "SpatialPoints")
listings_private_ppp <- as(listings_private_sp, "ppp")
sg_sp <- as(sg, "SpatialPolygons")
mpsz_sp <- as(mpsz, "SpatialPolygons")
class(sg_sp)
## [1] "SpatialPolygons"
## attr(,"package")
## [1] "sp"
If there are duplicated spatial points, we will use the jittering method to avoid these duplicates.
any(duplicated(listings_ppp))
## [1] TRUE
any(duplicated(listings_entire_ppp))
## [1] TRUE
any(duplicated(listings_hotel_ppp))
## [1] TRUE
any(duplicated(listings_private_ppp))
## [1] TRUE
any(duplicated(listings_shared_ppp))
## [1] TRUE
listings_ppp_jit <- rjitter(listings_ppp, retry=TRUE, nsim=1, drop=TRUE)
listings_entire_ppp_jit <- rjitter(listings_entire_ppp, retry=TRUE, nsim=1, drop=TRUE)
listings_hotel_ppp_jit <- rjitter(listings_hotel_ppp, retry=TRUE, nsim=1, drop=TRUE)
listings_private_ppp_jit <- rjitter(listings_private_ppp, retry=TRUE, nsim=1, drop=TRUE)
listings_shared_ppp_jit <- rjitter(listings_shared_ppp, retry=TRUE, nsim=1, drop=TRUE)
any(duplicated(listings_ppp_jit))
## [1] FALSE
any(duplicated(listings_entire_ppp_jit))
## [1] FALSE
any(duplicated(listings_hotel_ppp_jit))
## [1] FALSE
any(duplicated(listings_private_ppp_jit))
## [1] FALSE
any(duplicated(listings_shared_ppp_jit))
## [1] FALSE
sg_owin <- as(sg_sp, "owin")
plot(sg_owin)
listingsSG_ppp <- listings_ppp_jit[sg_owin]
listingsSG_entire_ppp <- listings_entire_ppp_jit[sg_owin]
listingsSG_hotel_ppp <- listings_hotel_ppp_jit[sg_owin]
listingsSG_private_ppp <- listings_private_ppp_jit[sg_owin]
listingsSG_shared_ppp <- listings_shared_ppp_jit[sg_owin]
From the EDA, we generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
qt <- quadrat.test(listingsSG_ppp,
nx = 20, ny = 15)
## Warning: Some expected counts are small; chi^2 approximation may be inaccurate
qt
##
## Chi-squared test of CSR using quadrat counts
##
## data: listingsSG_ppp
## X2 = 72446, df = 184, p-value < 2.2e-16
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
Preliminary findings:
plot(listingsSG_ppp)
plot(qt, add = TRUE, cex =.1)
quadrat.test(listingsSG_ppp,
nx = 20, ny = 15,
method="M",
nsim=999)
##
## Conditional Monte Carlo test of CSR using quadrat counts
## Test statistic: Pearson X2 statistic
##
## data: listingsSG_ppp
## X2 = 72446, p-value = 0.002
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
The Monte Carlo test brings more certainty that we should reject H0 and the distribution of Airbnb listings are not randomly distributed.
From the EDA, we generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
qt_entire <- quadrat.test(listingsSG_entire_ppp,
nx = 20, ny = 15)
qt_entire
##
## Chi-squared test of CSR using quadrat counts
##
## data: listingsSG_entire_ppp
## X2 = 43841, df = 184, p-value < 2.2e-16
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
Preliminary findings:
plot(listingsSG_entire_ppp)
plot(qt_entire, add = TRUE, cex =.1)
quadrat.test(listingsSG_entire_ppp,
nx = 20, ny = 15,
method="M",
nsim=999)
##
## Conditional Monte Carlo test of CSR using quadrat counts
## Test statistic: Pearson X2 statistic
##
## data: listingsSG_entire_ppp
## X2 = 43841, p-value = 0.002
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
The Monte Carlo test brings more certainty that we should reject H0 and the distribution of entire home/apt Airbnb listings are not randomly distributed.
From the EDA, we generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
qt_hotel <- quadrat.test(listingsSG_hotel_ppp,
nx = 20, ny = 15)
qt_hotel
##
## Chi-squared test of CSR using quadrat counts
##
## data: listingsSG_hotel_ppp
## X2 = 9183.7, df = 184, p-value < 2.2e-16
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
Preliminary findings:
plot(listingsSG_hotel_ppp)
plot(qt_hotel, add = TRUE, cex =.1)
quadrat.test(listingsSG_hotel_ppp,
nx = 20, ny = 15,
method="M",
nsim=999)
##
## Conditional Monte Carlo test of CSR using quadrat counts
## Test statistic: Pearson X2 statistic
##
## data: listingsSG_hotel_ppp
## X2 = 9183.7, p-value = 0.002
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
The Monte Carlo test brings more certainty that we should reject H0 and the distribution of hotel room Airbnb listings are not randomly distributed.
From the EDA, we generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
qt_private <- quadrat.test(listingsSG_private_ppp,
nx = 20, ny = 15)
qt_private
##
## Chi-squared test of CSR using quadrat counts
##
## data: listingsSG_private_ppp
## X2 = 21945, df = 184, p-value < 2.2e-16
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
Preliminary findings:
plot(listingsSG_private_ppp)
plot(qt_private, add = TRUE, cex =.1)
quadrat.test(listingsSG_private_ppp,
nx = 20, ny = 15,
method="M",
nsim=999)
##
## Conditional Monte Carlo test of CSR using quadrat counts
## Test statistic: Pearson X2 statistic
##
## data: listingsSG_private_ppp
## X2 = 21945, p-value = 0.002
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
The Monte Carlo test brings more certainty that we should reject H0 and the distribution of private room Airbnb listings are not randomly distributed.
quadrat.test(listingsSG_shared_ppp,
nx = 20, ny = 15,
method="M",
nsim=999)
##
## Conditional Monte Carlo test of CSR using quadrat counts
## Test statistic: Pearson X2 statistic
##
## data: listingsSG_shared_ppp
## X2 = 4487.4, p-value = 0.002
## alternative hypothesis: two.sided
##
## Quadrats: 185 tiles (irregular windows)
The Monte Carlo test brings more certainty that we should reject H0 and the distribution of shared room Airbnb listings are not randomly distributed.
Again, we generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
clarkevans.test(listingsSG_ppp,
correction="none",
clipregion="sg_owin",
alternative=c("two.sided"),
nsim=99)
##
## Clark-Evans test
## No edge correction
## Monte Carlo test based on 99 simulations of CSR with fixed n
##
## data: listingsSG_ppp
## R = 0.33994, p-value = 0.02
## alternative hypothesis: two-sided
Preliminary findings:
We generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
clarkevans.test(listingsSG_entire_ppp,
correction="none",
clipregion="sg_owin",
alternative=c("two.sided"),
nsim=99)
##
## Clark-Evans test
## No edge correction
## Monte Carlo test based on 99 simulations of CSR with fixed n
##
## data: listingsSG_entire_ppp
## R = 0.26372, p-value = 0.02
## alternative hypothesis: two-sided
Preliminary findings:
We generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
clarkevans.test(listingsSG_hotel_ppp,
correction="none",
clipregion="sg_owin",
alternative=c("two.sided"),
nsim=99)
##
## Clark-Evans test
## No edge correction
## Monte Carlo test based on 99 simulations of CSR with fixed n
##
## data: listingsSG_hotel_ppp
## R = 0.10058, p-value = 0.02
## alternative hypothesis: two-sided
Preliminary findings:
We generate several hypothesis about the spatial point patterns:
The confidence interval of 95% is used.
clarkevans.test(listingsSG_private_ppp,
correction="none",
clipregion="sg_owin",
alternative=c("two.sided"),
nsim=99)
##
## Clark-Evans test
## No edge correction
## Monte Carlo test based on 99 simulations of CSR with fixed n
##
## data: listingsSG_private_ppp
## R = 0.37528, p-value = 0.02
## alternative hypothesis: two-sided
Preliminary findings:
kde_listingsSG_bw <- density(listingsSG_ppp, sigma=bw.diggle, edge=TRUE, kernel="gaussian")
## Warning: point-in-polygon test had difficulty with 215 points (total score not 0
## or 1)
plot(kde_listingsSG_bw)
Since the density output range is too small to comprehend, we convert the unit of measurement from m to km.
We also define the bandwidth of 1km (sigma=1) for the density map.
listingsSG_ppp.km <- rescale(listingsSG_ppp, 1000, "km")
kde_listingsSG_bw.km <- density(listingsSG_ppp.km, sigma=1, edge=TRUE, kernel="gaussian")
plot(kde_listingsSG_bw.km)
We will do likewise for the four room types.
listingsSG_entire_ppp.km <- rescale(listingsSG_entire_ppp, 1000, "km")
kde_listingsSG_entire_bw.km <- density(listingsSG_entire_ppp.km, sigma=1, edge=TRUE, kernel="gaussian")
listingsSG_hotel_ppp.km <- rescale(listingsSG_hotel_ppp, 1000, "km")
kde_listingsSG_hotel_bw.km <- density(listingsSG_hotel_ppp.km, sigma=1, edge=TRUE, kernel="gaussian")
listingsSG_private_ppp.km <- rescale(listingsSG_private_ppp, 1000, "km")
kde_listingsSG_private_bw.km <- density(listingsSG_private_ppp.km, sigma=1, edge=TRUE, kernel="gaussian")
listingsSG_shared_ppp.km <- rescale(listingsSG_shared_ppp, 1000, "km")
kde_listingsSG_shared_bw.km <- density(listingsSG_shared_ppp.km, sigma=1, edge=TRUE, kernel="gaussian")
par(mfrow=c(2,2))
plot(kde_listingsSG_entire_bw.km, main = "Entire home/apt")
plot(kde_listingsSG_hotel_bw.km, main = "Hotel room")
plot(kde_listingsSG_private_bw.km, main = "Private room")
plot(kde_listingsSG_shared_bw.km, main = "Shared room")
gridded_kde_listingsSG_entire_bw <- as.SpatialGridDataFrame.im(kde_listingsSG_entire_bw.km)
gridded_kde_listingsSG_hotel_bw <- as.SpatialGridDataFrame.im(kde_listingsSG_hotel_bw.km)
gridded_kde_listingsSG_private_bw <- as.SpatialGridDataFrame.im(kde_listingsSG_private_bw.km)
gridded_kde_listingsSG_shared_bw <- as.SpatialGridDataFrame.im(kde_listingsSG_shared_bw.km)
kde_listingsSG_entire_bw_raster <- raster(gridded_kde_listingsSG_entire_bw)
kde_listingsSG_hotel_bw_raster <- raster(gridded_kde_listingsSG_hotel_bw)
kde_listingsSG_private_bw_raster <- raster(gridded_kde_listingsSG_private_bw)
kde_listingsSG_shared_bw_raster <- raster(gridded_kde_listingsSG_shared_bw)
projection(kde_listingsSG_entire_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_hotel_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_private_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_shared_bw_raster) <- CRS("+init=EPSG:3414")
kde_entire.map <- tm_shape(kde_listingsSG_entire_bw_raster) +
tm_raster("v", title="Entire home/apt", breaks=c(0, 20, 40, 60, 80, Inf)) +
tm_layout(legend.position = c("right", "bottom"), frame = FALSE)
kde_hotel.map <- tm_shape(kde_listingsSG_hotel_bw_raster) +
tm_raster("v", title="Hotel room", breaks=c(0, 20, 40, 60, 80, Inf)) +
tm_layout(legend.position = c("right", "bottom"), frame = FALSE)
kde_private.map <- tm_shape(kde_listingsSG_private_bw_raster) +
tm_raster("v",title="Private room", breaks=c(0, 20, 40, 60, 80, Inf)) +
tm_layout(legend.position = c("right", "bottom"), frame = FALSE)
kde_shared.map <- tm_shape(kde_listingsSG_shared_bw_raster) +
tm_raster("v", title="Shared room", breaks=c(0, 20, 40, 60, 80, Inf)) +
tm_layout(legend.position = c("right", "bottom"), frame = FALSE)
tmap_arrange(kde_entire.map, kde_hotel.map, kde_private.map, kde_shared.map,
asp=1, ncol=2, nrow=2)
## Warning: Values have found that are less than the lowest break
## Variable(s) "v" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
## Warning: Values have found that are less than the lowest break
## Variable(s) "v" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
## Warning: Values have found that are less than the lowest break
## Variable(s) "v" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
## Warning: Values have found that are less than the lowest break
## Variable(s) "v" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
KDE analysis:
It is important to note that unlike the point map, the KDE map allows us to view the density of a location. This makes us focus on the southern region of Singapore, which we will be doing a planning subzone analysis below.
aj = mpsz[mpsz@data$SUBZONE_N == "ALJUNIED",]
bl = mpsz[mpsz@data$SUBZONE_N == "BALESTIER",]
lv = mpsz[mpsz@data$SUBZONE_N == "LAVENDER",]
tp = mpsz[mpsz@data$SUBZONE_N == "TANJONG PAGAR",]
par(mfrow=c(2,2))
plot(aj, main = "Aljunied")
plot(bl, main = "Balestier")
plot(lv, main = "Lavender")
plot(tp, main = "Tanjong Pagar")
aj_sp = as(aj, "SpatialPolygons")
bl_sp = as(bl, "SpatialPolygons")
lv_sp = as(lv, "SpatialPolygons")
tp_sp = as(tp, "SpatialPolygons")
aj_owin = as(aj_sp, "owin")
bl_owin = as(bl_sp, "owin")
lv_owin = as(lv_sp, "owin")
tp_owin = as(tp_sp, "owin")
listings_aj_ppp_entire = listings_entire_ppp_jit[aj_owin]
listings_aj_ppp_hotel = listings_hotel_ppp_jit[aj_owin]
listings_aj_ppp_private = listings_private_ppp_jit[aj_owin]
listings_aj_ppp_shared = listings_shared_ppp_jit[aj_owin]
listings_bl_ppp_entire = listings_entire_ppp_jit[bl_owin]
listings_bl_ppp_hotel = listings_hotel_ppp_jit[bl_owin]
listings_bl_ppp_private = listings_private_ppp_jit[bl_owin]
listings_bl_ppp_shared = listings_shared_ppp_jit[bl_owin]
listings_lv_ppp_entire = listings_entire_ppp_jit[lv_owin]
listings_lv_ppp_hotel = listings_hotel_ppp_jit[lv_owin]
listings_lv_ppp_private = listings_private_ppp_jit[lv_owin]
listings_lv_ppp_shared = listings_shared_ppp_jit[lv_owin]
listings_tp_ppp_entire = listings_entire_ppp_jit[tp_owin]
listings_tp_ppp_hotel = listings_hotel_ppp_jit[tp_owin]
listings_tp_ppp_private = listings_private_ppp_jit[tp_owin]
listings_tp_ppp_shared = listings_shared_ppp_jit[tp_owin]
par(mfrow=c(2,2))
plot(listings_aj_ppp_entire, main = "Entire home/apt")
plot(listings_aj_ppp_hotel, main = "Hotel room")
plot(listings_aj_ppp_private, main = "Private room")
plot(listings_aj_ppp_shared, main = "Shared room")
EDA findings:
par(mfrow=c(2,2))
plot(listings_bl_ppp_entire, main = "Entire home/apt")
plot(listings_bl_ppp_hotel, main = "Hotel room")
plot(listings_bl_ppp_private, main = "Private room")
plot(listings_bl_ppp_shared, main = "Shared room")
EDA findings:
par(mfrow=c(2,2))
plot(listings_lv_ppp_entire, main = "Entire home/apt")
plot(listings_lv_ppp_hotel, main = "Hotel room")
plot(listings_lv_ppp_private, main = "Private room")
plot(listings_lv_ppp_shared, main = "Shared room")
EDA findings:
par(mfrow=c(2,2))
plot(listings_tp_ppp_entire, main = "Entire home/apt")
plot(listings_tp_ppp_hotel, main = "Hotel room")
plot(listings_tp_ppp_private, main = "Private room")
plot(listings_tp_ppp_shared, main = "Shared room")
EDA findings:
The shape of the G-function reveals how the points are spaced in a region.
In addition, the significance of G-function is found by using the Monte Carlo test to generate simulations.
G_CK_aj_entire = Gest(listings_aj_ppp_entire, correction = "border")
G_CK_aj_hotel = Gest(listings_aj_ppp_hotel, correction = "border")
G_CK_aj_private = Gest(listings_aj_ppp_private, correction = "border")
G_CK_aj_shared = Gest(listings_aj_ppp_shared, correction = "border")
par(mfrow=c(2,2))
plot(G_CK_aj_entire, main = "Entire home/apt")
plot(G_CK_aj_hotel, main = "Hotel room")
plot(G_CK_aj_private, main = "Private room")
plot(G_CK_aj_shared, main = "Shared room")
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
For all hypothesis generated, the confidence interval of 95% is used.
G_CK_aj_entire.csr <- envelope(listings_aj_ppp_entire, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_aj_hotel.csr <- envelope(listings_aj_ppp_hotel, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_aj_private.csr <- envelope(listings_aj_ppp_private, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_aj_shared.csr <- envelope(listings_aj_ppp_shared, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
par(mfrow=c(2,2))
plot(G_CK_aj_entire.csr, main = "Entire home/apt")
plot(G_CK_aj_hotel.csr, main = "Hotel room")
plot(G_CK_aj_private.csr, main = "Private room")
plot(G_CK_aj_shared.csr, main = "Shared room")
Monte Carlo G-function findings:
G_CK_bl_entire = Gest(listings_bl_ppp_entire, correction = "border")
G_CK_bl_hotel = Gest(listings_bl_ppp_hotel, correction = "border")
G_CK_bl_private = Gest(listings_bl_ppp_private, correction = "border")
# G_CK_bl_shared = Gest(listings_bl_ppp_shared, correction = "border")
par(mfrow=c(2,2))
plot(G_CK_bl_entire, main = "Entire home/apt")
plot(G_CK_bl_hotel, main = "Hotel room")
plot(G_CK_bl_private, main = "Private room")
# plot(G_CK_bl_shared, main = "Shared room")
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
For all hypothesis generated, the confidence interval of 95% is used.
G_CK_bl_entire.csr <- envelope(listings_bl_ppp_entire, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_bl_hotel.csr <- envelope(listings_bl_ppp_hotel, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_bl_private.csr <- envelope(listings_bl_ppp_private, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
# G_CK_bl_shared.csr <- envelope(listings_bl_ppp_shared, Gest, nsim = 999)
par(mfrow=c(2,2))
plot(G_CK_bl_entire.csr, main = "Entire home/apt")
plot(G_CK_bl_hotel.csr, main = "Hotel room")
plot(G_CK_bl_private.csr, main = "Private room")
# plot(G_CK_bl_shared.csr, main = "Shared room")
Monte Carlo G-function findings:
G_CK_lv_entire = Gest(listings_lv_ppp_entire, correction = "border")
G_CK_lv_hotel = Gest(listings_lv_ppp_hotel, correction = "border")
G_CK_lv_private = Gest(listings_lv_ppp_private, correction = "border")
G_CK_lv_shared = Gest(listings_lv_ppp_shared, correction = "border")
par(mfrow=c(2,2))
plot(G_CK_lv_entire, main = "Entire home/apt")
plot(G_CK_lv_hotel, main = "Hotel room")
plot(G_CK_lv_private, main = "Private room")
plot(G_CK_lv_shared, main = "Shared room")
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
For all hypothesis generated, the confidence interval of 95% is used.
G_CK_lv_entire.csr <- envelope(listings_lv_ppp_entire, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_lv_hotel.csr <- envelope(listings_lv_ppp_hotel, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_lv_private.csr <- envelope(listings_lv_ppp_private, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_lv_shared.csr <- envelope(listings_lv_ppp_shared, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
par(mfrow=c(2,2))
plot(G_CK_lv_entire.csr, main = "Entire home/apt")
plot(G_CK_lv_hotel.csr, main = "Hotel room")
plot(G_CK_lv_private.csr, main = "Private room")
plot(G_CK_lv_shared.csr, main = "Shared room")
Monte Carlo G-function findings:
G_CK_tp_entire = Gest(listings_tp_ppp_entire, correction = "border")
G_CK_tp_hotel = Gest(listings_tp_ppp_hotel, correction = "border")
G_CK_tp_private = Gest(listings_tp_ppp_private, correction = "border")
G_CK_tp_shared = Gest(listings_tp_ppp_shared, correction = "border")
par(mfrow=c(2,2))
plot(G_CK_tp_entire, main = "Entire home/apt")
plot(G_CK_tp_hotel, main = "Hotel room")
plot(G_CK_tp_private, main = "Private room")
plot(G_CK_tp_shared, main = "Shared room")
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
There are no shared room listings in Tanjong Pagar subzone.
For all hypothesis generated, the confidence interval of 95% is used.
G_CK_tp_entire.csr <- envelope(listings_tp_ppp_entire, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_tp_hotel.csr <- envelope(listings_tp_ppp_hotel, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
G_CK_tp_private.csr <- envelope(listings_tp_ppp_private, Gest, nsim = 999)
## Generating 999 simulations of CSR ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
##
## Done.
par(mfrow=c(2,2))
plot(G_CK_tp_entire.csr, main = "Entire home/apt")
plot(G_CK_tp_hotel.csr, main = "Hotel room")
plot(G_CK_tp_private.csr, main = "Private room")
Monte Carlo G-function findings:
The L-function is the normalized version of the K-function. Similarly, the significance of the L-function can be found with respect to the envelope:
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
For all hypothesis generated, the confidence interval of 95% is used.
L_ck_aj_entire.csr <- envelope(listings_aj_ppp_entire, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, [etd 3:57] 3, [etd 3:40] 4,
## [etd 3:40] 5, [etd 3:45] 6, [etd 3:49] 7, [etd 3:41] 8,
## [etd 3:40] 9, [etd 3:53] 10, [etd 3:49] 11, [etd 3:46] 12,
## [etd 3:44] 13, [etd 3:40] 14, [etd 3:38] 15, [etd 3:33] 16,
## [etd 3:30] 17, [etd 3:29] 18, [etd 3:25] 19, [etd 3:25] 20,
## [etd 3:23] 21, [etd 3:21] 22, [etd 3:18] 23, [etd 3:14] 24,
## [etd 3:11] 25, [etd 3:07] 26, [etd 3:04] 27, [etd 2:57] 28,
## [etd 2:50] 29, [etd 2:44] 30, [etd 2:37] 31, [etd 2:31] 32,
## [etd 2:25] 33, [etd 2:20] 34, [etd 2:15] 35, [etd 2:11] 36,
## [etd 2:07] 37, [etd 2:03] 38, [etd 1:59] 39, [etd 1:56] 40,
## [etd 1:53] 41, [etd 1:49] 42, [etd 1:46] 43, [etd 1:43] 44,
## [etd 1:40] 45, [etd 1:37] 46, [etd 1:34] 47, [etd 1:32] 48,
## [etd 1:29] 49, [etd 1:26] 50, [etd 1:24] 51, [etd 1:22] 52,
## [etd 1:20] 53, [etd 1:17] 54, [etd 1:15] 55, [etd 1:13] 56,
## [etd 1:10] 57, [etd 1:08] 58, [etd 1:06] 59, [etd 1:04] 60,
## [etd 1:02] 61, [etd 1:00] 62, [etd 58 sec] 63, [etd 56 sec] 64,
## [etd 54 sec] 65, [etd 52 sec] 66, [etd 50 sec] 67, [etd 49 sec] 68,
## [etd 47 sec] 69, [etd 45 sec] 70, [etd 44 sec] 71, [etd 42 sec] 72,
## [etd 40 sec] 73, [etd 39 sec] 74, [etd 37 sec] 75, [etd 35 sec] 76,
## [etd 34 sec] 77, [etd 32 sec] 78, [etd 30 sec] 79, [etd 29 sec] 80,
## [etd 27 sec] 81, [etd 26 sec] 82, [etd 24 sec] 83, [etd 23 sec] 84,
## [etd 21 sec] 85, [etd 20 sec] 86, [etd 18 sec] 87, [etd 17 sec] 88,
## [etd 15 sec] 89, [etd 14 sec] 90, [etd 12 sec] 91, [etd 11 sec] 92,
## [etd 10 sec] 93, [etd 8 sec] 94, [etd 7 sec] 95, [etd 5 sec] 96,
## [etd 4 sec] 97, [etd 3 sec] 98, [etd 1 sec] 99.
##
## Done.
L_ck_aj_hotel.csr <- envelope(listings_aj_ppp_hotel, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_aj_private.csr <- envelope(listings_aj_ppp_private, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_aj_shared.csr <- envelope(listings_aj_ppp_shared, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
par(mfrow=c(2,2))
plot(L_ck_aj_entire.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Entire home/apt")
plot(L_ck_aj_hotel.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Hotel room")
plot(L_ck_aj_private.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Private room")
plot(L_ck_aj_shared.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Shared room")
Monte Carlo L-function findings:
L_ck_bl_entire = Lest(listings_bl_ppp_entire, correction = "Ripley")
L_ck_bl_hotel = Lest(listings_bl_ppp_hotel, correction = "Ripley")
L_ck_bl_private = Lest(listings_bl_ppp_private, correction = "Ripley")
L_ck_bl_shared = Lest(listings_bl_ppp_shared, correction = "Ripley")
par(mfrow=c(2,2))
plot(L_ck_bl_entire, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Entire home/apt")
plot(L_ck_bl_hotel, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Hotel room")
plot(L_ck_bl_private, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Private room")
plot(L_ck_bl_shared, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Shared room")
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
For all hypothesis generated, the confidence interval of 95% is used.
L_ck_bl_entire.csr <- envelope(listings_bl_ppp_entire, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_bl_hotel.csr <- envelope(listings_bl_ppp_hotel, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_bl_private.csr <- envelope(listings_bl_ppp_private, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_bl_shared.csr <- envelope(listings_bl_ppp_shared, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
par(mfrow=c(2,2))
plot(L_ck_bl_entire.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Entire home/apt")
plot(L_ck_bl_hotel.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Hotel room")
plot(L_ck_bl_private.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Private room")
plot(L_ck_bl_shared.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Shared room")
Monte Carlo L-function findings:
L_ck_lv_entire = Lest(listings_lv_ppp_entire, correction = "Ripley")
L_ck_lv_hotel = Lest(listings_lv_ppp_hotel, correction = "Ripley")
L_ck_lv_private = Lest(listings_lv_ppp_private, correction = "Ripley")
L_ck_lv_shared = Lest(listings_lv_ppp_shared, correction = "Ripley")
par(mfrow=c(2,2))
plot(L_ck_lv_entire, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Entire home/apt")
plot(L_ck_lv_hotel, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Hotel room")
plot(L_ck_lv_private, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Private room")
plot(L_ck_lv_shared, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Shared room")
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
For all hypothesis generated, the confidence interval of 95% is used.
L_ck_lv_entire.csr <- envelope(listings_lv_ppp_entire, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_lv_hotel.csr <- envelope(listings_lv_ppp_hotel, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_lv_private.csr <- envelope(listings_lv_ppp_private, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_lv_shared.csr <- envelope(listings_lv_ppp_shared, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
par(mfrow=c(2,2))
plot(L_ck_lv_entire.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Entire home/apt")
plot(L_ck_lv_hotel.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Hotel room")
plot(L_ck_lv_private.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Private room")
plot(L_ck_lv_shared.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Shared room")
Monte Carlo L-function findings:
L_ck_tp_entire = Lest(listings_tp_ppp_entire, correction = "Ripley")
L_ck_tp_hotel = Lest(listings_tp_ppp_hotel, correction = "Ripley")
L_ck_tp_private = Lest(listings_tp_ppp_private, correction = "Ripley")
par(mfrow=c(2,2))
plot(L_ck_tp_entire, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Entire home/apt")
plot(L_ck_tp_hotel, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Hotel room")
plot(L_ck_tp_private, . -r ~ r,
ylab= "L(d)-r", xlab = "d(m)", main = "Private room")
Hypothesis to test:
(a) Entire home/apt
(b) Hotel room
(c) Private room
(d) Shared room
There is no shared room listings in Tanjong Pagar.
For all hypothesis generated, the confidence interval of 95% is used.
L_ck_tp_entire.csr <- envelope(listings_tp_ppp_entire, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_tp_hotel.csr <- envelope(listings_tp_ppp_hotel, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
L_ck_tp_private.csr <- envelope(listings_tp_ppp_private, Lest, nsim = 99, rank = 1, glocal=TRUE)
## Generating 99 simulations of CSR ...
## 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
## 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
## 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
##
## Done.
par(mfrow=c(2,2))
plot(L_ck_tp_entire.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Entire home/apt")
plot(L_ck_tp_hotel.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Hotel room")
plot(L_ck_tp_private.csr, . - r ~ r,
xlab="d", ylab="L(d)-r", main = "Private room")
Monte Carlo L-function findings:
listings_aj_ppp_entire.km <- rescale(listings_aj_ppp_entire, 1000, "km")
listings_aj_ppp_hotel.km <- rescale(listings_aj_ppp_hotel, 1000, "km")
listings_aj_ppp_private.km <- rescale(listings_aj_ppp_private, 1000, "km")
listings_aj_ppp_shared.km <- rescale(listings_aj_ppp_shared, 1000, "km")
kde_listings_sg_bw_aj_entire.km <- density(listings_aj_ppp_entire.km, sigma=0.5, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_aj_hotel.km <- density(listings_aj_ppp_hotel.km, sigma=0.5, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_aj_private.km <- density(listings_aj_ppp_private.km, sigma=0.5, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_aj_shared.km <- density(listings_aj_ppp_shared.km, sigma=0.5, edge=TRUE, kernel="gaussian")
par(mfrow=c(2,2))
plot(kde_listings_sg_bw_aj_entire.km, main = "Entire home/apt")
contour(kde_listings_sg_bw_aj_entire.km, add=TRUE)
plot(kde_listings_sg_bw_aj_hotel.km, main = "Hotel room")
contour(kde_listings_sg_bw_aj_hotel.km, add=TRUE)
plot(kde_listings_sg_bw_aj_private.km, main = "Private room")
contour(kde_listings_sg_bw_aj_private.km, add=TRUE)
plot(kde_listings_sg_bw_aj_shared.km, main = "Shared room")
contour(kde_listings_sg_bw_aj_shared.km, add=TRUE)
listings_bl_ppp_entire.km <- rescale(listings_bl_ppp_entire, 1000, "km")
listings_bl_ppp_hotel.km <- rescale(listings_bl_ppp_hotel, 1000, "km")
listings_bl_ppp_private.km <- rescale(listings_bl_ppp_private, 1000, "km")
# listings_bl_ppp_shared.km <- rescale(listings_bl_ppp_shared, 1000, "km")
kde_listings_sg_bw_bl_entire.km <- density(listings_bl_ppp_entire.km, sigma=0.25, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_bl_hotel.km <- density(listings_bl_ppp_hotel.km, sigma=0.25, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_bl_private.km <- density(listings_bl_ppp_private.km, sigma=0.25, edge=TRUE, kernel="gaussian")
# kde_listings_sg_bw_bl_shared.km <- density(listings_bl_ppp_shared.km, sigma=0.25, edge=TRUE, kernel="gaussian")
par(mfrow=c(2,2))
plot(kde_listings_sg_bw_bl_entire.km, main = "Entire home/apt")
contour(kde_listings_sg_bw_bl_entire.km, add=TRUE)
plot(kde_listings_sg_bw_bl_hotel.km, main = "Hotel room")
contour(kde_listings_sg_bw_bl_hotel.km, add=TRUE)
plot(kde_listings_sg_bw_bl_private.km, main = "Private room")
contour(kde_listings_sg_bw_bl_private.km, add=TRUE)
listings_lv_ppp_entire.km <- rescale(listings_lv_ppp_entire, 1000, "km")
listings_lv_ppp_hotel.km <- rescale(listings_lv_ppp_hotel, 1000, "km")
listings_lv_ppp_private.km <- rescale(listings_lv_ppp_private, 1000, "km")
listings_lv_ppp_shared.km <- rescale(listings_lv_ppp_shared, 1000, "km")
kde_listings_sg_bw_lv_entire.km <- density(listings_lv_ppp_entire.km, sigma=0.25, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_lv_hotel.km <- density(listings_lv_ppp_hotel.km, sigma=0.25, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_lv_private.km <- density(listings_lv_ppp_private.km, sigma=0.25, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_lv_shared.km <- density(listings_lv_ppp_shared.km, sigma=0.25, edge=TRUE, kernel="gaussian")
par(mfrow=c(2,2))
plot(kde_listings_sg_bw_lv_entire.km, main = "Entire home/apt")
contour(kde_listings_sg_bw_lv_entire.km, add=TRUE)
plot(kde_listings_sg_bw_lv_hotel.km, main = "Hotel room")
contour(kde_listings_sg_bw_lv_hotel.km, add=TRUE)
plot(kde_listings_sg_bw_lv_private.km, main = "Private room")
contour(kde_listings_sg_bw_lv_private.km, add=TRUE)
plot(kde_listings_sg_bw_lv_shared.km, main = "Shared room")
contour(kde_listings_sg_bw_lv_shared.km, add=TRUE)
listings_tp_ppp_entire.km <- rescale(listings_tp_ppp_entire, 1000, "km")
listings_tp_ppp_hotel.km <- rescale(listings_tp_ppp_hotel, 1000, "km")
listings_tp_ppp_private.km <- rescale(listings_tp_ppp_private, 1000, "km")
# listings_tp_ppp_shared.km <- rescale(listings_tp_ppp_shared, 1000, "km")
kde_listings_sg_bw_tp_entire.km <- density(listings_tp_ppp_entire.km, sigma=0.25, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_tp_hotel.km <- density(listings_tp_ppp_hotel.km, sigma=0.25, edge=TRUE, kernel="gaussian")
kde_listings_sg_bw_tp_private.km <- density(listings_tp_ppp_private.km, sigma=0.25, edge=TRUE, kernel="gaussian")
# kde_listings_sg_bw_tp_shared.km <- density(listings_tp_ppp_shared.km, sigma=0.25, edge=TRUE, kernel="gaussian")
par(mfrow=c(2,2))
plot(kde_listings_sg_bw_tp_entire.km, main = "Entire home/apt")
contour(kde_listings_sg_bw_tp_entire.km, add=TRUE)
plot(kde_listings_sg_bw_tp_hotel.km, main = "Hotel room")
contour(kde_listings_sg_bw_tp_hotel.km, add=TRUE)
plot(kde_listings_sg_bw_tp_private.km, main = "Private room")
contour(kde_listings_sg_bw_tp_private.km, add=TRUE)
gridded_kde_listingsSG_aj_entire_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_aj_entire.km)
gridded_kde_listingsSG_aj_hotel_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_aj_hotel.km)
gridded_kde_listingsSG_aj_private_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_aj_private.km)
gridded_kde_listingsSG_aj_shared_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_aj_shared.km)
gridded_kde_listingsSG_bl_entire_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_bl_entire.km)
gridded_kde_listingsSG_bl_hotel_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_bl_hotel.km)
gridded_kde_listingsSG_bl_private_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_bl_private.km)
# gridded_kde_listingsSG_bl_shared_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_bl_shared.km)
gridded_kde_listingsSG_lv_entire_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_lv_entire.km)
gridded_kde_listingsSG_lv_hotel_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_lv_hotel.km)
gridded_kde_listingsSG_lv_private_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_lv_private.km)
gridded_kde_listingsSG_lv_shared_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_lv_shared.km)
gridded_kde_listingsSG_tp_entire_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_tp_entire.km)
gridded_kde_listingsSG_tp_hotel_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_tp_hotel.km)
gridded_kde_listingsSG_tp_private_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_tp_private.km)
# gridded_kde_listingsSG_tp_shared_bw <- as.SpatialGridDataFrame.im(kde_listings_sg_bw_tp_shared.km)
kde_listingsSG_aj_entire_bw_raster <- raster(gridded_kde_listingsSG_aj_entire_bw)
kde_listingsSG_aj_hotel_bw_raster <- raster(gridded_kde_listingsSG_aj_hotel_bw)
kde_listingsSG_aj_private_bw_raster <- raster(gridded_kde_listingsSG_aj_private_bw)
kde_listingsSG_aj_shared_bw_raster <- raster(gridded_kde_listingsSG_aj_shared_bw)
kde_listingsSG_bl_entire_bw_raster <- raster(gridded_kde_listingsSG_bl_entire_bw)
kde_listingsSG_bl_hotel_bw_raster <- raster(gridded_kde_listingsSG_bl_hotel_bw)
kde_listingsSG_bl_private_bw_raster <- raster(gridded_kde_listingsSG_bl_private_bw)
# kde_listingsSG_bl_shared_bw_raster <- raster(gridded_kde_listingsSG_bl_shared_bw)
kde_listingsSG_lv_entire_bw_raster <- raster(gridded_kde_listingsSG_lv_entire_bw)
kde_listingsSG_lv_hotel_bw_raster <- raster(gridded_kde_listingsSG_lv_hotel_bw)
kde_listingsSG_lv_private_bw_raster <- raster(gridded_kde_listingsSG_lv_private_bw)
kde_listingsSG_lv_shared_bw_raster <- raster(gridded_kde_listingsSG_lv_shared_bw)
kde_listingsSG_tp_entire_bw_raster <- raster(gridded_kde_listingsSG_tp_entire_bw)
kde_listingsSG_tp_hotel_bw_raster <- raster(gridded_kde_listingsSG_tp_hotel_bw)
kde_listingsSG_tp_private_bw_raster <- raster(gridded_kde_listingsSG_tp_private_bw)
# kde_listingsSG_tp_shared_bw_raster <- raster(gridded_kde_listingsSG_tp_shared_bw)
projection(kde_listingsSG_aj_entire_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_aj_hotel_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_aj_private_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_aj_shared_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_bl_entire_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_bl_hotel_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_bl_private_bw_raster) <- CRS("+init=EPSG:3414")
# projection(kde_listingsSG_bl_shared_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_lv_entire_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_lv_hotel_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_lv_private_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_lv_shared_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_tp_entire_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_tp_hotel_bw_raster) <- CRS("+init=EPSG:3414")
projection(kde_listingsSG_tp_private_bw_raster) <- CRS("+init=EPSG:3414")
# projection(kde_listingsSG_tp_shared_bw_raster) <- CRS("+init=EPSG:3414")
kde_entire.map <- tm_shape(kde_listingsSG_aj_entire_bw_raster) +
tm_raster("v", title="Entire home/apt") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_hotel.map <- tm_shape(kde_listingsSG_aj_hotel_bw_raster) +
tm_raster("v", title="Hotel room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_private.map <- tm_shape(kde_listingsSG_aj_private_bw_raster) +
tm_raster("v", title="Private room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_shared.map <- tm_shape(kde_listingsSG_aj_shared_bw_raster) +
tm_raster("v", title="Shared room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
tmap_arrange(kde_entire.map, kde_hotel.map, kde_private.map, kde_shared.map,
asp=1, ncol=2, nrow=2)
KDE analysis:
kde_entire.map <- tm_shape(kde_listingsSG_bl_entire_bw_raster) +
tm_raster("v", title="Entire home/apt") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_hotel.map <- tm_shape(kde_listingsSG_bl_hotel_bw_raster) +
tm_raster("v", title="Hotel room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_private.map <- tm_shape(kde_listingsSG_bl_private_bw_raster) +
tm_raster("v", title="Private room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
tmap_arrange(kde_entire.map, kde_hotel.map, kde_private.map,
asp=1, ncol=2, nrow=2)
KDE analysis:
kde_entire.map <- tm_shape(kde_listingsSG_lv_entire_bw_raster) +
tm_raster("v", title="Entire home/apt") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_hotel.map <- tm_shape(kde_listingsSG_lv_hotel_bw_raster) +
tm_raster("v", title="Hotel room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_private.map <- tm_shape(kde_listingsSG_lv_private_bw_raster) +
tm_raster("v", title="Private room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_shared.map <- tm_shape(kde_listingsSG_lv_shared_bw_raster) +
tm_raster("v", title="Shared room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
tmap_arrange(kde_entire.map, kde_hotel.map, kde_private.map, kde_shared.map,
asp=1, ncol=2, nrow=2)
KDE analysis:
kde_entire.map <- tm_shape(kde_listingsSG_tp_entire_bw_raster) +
tm_raster("v", title="Entire home/apt") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_hotel.map <- tm_shape(kde_listingsSG_tp_hotel_bw_raster) +
tm_raster("v", title="Hotel room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
kde_private.map <- tm_shape(kde_listingsSG_tp_private_bw_raster) +
tm_raster("v", title="Private room") +
tm_layout(legend.outside=TRUE, frame = FALSE)
tmap_arrange(kde_entire.map, kde_hotel.map, kde_private.map,
asp=1, ncol=2, nrow=2)
KDE analysis: