Permalink
Fetching contributors…
Cannot retrieve contributors at this time
6307 lines (6163 sloc) 180 KB

A Data Driven Approach to Evaluating the Vancouver Housing Market

Pascal Schmidt November 18, 2018

knitr::opts_chunk$set(warning = FALSE, results = "asis", message = FALSE)
library(tidyverse)

Data Cleaning and Data Wrangling

###################################
### Reading in the streets data ###
###################################

path <- list.files(path = here::here("data"), pattern = ".xlsx")
df <- tibble::data_frame(path = path) %>%
  dplyr::mutate(., path = paste0(here::here("data"), "/", path)) %>%
  dplyr::mutate(., sheet_name = purrr::map(path, readxl::excel_sheets)) %>%
  tidyr::unnest(.) %>%
  dplyr::mutate(., data = purrr::map2(
    path, sheet_name,
    ~readxl::read_excel(.x, .y)
  ))

data_streets <- df$data
##############################################
### Rading in renting data from craigslist ###
##############################################

craigslist <- read.csv(here::here("data", "craigslist.csv"))

# data wrangling and data manipulation
# the code below groups the apartments into square feet
craigslist %>%
  dplyr::mutate(
    SqFt_mod = cut(.$SqFt,
      breaks = seq(from = 0, to = 1199, by = 100),
      labels = paste0(seq(from = 1, to = 1099, by = 100), "-", seq(from = 101, to = 1100, by = 100))
    ),
    SqFt_mod_2 = cut(.$SqFt,
      breaks = seq(from = 1100, to = 3099, by = 250),
      labels = paste0(seq(from = 1101, to = 2849, by = 250), "-", seq(from = 1351, to = 3100, by = 250))
    ),
    SqFt_mod_3 = cut(.$SqFt,
      breaks = seq(from = 3100, to = 13099, by = 500),
      labels = paste0(seq(from = 3101, to = 12599, by = 500), "-", seq(from = 3601, to = 13100, by = 500))
    )
  ) %>%
  tidyr::unite(., SqFt_mod, c("SqFt_mod", "SqFt_mod_2", "SqFt_mod_3"), sep = "", remove = TRUE) %>%
  dplyr::mutate(., SqFt_mod = gsub("NA", "", SqFt_mod)) -> craigslist

# remove all variables with missing locations and
# remove all variables that have missing values for square feet and bedrooms
craigslist %>%
  dplyr::filter(., !(is.na(SqFt) & is.na(Bedrooms))) %>%
  dplyr::filter(., !is.na(Location)) %>%
  tidyr::separate(.,
    col = Location,
    into = c("street", "city"),
    sep = ", ",
    remove = TRUE
  ) %>%
  dplyr::mutate(., neighborhood = NA) -> craigslist
for (i in 1:length(data_streets)) {
  craigslist$neighborhood[craigslist$street %in% (data_streets[[i]] %>%
    dplyr::pull(.))] <- colnames(data_streets[[i]])
}

for (i in 1:nrow(craigslist)) {
  craigslist[i, "neighborhood"]["Maple Ridge" %in% craigslist[i, "city"]] <- "Maple Ridge"
  craigslist[i, "neighborhood"]["Marpole Avenue" %in% craigslist[i, "street_name"] & "Port Coquitlam" %in% craigslist[i, "city"]] <- "Port Coquitlam"
  craigslist[i, "neighborhood"]["Marpole Avenue" %in% craigslist[i, "street_name"] & "Vancouver West" %in% craigslist[i, "city"]] <- "Fairview"
  craigslist[i, "neighborhood"]["Hamilton Street" %in% craigslist[i, "street_name"] & "Vancouver West" %in% craigslist[i, "city"]] <- "Yaletown"
  craigslist[i, "neighborhood"]["Hamilton Street" %in% craigslist[i, "street_name"] & "New Westminster" %in% craigslist[i, "city"]] <- "Kelvin"
  craigslist[i, "neighborhood"]["Tsawwassen" %in% craigslist[i, "city"]] <- "Tsawwassen"
}

for (i in 1:nrow(craigslist)) {
  craigslist[i, "neighborhood"]["Marpole Avenue" %in% craigslist[i, "street"] & "Port Coquitlam" %in% craigslist[i, "city"]] <- "Port Coquitlam"
  craigslist[i, "neighborhood"]["Marpole Avenue" %in% craigslist[i, "street"] & "Vancouver West" %in% craigslist[i, "city"]] <- "Fairview"
  craigslist[i, "neighborhood"]["Hamilton Street" %in% craigslist[i, "street"] & "Vancouver West" %in% craigslist[i, "city"]] <- "Yaletown"
  craigslist[i, "neighborhood"]["Hamilton Street" %in% craigslist[i, "street"] & "New Westminster" %in% craigslist[i, "city"]] <- "Kelvin"
  craigslist[i, "neighborhood"]["Yaletown" %in% craigslist[i, "city"]] <- "Yaletown"
  craigslist[i, "neighborhood"]["Coal Harbour" %in% craigslist[i, "city"]] <- "Coal Harbour"
  craigslist[i, "neighborhood"]["Kerrisdale" %in% craigslist[i, "city"]] <- "Kerrisdale"
  craigslist[i, "neighborhood"]["Kitsilano" %in% craigslist[i, "city"]] <- "Kitsilano"
  craigslist[i, "neighborhood"]["Metrotown" %in% craigslist[i, "city"]] <- "Metrotown"
  craigslist[i, "neighborhood"]["Burnaby North" %in% craigslist[i, "street"]] <- "Burnaby North"
  craigslist[i, "neighborhood"]["Burnaby" %in% craigslist[i, "street"]] <- "Burnaby"
  craigslist[i, "neighborhood"]["Burquitlam" %in% craigslist[i, "street"] | "North Road" %in% craigslist[i, "street"]] <- "Burquitlam"
  craigslist[i, "neighborhood"]["Central Coquitlam" %in% craigslist[i, "street"]] <- "Coquitlam Centre"
  craigslist[i, "neighborhood"]["Coquitlam Center" %in% craigslist[i, "street"]] <- "Coquitlam Centre"
  craigslist[i, "neighborhood"]["Coquitlam Centre" %in% craigslist[i, "street"]] <- "Coquitlam Centre"
  craigslist[i, "neighborhood"]["Central Coquitlam" %in% craigslist[i, "street"]] <- "Central Coquitlam"
  craigslist[i, "neighborhood"]["Broadway" %in% craigslist[i, "street"] | "Coquitlam" %in% craigslist[i, "street"]] <- "Coquitlam"
  craigslist[i, "neighborhood"]["East Vancouver" %in% craigslist[i, "street"]] <- "East Vancouver"

  craigslist[i, "neighborhood"]["West Vancouver" %in% craigslist[i, "street"]] <- "West Vancouver"
  craigslist[i, "neighborhood"]["West Coquitlam" %in% craigslist[i, "street"]] <- "West Coquitlam"
  craigslist[i, "neighborhood"]["Vancouver" %in% craigslist[i, "street"]] <- "Vancouver"


  craigslist[i, "neighborhood"]["Surrey" %in% craigslist[i, "street"]] <- "Surrey"
  craigslist[i, "neighborhood"]["South Granville" %in% craigslist[i, "street"]] <- "South Granville"

  craigslist[i, "neighborhood"]["South Vancouver" %in% craigslist[i, "street"]] <- "South Vancouver"
  craigslist[i, "neighborhood"]["Richmond Centre" %in% craigslist[i, "street"]] <- "Richmond Central"
  craigslist[i, "neighborhood"]["Richmond" %in% craigslist[i, "street"]] <- "Richmond"
  craigslist[i, "neighborhood"]["Port Moody" %in% craigslist[i, "street"]] <- "Port Moody"

  craigslist[i, "neighborhood"]["Pitt Meadows" %in% craigslist[i, "street"]] <- "Pitt Meadows"
  craigslist[i, "neighborhood"]["North Vancouver" %in% craigslist[i, "street"]] <- "North Vancouver"
  craigslist[i, "neighborhood"]["North Coquitlam" %in% craigslist[i, "street"]] <- "North Coquitlam"
  craigslist[i, "neighborhood"]["North Burnaby" %in% craigslist[i, "street"]] <- "North Burnaby"

  craigslist[i, "neighborhood"]["New Westminster" %in% craigslist[i, "street"]] <- "New Westminster"
  craigslist[i, "neighborhood"]["Maple Ridge" %in% craigslist[i, "street"]] <- "Maple Ridge"
  craigslist[i, "neighborhood"]["East Burnaby" %in% craigslist[i, "street"]] <- "East Burnaby"
  craigslist[i, "neighborhood"]["Pitt Meadows" %in% craigslist[i, "city"]] <- "Pitt Meadows"
  craigslist[i, "neighborhood"]["Port Coquitlam" %in% craigslist[i, "city"]] <- "Port Coquitlam"
  craigslist[i, "neighborhood"]["Port Moody" %in% craigslist[i, "city"]] <- "Port Moody"

  craigslist[i, "neighborhood"]["Coquitlam West" %in% craigslist[i, "street"]] <- "Laurentian Belaire"
}

craigslist %>%
  tidyr::drop_na(., neighborhood) -> craigslist
###################################
### Reading in real estate data ###
###################################

housing <- read.csv(here::here("data", "housing_data.csv"))
housing[] <- lapply(housing, as.character)
housing$neighborhood <- NA
path <- list.files(path = here::here("data"), pattern = ".xlsx")
df <- tibble::data_frame(path = path) %>%
  dplyr::mutate(., path = paste0(here::here("data"), "/", path)) %>%
  dplyr::mutate(., sheet_name = purrr::map(path, readxl::excel_sheets)) %>%
  tidyr::unnest(.) %>%
  dplyr::mutate(., data = purrr::map2(
    path, sheet_name,
    ~readxl::read_excel(.x, .y)
  ))

data_streets <- df$data

for (i in 1:length(data_streets)) {
  housing$neighborhood[housing$street_name %in% (data_streets[[i]] %>%
    dplyr::pull(.))] <- colnames(data_streets[[i]])
}

for (i in 1:nrow(housing)) {
  housing[i, "neighborhood"]["Maple Ridge" %in% housing[i, "city"]] <- "Maple Ridge"
  housing[i, "neighborhood"]["Marpole Avenue" %in% housing[i, "street_name"] & "Port Coquitlam" %in% housing[i, "city"]] <- "Port Coquitlam"
  housing[i, "neighborhood"]["Marpole Avenue" %in% housing[i, "street_name"] & "Vancouver West" %in% housing[i, "city"]] <- "Fairview"
  housing[i, "neighborhood"]["Hamilton Street" %in% housing[i, "street_name"] & "Vancouver West" %in% housing[i, "city"]] <- "Yaletown"
  housing[i, "neighborhood"]["Hamilton Street" %in% housing[i, "street_name"] & "New Westminster" %in% housing[i, "city"]] <- "Kelvin"
  housing[i, "neighborhood"]["Tsawwassen" %in% housing[i, "city"]] <- "Tsawwassen"
}
housing %>%
  dplyr::mutate(
    price = stringr::str_sub(.[, "price"], start = 2, end = 8) %>%
      stringr::str_remove_all(., ","),
    squares = stringr::str_remove_all(.[, "squares"], "sq.ft.") %>%
      stringr::str_remove_all(., ",")
  ) %>%
  dplyr::mutate_at(., .vars = c("price", "squares", "age", "bed", "bath"), funs(as.integer(.))) %>%
  dplyr::mutate_if(., is.character, as.factor) -> housing

housing %>%
  dplyr::mutate(
    SqFt_mod = cut(.$squares,
      breaks = seq(from = 0, to = 1199, by = 100),
      labels = paste0(seq(from = 1, to = 1099, by = 100), "-", seq(from = 101, to = 1100, by = 100))
    ),
    SqFt_mod_2 = cut(.$squares,
      breaks = seq(from = 1100, to = 3099, by = 250),
      labels = paste0(seq(from = 1101, to = 2849, by = 250), "-", seq(from = 1351, to = 3100, by = 250))
    ),
    SqFt_mod_3 = cut(.$squares,
      breaks = seq(from = 3100, to = 13099, by = 500),
      labels = paste0(seq(from = 3101, to = 12599, by = 500), "-", seq(from = 3601, to = 13100, by = 500))
    )
  ) %>%
  tidyr::unite(., SqFt_mod, c("SqFt_mod", "SqFt_mod_2", "SqFt_mod_3"), sep = "", remove = TRUE) %>%
  dplyr::mutate(., SqFt_mod = gsub("NA", "", SqFt_mod)) -> housing

Today, we will be looking at the Vancouver housing market in Canada. We collected rent data from craigslist and also home prices from various websites. A home is on average the most expensive "investment" almost everyone makes and therefore, it is important to know the market. In this blog post, we will be answering questions such as:

  • What are the market rates for rents and homes in the Vancouver housing market?
  • At what prices are homes undervalued or overvalued?

The Vancouver housing market is one of the most expensive ones in the world. Consequently, one must spend a lot of money when purchasing a home. However, is the money spend on a home worth the cost? In order to answer this question, we also looked at price to rent ratios. In more detail, we wanted to know:

  • What locations have the best price to rent ratios?
  • In what locations should you buy and in what locations should you rent?

Data Collection

The data for this project was obtained from various websites that listed home prices. The rent data on the other hand was collected with the craigr package which is available on github. After we collected the data, we spend a lot of time inserting the neighborhoods by looking at the street names.

We did that in order to decrease the variance for our home prices and rents but on the other hand introduced bias in our analysis. We thought that we would compare and evaluate neighborhoods rather than particular street names due to the fact we only had one house for some street names. Therefore, this would increase the variance for our homes. Consequently, we analysed the prices and rents by neighborhood. If you are interested in finding out more about the bias-varaince trade-off, then check out this blog post.

We collected rent data and housing prices from Vancouver, Richmond, New Westminster, and Coquitlam. We restriced our search to apartments that cost less than a million dollars. This is because we did not want to collect any outlier luxury apartments worth millions of dollars.

What Are the Market Rates for Rent and Home Prices in Vancouver?

Multiple Linear Regression for Housing Prices

In order to answer this question, we fit a muliple linear regression model. One for rents and one for home prices. For home prices, we regressed price on age, number of bathrooms bath, number of bedrooms bed, square feet squares, and neighborhood.

Regression Equation for Housing Prices in the Greater Vancouver Area

price = β0 + β1age + β2bat**h + β3bed + β4squares + β5neighborhoo**d + ϵ

Below, you can find a summary table of the regression output. We only displayed the neighborhoods with the lowest estimates and the neighborhood with the highest estimates. We also displayed age, squares, bath, and bed as well as the intercept.

housing %>%
  stats::lm(price ~ age + bed + bath + squares + neighborhood, data = .) %>%
  base::summary(.) %>%
  broom::tidy(.) %>%
  dplyr::mutate_at(., .vars = c("estimate", "std.error", "statistic", "p.value"), funs(round(., 2))) %>%
  dplyr::arrange(estimate) %>%
  pander::pandoc.table(.)
term estimate std.error statistic p.value
neighborhoodMaple Ridge -463157 33081 -14 0
neighborhoodBirchland Manor -434378 61917 -7.02 0
neighborhoodPort Moody North -400267 83779 -4.78 0
neighborhoodPort Coquitlam -338276 27089 -12.49 0
neighborhoodMary Hill -317866 33957 -9.36 0
neighborhoodSapperton -300319 33824 -8.88 0
neighborhoodBurquitlam -289733 83405 -3.47 0
neighborhoodHarbour Chines -269512 33847 -7.96 0
neighborhoodQueens Park -257265 23902 -10.76 0
neighborhoodUnivercity -254310 25961 -9.8 0
neighborhoodQueensborough -250906 26057 -9.63 0
neighborhoodSunset -245710 37613 -6.53 0
neighborhoodLougheed -235268 29448 -7.99 0
neighborhoodNew Westminster Downtown -234424 19742 -11.87 0
neighborhoodRichmond South -224068 60423 -3.71 0
neighborhoodDeer Lake Park -223399 33774 -6.61 0
neighborhoodEagle Ridge -223138 31326 -7.12 0
neighborhoodSun Valley -222396 83390 -2.67 0.01
neighborhoodKelvin -221726 28039 -7.91 0
neighborhoodSullivan Heights -216351 37698 -5.74 0
neighborhoodCascade Heights -210652 35459 -5.94 0
neighborhoodMiddlegate -200505 21525 -9.32 0
neighborhoodBurrard Inlet 3 -199910 25825 -7.74 0
neighborhoodEastburn -199678 37719 -5.29 0
neighborhoodCassin -199212 22698 -8.78 0
neighborhoodRichmond Central -194340 19063 -10.19 0
neighborhoodSteveston -193270 24303 -7.95 0
neighborhoodSeymour Heights -191516 60507 -3.17 0
neighborhoodRenfrew-Collingwood -177266 23523 -7.54 0
neighborhoodRichmond North -166283 18541 -8.97 0
neighborhoodLynn Valley -160075 32399 -4.94 0
neighborhoodKillarney -159118 22276 -7.14 0
neighborhoodBuckingham Heights -153998 30354 -5.07 0
neighborhoodKensington-Cedar Cottage -152621 22415 -6.81 0
neighborhoodBryne Creek Ravine Park -151665 27538 -5.51 0
neighborhoodCapitol Hill -150342 35518 -4.23 0
neighborhoodThompson -150045 60315 -2.49 0.01
neighborhoodGarden Village -143267 29364 -4.88 0
neighborhoodVictoria-Fraserview -141997 32393 -4.38 0
neighborhoodBrentwood -139089 20506 -6.78 0
neighborhoodSouth Slope -136520 30239 -4.51 0
neighborhoodTsawwassen -126631 83646 -1.51 0.13
neighborhoodNorth Lonsdale -120820 35544 -3.4 0
neighborhoodBurnaby Mountain -116247 50616 -2.3 0.02
neighborhoodHastings-Sunrise -110496 23061 -4.79 0
neighborhoodCove Cliff -109287 83688 -1.31 0.19
neighborhoodBurnaby Lake -107346 60870 -1.76 0.08
neighborhoodPemberson Heights -105410 25205 -4.18 0
neighborhoodMetrotown -104171 18957 -5.5 0
neighborhoodSentinel Hill -91845 60440 -1.52 0.13
neighborhoodLynnmour -91146 35558 -2.56 0.01
neighborhoodGrandview-Woodland -89206 23899 -3.73 0
neighborhoodBurnaby Central -79311 84172 -0.94 0.35
neighborhoodWindsor Park -79251 50624 -1.57 0.12
neighborhoodMarpole -77902 23596 -3.3 0
neighborhoodNorth Vancouver Central -70411 21534 -3.27 0
neighborhoodFairview -62078 27350 -2.27 0.02
neighborhoodWillingdon Heights -59387 25420 -2.34 0.02
neighborhoodLower Lonsdale -59046 20853 -2.83 0
neighborhoodOakridge -51146 26808 -1.91 0.06
neighborhoodCapilano Highlands -50900 60274 -0.84 0.4
neighborhoodDeep Cove -47605 60288 -0.79 0.43
neighborhoodRiley Park -44719 26889 -1.66 0.1
neighborhoodDowntown Eastside -32024 28635 -1.12 0.26
neighborhoodMount Pleasant -29173 23274 -1.25 0.21
neighborhoodStrathcona -26594 33673 -0.79 0.43
neighborhoodUniversity Hill (UBC) -14637 23431 -0.62 0.53
neighborhoodCoal Harbour -8180 26852 -0.3 0.76
age -4862 192.2 -25.3 0
squares 353 15.48 22.81 0
neighborhoodPoint Grey 8896 21953 0.41 0.69
neighborhoodKitsilano 14209 19363 0.73 0.46
bath 27453 6747 4.07 0
neighborhoodKerrisdale 27685 23652 1.17 0.24
bed 34660 5977 5.8 0
neighborhoodDowntown 42785 18277 2.34 0.02
neighborhoodHollyburn 66133 27950 2.37 0.02
neighborhoodEagle Harbour 74902 50326 1.49 0.14
neighborhoodDundarave 90116 44587 2.02 0.04
neighborhoodWest End 95721 21230 4.51 0
neighborhoodYaletown 122073 22317 5.47 0
(Intercept) 476095 19136 24.88 0

From the output above, we can see that age, bed, bath, and squares are statistically significant. Some neighborhoods are also significant. As expected, the sign of age is negative. This means that on average, holding everything else constant, an one year increase in age decreases the value of the property by around $4861 dollars.

It is interesting to see that home prices in Maple Ridge drop the most when comparing to other neighborhoods. On the other hand, holding everything else constant, a home buyer has to pay 122,073 dollars extra when purchasing a house in Yaletown.

age, squares, bed, bath, and neighborhood explain around 61% of the variation in home prices. So, 39% ar still unexplained and are due to other factors. The F-statistic is < 0.01 and so we can conclude that our model is better than the intercept-only model.

What Are the Market Rates for Home Prices in the Greater Vancouver Area?

lm_house_price <- stats::lm(price ~ age + bed + bath + squares + neighborhood, data = housing)
predicted_values <- data.frame(age = 10, bed = 1, bath = 1, squares = 800, neighborhood = "Yaletown")
predict(lm_house_price, newdata = predicted_values)
   1 

894047.9

When one wants to buy a home in Yaletown, the market price for a one bedroom, one bathroom apartment with 800 square feet and 10 years old is:

476094.5 − 4861.85 * 10 + 27452.53 * 1 + 34660.06 * 1 + 352.98 * 800 + 122073.08 * 1 = 894045.7

So, whenever you are intereted in finding out the market rate of a particular house, then you can plug in age, number of bathrooms and bedrooms, and square feet into this equation.

If the price of a home is lower than the result of the regression equation, then this house might sell below market value. Likewise, if the price of a home is above the price of the regression equation's output, then this house might be above market value.

The next regression model we fit was for rents.

Multiple Linear Regression for Rent Prices in the Greater Vancouver Area

We regressed rent prices on bedrooms, square feet, and neigborhoods. For the craigslist data, we unfortunately did not collect covariates for age and number of bathrooms. Consequently, this will lower the variation explained in rent prices.

Regression Equation for Rent Prices in the Greater Vancouver Area

price = β0 + β1bed + β2squares + β3neighborhoo**d + ϵ

craigslist %>%
  stats::lm(Price ~ Bedrooms + SqFt + neighborhood, data = .) %>%
  base::summary(.) %>%
  broom::tidy(.) %>%
  dplyr::mutate_at(., .vars = c("estimate", "std.error", "statistic", "p.value"), funs(round(., 2))) %>%
  dplyr::arrange(estimate) %>%
  pander::pandoc.table(.)
term estimate std.error statistic p.value
neighborhoodCassin -1119 706.5 -1.58 0.11
neighborhoodBroadmoor -937.6 463.3 -2.02 0.04
neighborhoodRichmond South -902.9 544.2 -1.66 0.1
neighborhoodSeafair -708.1 487.9 -1.45 0.15
neighborhoodConnaught Heights -687.5 930.7 -0.74 0.46
neighborhoodWestwood Plateau -669.4 411.2 -1.63 0.1
neighborhoodDartmoore -666.7 788.6 -0.85 0.4
neighborhoodBurke Mountain -633.7 431.3 -1.47 0.14
neighborhoodEssondale -618.3 529.5 -1.17 0.24
neighborhoodMaple Ridge -575.5 379.7 -1.52 0.13
neighborhoodCentral Coquitlam -572.9 615.2 -0.93 0.35
neighborhoodPitt Meadows -505.4 455.2 -1.11 0.27
neighborhoodThompson -487.4 506.1 -0.96 0.34
neighborhoodEagle Ridge -416.7 1264 -0.33 0.74
neighborhoodBurnaby Mountain -386 1264 -0.31 0.76
neighborhoodNorth Coquitlam -381.7 931 -0.41 0.68
neighborhoodCoquitlam -351.8 381.3 -0.92 0.36
neighborhoodBurnaby Central -318.1 497.1 -0.64 0.52
neighborhoodQueensborough -314.3 516.9 -0.61 0.54
neighborhoodEastburn -290.6 489.1 -0.59 0.55
neighborhoodAustin Heights -256.9 506.9 -0.51 0.61
neighborhoodWestridge -254.2 585.6 -0.43 0.66
neighborhoodSoutharm -228 544.8 -0.42 0.68
neighborhoodPort Moody -208.4 396.1 -0.53 0.6
neighborhoodDeep Cove -208.1 931.1 -0.22 0.82
neighborhoodPort Coquitlam -197.3 386.8 -0.51 0.61
neighborhoodHarbour Chines -189.4 930.6 -0.2 0.84
neighborhoodNorth Burnaby -185.7 401 -0.46 0.64
neighborhoodSteveston -161.4 420.9 -0.38 0.7
neighborhoodEagle Harbour -115.3 1263 -0.09 0.93
neighborhoodSouth Slope -115 469.9 -0.24 0.81
neighborhoodSouth Vancouver -82.7 789.7 -0.1 0.92
neighborhoodMeadowbrook -81.24 1264 -0.06 0.95
neighborhoodCariboo -74 475.7 -0.16 0.88
neighborhoodBuckingham Heights -73.86 496.7 -0.15 0.88
neighborhoodRiver Springs -62.72 931 -0.07 0.95
neighborhoodRichmond Central -47.47 381.7 -0.12 0.9
neighborhoodBurnaby South -42.63 497.3 -0.09 0.93
neighborhoodChineside -27.57 1264 -0.02 0.98
neighborhoodBurquitlam -16.6 425.2 -0.04 0.97
neighborhoodCascade Heights -2.37 615.5 0 1
SqFt 1.2 0.04 26.73 0
neighborhoodCoquitlam Centre 9.7 425.1 0.02 0.98
neighborhoodHarbour Village 33.18 707.6 0.05 0.96
neighborhoodSouth Westminster 33.32 1265 0.03 0.98
neighborhoodHastings-Sunrise 43.78 420.2 0.1 0.92
neighborhoodMarpole 47.59 505.7 0.09 0.93
Bedrooms 51.94 33.43 1.55 0.12
neighborhoodBurnaby Lake 54.02 563.2 0.1 0.92
neighborhoodMary Hill 62.57 653.8 0.1 0.92
neighborhoodSullivan Heights 67.68 517.7 0.13 0.9
neighborhoodKelvin 70.56 517.5 0.14 0.89
neighborhoodLaurentian Belaire 71.82 654.2 0.11 0.91
neighborhoodBurnaby Heights 72.37 930.8 0.08 0.94
neighborhoodWest Coquitlam 78.76 654 0.12 0.9
neighborhoodBurnaby North 80.08 529.4 0.15 0.88
neighborhoodBryne Creek Ravine Park 80.18 789.7 0.1 0.92
neighborhoodRichmond 87.81 381.4 0.23 0.82
neighborhoodPort Moody North 94.18 1264 0.07 0.94
neighborhoodEast Burnaby 113.9 652.9 0.17 0.86
neighborhoodBurnaby 124.6 405.5 0.31 0.76
neighborhoodSurrey 129.8 587.1 0.22 0.82
neighborhoodPitt Meadow 131.8 1264 0.1 0.92
neighborhoodNew Westminster Downtown 132.4 470.5 0.28 0.78
neighborhoodLougheed 138.5 415.6 0.33 0.74
neighborhoodNew Westminster 146 384.5 0.38 0.7
neighborhoodGarden Village 178.9 563.8 0.32 0.75
neighborhoodSapperton 186.6 482.7 0.39 0.7
neighborhoodQueens Park 187.7 470.7 0.4 0.69
neighborhoodEast Vancouver 195.5 429.2 0.46 0.65
neighborhoodMiddlegate 218.8 506.5 0.43 0.67
neighborhoodVancouver 226.1 517.4 0.44 0.66
neighborhoodDeer Lake Park 230 531 0.43 0.66
neighborhoodDundarave 237.9 789.6 0.3 0.76
neighborhoodOxford Heights 239.4 789.2 0.3 0.76
neighborhoodCoquitlam Center 260.5 465.4 0.56 0.58
neighborhoodBrighouse 274.8 517.7 0.53 0.6
neighborhoodDunbar Southlands 298 436.1 0.68 0.49
neighborhoodRenfrew-Collingwood 329.2 470.7 0.7 0.48
neighborhoodUnivercity 334.4 456.7 0.73 0.46
neighborhoodBrentwood 336.6 406.9 0.83 0.41
neighborhoodKillarney 356.8 435.2 0.82 0.41
neighborhoodRichmond North 377.7 381.5 0.99 0.32
neighborhoodVictoria-Fraserview 381.6 564.5 0.68 0.5
neighborhoodGrandview-Woodland 401.3 460.2 0.87 0.38
neighborhoodKensington-Cedar Cottage 456.4 414.6 1.1 0.27
neighborhoodOakridge 467.2 415.6 1.12 0.26
neighborhoodBurkeville 484.8 1265 0.38 0.7
neighborhoodFairview 495.5 505.3 0.98 0.33
neighborhoodMetrotown 512.9 378.9 1.35 0.18
neighborhoodHollyburn 532 564.4 0.94 0.35
neighborhoodCapitol Hill 558.9 585.7 0.95 0.34
(Intercept) 584 371.8 1.57 0.12
neighborhoodRiley Park 590.9 423.1 1.4 0.16
neighborhoodSouth Granville 637.8 517.2 1.23 0.22
neighborhoodUniversity Hill (UBC) 681.2 430.6 1.58 0.11
neighborhoodSunset 747.6 446.4 1.67 0.09
neighborhoodNorth Vancouver 766.8 707.3 1.08 0.28
neighborhoodStrathcona 790.9 446 1.77 0.08
neighborhoodKerrisdale 793.1 396.3 2 0.05
neighborhoodSun Valley 952.1 1265 0.75 0.45
neighborhoodWest End 1002 383.1 2.61 0.01
neighborhoodLynn Valley 1036 931.4 1.11 0.27
neighborhoodMount Pleasant 1067 410.3 2.6 0.01
neighborhoodWest Vancouver 1124 428.4 2.62 0.01
neighborhoodWillingdon Heights 1139 545.8 2.09 0.04
neighborhoodDowntown 1258 376.3 3.34 0
neighborhoodPoint Grey 1277 422.6 3.02 0
neighborhoodDowntown Eastside 1433 615.7 2.33 0.02
neighborhoodKitsilano 1636 377.7 4.33 0
neighborhoodYaletown 1689 377 4.48 0
neighborhoodCoal Harbour 1941 389.6 4.98 0
neighborhoodShaugnessey 2370 518 4.57 0

Bedrooms and square feet have positive coefficients. This means that on average, holding everything else constant, the more bedrooms and the more square feet an apartment has, the more expensive it will be. The most expensive neighborhoods are Shaugnessey, Coal Harbour, and Yaletwon. The p-values for these neighborhoods are statistically significant.

SqFt,bedrooms, and neighborhood explain around 50% of the variation in rents. This means that the other 50% is due to other factors and remains unexplained in our model. The F-statistic is again statistically significant, which means that the fitted model with the covariates is better than the intercept-only model.

What Are the Market Rates for Rent Prices in the Greater Vancouver Area?

The market rate for renting the same 1 bedroom apartment with 800 squre feet in Yaletown would cost $3284 dollars.

The equation would look like this:

584.04 + 51.94 * 1 + 1.2 * 800 + 1689.49 * 1 = 3284

lm_rent <- stats::lm(Price ~ Bedrooms + SqFt + neighborhood, data = craigslist)
predicted_values <- data.frame(Bedrooms = 1, SqFt = 800, neighborhood = "Yaletown")
predict(lm_rent, newdata = predicted_values)
  1 

3283.94

So, whenever there is an apartment with a renting price below the one you'll get when plugging in the information into the equation above, then this apartment's rent is likely below market value.

Likewise, is the renting price is above the price you'll get from the equation, then the rent is likely above market value.

Here, I use the word likely because our regression equation explains only 50% of the variation in rent prices. Therefore, there might be other factors that contribute to rent prices that are not accounted for in the equation above.

Price to Rent Ratios for Different Neighborhoods in Vancouver

If you are familiar with the successful real estate investor Grant Cardone, then you have probably the sentence:

Rent where you live and own what you can rent.

This is what we are trying to figure out now.

The price to rent ratio is calcutated by the price of the house devided by the yearly rent. So, $latex ratio = $. Consequently, you want to rent when the price to rent ratio is high. This happens when the denominator of the equation (rent) is low and house prices, the nominator, is high. On the other hand, you want to buy a property, when the the price to rent ratio is low. Meaning, a low nominator (house prices) and a high denominator (rents).

In What Locations in the Vancouver Housing Market Should You Buy and in What Locations Should You Rent?

We first calculated the average price of houses and rents in certain neighborhoods with certain square feet. Then we kept the neighborhoods that had at least three home prices listed and three rent listings. The reason why we did it is because we wanted to decrease the variance by averaging the neighborhood prices/rents and also by throwing out houses/apartments that had less than 3 listings.

Afterwards, we calculated the price to rent ratios by by matching apartment prices and apartment rents with the same neighborhood and the same square feet.

The price to rent ratios would have been more accurate if we had also the age of certain apartments. This would ensure an even more accurate matching of house prices and rent prices. Consequently, this would have resulted in more accurate price to rent ratios.

The results are displayed in the table below.

# here, we are splitting the craigslist data frame into a list of data frames for each neighborhood
# then we are grouping by square feet and then calculating the average rent and number of apartments
# then we are creating a new variable square_neighborhood to do an
# inner join later with the housing data
craigslist %>%
  tidyr::drop_na(., SqFt) %>%
  base::split(., .$neighborhood) %>%
  purrr::map(~dplyr::group_by(., SqFt_mod)) %>%
  purrr::map(~dplyr::mutate(.,
    avg_price_rent = mean(Price, na.rm = TRUE),
    n_rent = n()
  )) %>%
  purrr::map(~dplyr::distinct(., avg_price, .keep_all = TRUE)) %>%
  base::do.call(rbind, .) %>%
  dplyr::select(., SqFt_mod, neighborhood, avg_price_rent, n_rent) %>%
  tidyr::unite(., square_neighborhood, SqFt_mod, neighborhood, sep = "_") -> rent_avg

# here, we are doing the same thing as above witht the housing data frame
housing %>%
  tidyr::drop_na(., squares) %>%
  base::split(., .$neighborhood) %>%
  purrr::map(~dplyr::group_by(., SqFt_mod)) %>%
  purrr::map(~dplyr::mutate(.,
    avg_price_house = mean(price, na.rm = TRUE),
    n_housing = n()
  )) %>%
  purrr::map(~dplyr::distinct(., avg_price, .keep_all = TRUE)) %>%
  base::do.call(rbind, .) %>%
  dplyr::select(., neighborhood, SqFt_mod, avg_price_house, n_housing) %>%
  tidyr::unite(., square_neighborhood, SqFt_mod, neighborhood, sep = "_") -> housing_avg

# now we are doing an inner join on the variable square_neigborhood
# then we are calculating the price to rent ratios for neigborhoods with corresponding square feet
rent_avg %>%
  dplyr::inner_join(., housing_avg, by = "square_neighborhood") %>%
  dplyr::mutate(.,
    avg_price_rent = avg_price_rent * 12,
    price_rent_ratio = avg_price_house / avg_price_rent
  ) %>%
  dplyr::arrange(desc(price_rent_ratio)) %>%
  dplyr::select(., -avg_price_rent, -avg_price_house) %>%
  dplyr::filter(., n_rent > 2 & n_housing > 2) %>%
  tidyr::separate(., square_neighborhood, into = c("square_feet", "neighborhood"), sep = "_") %>%
  pander::pandoc.table(.) # %>%
square_feet neighborhood n_rent n_housing price_rent_ratio
801-901 Riley Park 5 6 41.3
701-801 Oakridge 5 5 37.54
801-901 Maple Ridge 10 3 34.5
801-901 Hastings-Sunrise 4 5 34.45
1101-1351 Brentwood 6 7 33.88
701-801 Metrotown 15 25 32.7
601-701 Richmond Central 15 17 31.33
601-701 Mount Pleasant 8 8 31.17
701-801 Hastings-Sunrise 3 14 31.02
601-701 Grandview-Woodland 3 3 31.02
601-701 Metrotown 38 10 30.61
1001-101 Richmond Central 8 16 30.47
501-601 Mount Pleasant 5 9 30.43
801-901 Richmond Central 22 35 30.06
501-601 West End 32 9 30.01
901-1001 Killarney 3 10 29.68
601-701 New Westminster Downtown 6 4 29.54
701-801 Kitsilano 15 24 29.5
701-801 Riley Park 3 4 29.39
801-901 University Hill (UBC) 8 11 28.99
501-601 Metrotown 33 23 28.93
401-501 Killarney 5 4 28.76
601-701 Brentwood 5 14 28.68
601-701 Richmond North 11 20 28.51
401-501 West End 51 3 28.48
701-801 Kerrisdale 6 9 28.43
1101-1351 Steveston 4 8 28.4
901-1001 University Hill (UBC) 3 5 28.38
1101-1351 Maple Ridge 16 5 27.85
601-701 Coal Harbour 6 4 27.81
701-801 Brentwood 4 7 27.79
901-1001 Port Coquitlam 13 6 27.71
701-801 Richmond Central 9 11 27.63
801-901 Port Coquitlam 18 3 27.59
501-601 Richmond North 23 36 27.53
801-901 Metrotown 49 22 27.46
901-1001 Grandview-Woodland 3 6 27.45
1101-1351 Kerrisdale 8 3 27.34
601-701 Kensington-Cedar Cottage 5 3 27.02
701-801 New Westminster Downtown 3 20 26.85
601-701 West End 33 13 26.81
901-1001 Richmond Central 10 36 26.72
901-1001 Richmond North 17 44 26.6
801-901 Richmond North 27 63 26.55
701-801 Kensington-Cedar Cottage 8 15 26.21
1101-1351 Richmond North 13 38 26.18
501-601 Killarney 6 11 26.17
601-701 Hastings-Sunrise 9 15 26.15
801-901 Oakridge 3 5 26.03
501-601 Kitsilano 22 15 26.02
801-901 Brentwood 14 17 25.98
701-801 West End 9 16 25.96
801-901 Sullivan Heights 3 4 25.91
501-601 Richmond Central 4 4 25.83
601-701 Kitsilano 31 28 25.81
1001-101 Richmond North 11 27 25.75
601-701 Downtown 59 68 25.72
701-801 Yaletown 28 14 25.69
1101-1351 Richmond Central 15 27 25.57
1351-1601 Richmond Central 12 6 25.53
1001-101 University Hill (UBC) 6 4 25.52
501-601 Yaletown 54 7 25.31
401-501 Downtown 34 26 25.19
701-801 Killarney 4 10 25.12
701-801 Richmond North 20 21 25.11
601-701 Queens Park 3 3 25.07
801-901 Kitsilano 32 18 24.89
801-901 Downtown 23 37 24.87
501-601 Downtown 66 67 24.66
501-601 Kensington-Cedar Cottage 8 4 24.44
1101-1351 Metrotown 19 27 24.28
901-1001 Metrotown 23 25 23.8
901-1001 Kitsilano 23 10 23.74
701-801 Renfrew-Collingwood 5 10 23.62
1351-1601 Maple Ridge 15 10 23.57
601-701 Yaletown 29 7 23.56
801-901 Victoria-Fraserview 3 4 23.55
401-501 Kitsilano 11 4 23.5
901-1001 Downtown 15 17 23.49
1001-101 Port Coquitlam 8 4 23.49
801-901 Lougheed 15 5 23.32
901-1001 Univercity 3 7 23.02
701-801 Downtown 31 41 22.97
801-901 Mount Pleasant 5 7 22.89
501-601 Coal Harbour 11 9 22.85
1101-1351 Oakridge 5 4 22.62
901-1001 Brentwood 5 11 22.37
701-801 Mount Pleasant 6 7 22.26
701-801 Downtown Eastside 3 3 22.22
1101-1351 Port Coquitlam 10 4 22.05
1101-1351 Willingdon Heights 4 7 21.47
901-1001 Lougheed 7 5 21.45
601-701 Point Grey 3 9 21.13
601-701 Riley Park 4 5 21.03
801-901 Univercity 5 6 20.69
801-901 West End 9 3 20.66
1351-1601 Richmond North 7 8 20.65
1601-1851 Maple Ridge 11 3 20.53
901-1001 Mount Pleasant 5 4 19.7
701-801 Grandview-Woodland 3 9 19.47
1001-101 Yaletown 14 3 18.9
1001-101 Downtown 12 5 18.52
1001-101 Kitsilano 4 7 18.5
901-1001 West End 8 4 17.97
1101-1351 Kitsilano 12 4 16.49
# write.table(., file = "price_to_rent.txt", sep = ",", quote = FALSE, row.names = F)

Buying vs. Renting in the Greater Vancouver Real Estate Market

So, back to the question if you should buy or rent in Vancouver. If you want to live close to downtown Vancouver, then neighborhoods with a high price to rent ratio would be Hastings-Sunrise, Mount Pleasant, or Grandview-Woodland.

On the other hand, if you want to purchase a property for investment purposes then you should buy a home in Kitsilano, West End, Downtown, or Yaletown. These are the neighborhoods with the lowest price to rent ratios. It is also noticeable that these ratios suggest that apartments with higher square feet should be purchased. Consequently, apartments with 900 or more square feet will yield the lowest price to rent ratios. Smaller apartments in these areas, with 400, 500, or 600 square feet won't be as profitable.

In addition to the table above, we also did the same analysis as above except that we predicted the rent prices from the previous regression for the housing data set. Likewise, we predicted the housing prices with the previous housing regression for the craigslist data set.

Price to Rent Ratios for Different Neighborhoods by Predicting Renting Prices

We predicted rent prices for the housing price data set and then calculated the price to rent ratios.

# regression for rent prices
craigslist %>%
  stats::lm(Price ~ Bedrooms + SqFt + neighborhood, data = .) -> lm_rent

# predicting rents for housing data set
# identifying which levels in craigslist are not in housing
# and then removing these levels from housing for predictions so we won't get an error
unused_levels <- housing[which(!(housing$neighborhood) %in% craigslist$neighborhood), "neighborhood"] %>%
  unique(.) %>%
  as.character()

pred_df <- housing[!(housing$neighborhood %in% c(unused_levels, "Birchland Manor", "Lower Lonsdale")), ] %>%
  gdata::drop.levels(.) %>%
  dplyr::rename(., Bedrooms = bed, SqFt = squares)

pred_df %>%
  dplyr::mutate(., predictions_rent = predict(lm_rent, newdata = pred_df, type = "response")) %>%
  base::split(., .$neighborhood) %>%
  purrr::map(~dplyr::group_by(., SqFt_mod)) %>%
  purrr::map(~dplyr::mutate(.,
    avg_price_house = mean(price, na.rm = TRUE),
    predicted_rent = mean(predictions_rent, na.rm = TRUE),
    n = n()
  )) %>%
  purrr::map(~dplyr::distinct(., avg_price, .keep_all = TRUE)) %>%
  base::do.call(rbind, .) %>%
  dplyr::select(., SqFt_mod, neighborhood, avg_price_house, n, predicted_rent) %>%
  tidyr::unite(., square_neighborhood, SqFt_mod, neighborhood, sep = "_") %>%
  dplyr::filter(., n > 2) %>%
  dplyr::mutate(., price_rent_ratio = avg_price_house / (predicted_rent * 12)) %>%
  dplyr::arrange(., desc(price_rent_ratio)) %>%
  tidyr::separate(., square_neighborhood, into = c("square_feet", "neighborhood"), sep = "_") %>%
  # write.table(., file = "price_to_rent_rent_predicted.txt", sep = ",", quote = FALSE, row.names = F)
  pander::pandoc.table(., split.table = Inf)
square_feet neighborhood avg_price_house n predicted_rent price_rent_ratio
701-801 Cassin 562140 5 460.1 101.8
801-901 Cassin 635129 7 599.8 88.25
901-1001 Cassin 699275 12 711.1 81.95
1001-101 Cassin 795725 4 841.1 78.84
1101-1351 Cassin 851513 7 947.5 74.89
901-1001 South Slope 824580 5 1677 40.97
801-901 Maple Ridge 540233 3 1124 40.05
701-801 Marpole 792433 9 1661 39.76
901-1001 Eastburn 730967 3 1554 39.2
801-901 Arbutus Ridge 786160 5 1678 39.04
501-601 Marpole 629828 7 1353 38.79
801-901 Eastburn 660520 5 1425 38.64
401-501 Marpole 561000 3 1220 38.33
701-801 Arbutus Ridge 700388 9 1525 38.28
601-701 Arbutus Ridge 663120 5 1447 38.18
1101-1351 Eagle Ridge 799533 3 1760 37.85
901-1001 Buckingham Heights 771333 3 1700 37.8
801-901 Buckingham Heights 725800 5 1605 37.69
801-901 Marpole 788500 4 1745 37.66
1001-101 Eagle Ridge 705567 3 1582 37.17
1001-101 Steveston 801263 3 1816 36.78
1101-1351 Queensborough 805722 9 1833 36.64
601-701 Richmond Central 581744 17 1364 35.55
501-601 Richmond Central 530739 4 1250 35.37
801-901 Richmond Central 693236 35 1662 34.76
901-1001 Queensborough 631400 5 1529 34.41
901-1001 Eagle Ridge 569300 3 1386 34.22
601-701 Hastings-Sunrise 602686 15 1469 34.19
1101-1351 Steveston 783850 8 1920 34.02
701-801 Richmond Central 620708 11 1526 33.9
701-801 Oakridge 795000 5 1989 33.31
801-901 Hastings-Sunrise 694560 5 1753 33.02
701-801 Hastings-Sunrise 624192 14 1579 32.94
701-801 Steveston 550280 5 1414 32.43
1001-101 Queensborough 629267 3 1624 32.3
1001-101 Richmond Central 740350 16 1924 32.07
801-901 Bryne Creek Ravine Park 682714 7 1779 31.99
801-901 Steveston 592650 6 1563 31.59
901-1001 Killarney 819300 10 2168 31.49
1101-1351 Bryne Creek Ravine Park 848750 4 2252 31.4
701-801 Brentwood 726927 7 1943 31.18
701-801 Riley Park 805175 4 2156 31.11
901-1001 Richmond Central 666030 36 1784 31.1
801-901 University Hill (UBC) 888973 11 2387 31.03
701-801 Metrotown 776596 25 2093 30.92
801-901 Port Coquitlam 542596 3 1468 30.81
1101-1351 Brentwood 914843 7 2489 30.64
1351-1601 Maple Ridge 671670 10 1855 30.17
601-701 Kerrisdale 788560 5 2180 30.15
1001-101 Hollyburn 894967 3 2481 30.06
801-901 Brentwood 726487 17 2035 29.75
801-901 Riley Park 822783 6 2306 29.73
801-901 Metrotown 792977 22 2226 29.68
801-901 Grandview-Woodland 743996 5 2097 29.56
1001-101 University Hill (UBC) 928750 4 2627 29.46
501-601 Metrotown 631296 23 1787 29.43
601-701 New Westminster Downtown 542500 4 1543 29.3
1001-101 Middlegate 760800 5 2167 29.26
801-901 Oakridge 743338 5 2126 29.13
1001-101 Brentwood 793863 8 2272 29.12
801-901 Harbour Chines 532225 4 1524 29.11
1101-1351 Richmond Central 733273 27 2107 29
601-701 Grandview-Woodland 635967 3 1835 28.88
801-901 Richmond North 717376 63 2079 28.75
401-501 Killarney 541925 4 1575 28.67
601-701 Metrotown 660360 10 1920 28.67
1101-1351 Univercity 860967 3 2508 28.61
801-901 Killarney 707200 10 2064 28.55
901-1001 Kerrisdale 908817 6 2663 28.44
901-1001 Port Coquitlam 553883 6 1627 28.36
501-601 Grandview-Woodland 584700 4 1720 28.33
901-1001 Kelvin 643475 4 1898 28.25
501-601 Killarney 555782 11 1649 28.08
701-801 New Westminster Downtown 576804 20 1715 28.02
501-601 Renfrew-Collingwood 544975 4 1627 27.92
1101-1351 Maple Ridge 546200 5 1631 27.9
801-901 Kensington-Cedar Cottage 725314 13 2167 27.89
901-1001 Richmond North 734586 44 2200 27.83
701-801 Killarney 647650 10 1941 27.81
1001-101 Richmond North 776711 27 2329 27.79
501-601 Richmond North 564942 36 1696 27.76
901-1001 New Westminster Downtown 643440 10 1942 27.61
801-901 Kelvin 582180 5 1760 27.56
801-901 New Westminster Downtown 601607 12 1819 27.55
801-901 Fairview 718200 4 2172 27.55
901-1001 Queens Park 666333 3 2024 27.43
901-1001 Cascade Heights 594450 4 1814 27.31
801-901 Middlegate 631005 22 1927 27.28
1101-1351 Marpole 730333 3 2234 27.24
601-701 Riley Park 659935 5 2026 27.15
601-701 Richmond North 583135 20 1794 27.09
1001-101 Queens Park 696500 4 2144 27.07
701-801 Richmond North 635351 21 1962 26.98
1351-1601 Richmond Central 776833 6 2400 26.98
1001-101 New Westminster Downtown 668764 11 2075 26.86
701-801 Renfrew-Collingwood 612259 10 1908 26.74
1001-101 Garden Village 669333 3 2086 26.73
801-901 Hollyburn 716967 9 2235 26.73
801-901 Renfrew-Collingwood 656089 9 2047 26.7
601-701 Queens Park 509967 3 1595 26.64
901-1001 Garden Village 637667 9 1996 26.63
601-701 Middlegate 521180 5 1632 26.61
1101-1351 Kerrisdale 932000 3 2923 26.57
901-1001 University Hill (UBC) 792400 5 2485 26.57
601-701 Killarney 575000 3 1810 26.47
901-1001 Brentwood 680336 11 2150 26.37
1001-101 Port Coquitlam 546150 4 1726 26.37
901-1001 Sapperton 625450 4 1988 26.21
701-801 Fairview 630450 4 2008 26.17
601-701 Brentwood 550607 14 1758 26.09
701-801 Strathcona 734450 4 2353 26.01
701-801 Middlegate 572414 7 1836 25.98
601-701 Renfrew-Collingwood 544133 6 1748 25.94
901-1001 Capitol Hill 747067 6 2408 25.86
1101-1351 Richmond North 779194 38 2514 25.83
1101-1351 Kelvin 690500 4 2229 25.81
701-801 Kerrisdale 723889 9 2339 25.79
701-801 Grandview-Woodland 607078 9 1962 25.78
801-901 Willingdon Heights 875000 3 2838 25.69
801-901 Sullivan Heights 556650 4 1807 25.67
901-1001 Kensington-Cedar Cottage 693883 6 2262 25.57
701-801 Kensington-Cedar Cottage 623232 15 2049 25.35
801-901 Lougheed 553760 5 1824 25.3
1101-1351 Oakridge 762750 4 2514 25.28
1101-1351 New Westminster Downtown 689189 27 2274 25.26
1001-101 Capitol Hill 763940 5 2521 25.25
501-601 West End 702000 9 2319 25.22
901-1001 Univercity 653700 7 2163 25.19
1001-101 West End 895267 3 2966 25.15
701-801 West End 771100 16 2559 25.11
801-901 Downtown 889295 37 2960 25.04
901-1001 Metrotown 693531 25 2309 25.03
1101-1351 University Hill (UBC) 858700 4 2860 25.02
601-701 West End 724828 13 2416 25
1101-1351 Metrotown 787243 27 2625 24.99
801-901 West End 788667 3 2637 24.93
601-701 Mount Pleasant 744425 8 2500 24.81
701-801 Capitol Hill 627967 3 2114 24.75
901-1001 Grandview-Woodland 652150 6 2197 24.74
901-1001 Middlegate 601633 3 2029 24.71
701-801 Hollyburn 627450 4 2124 24.61
1001-101 Fairview 708667 3 2401 24.6
901-1001 Downtown 908670 17 3083 24.56
801-901 Univercity 604333 6 2055 24.51
701-801 Downtown 822805 41 2807 24.43
901-1001 Renfrew-Collingwood 616000 3 2113 24.3
901-1001 West End 829475 4 2848 24.27
601-701 Kensington-Cedar Cottage 528600 3 1824 24.16
501-601 Kensington-Cedar Cottage 518450 4 1789 24.15
801-901 Victoria-Fraserview 607675 4 2103 24.08
1101-1351 Willingdon Heights 930814 7 3234 23.99
801-901 Mount Pleasant 794371 7 2766 23.94
1001-101 Mary Hill 583225 4 2031 23.93
1101-1351 Port Coquitlam 570975 4 1991 23.9
401-501 West End 633667 3 2218 23.81
701-801 Yaletown 913700 14 3227 23.6
1351-1601 New Westminster Downtown 723611 18 2557 23.58
901-1001 Lougheed 553600 5 1960 23.54
1001-101 Metrotown 696678 18 2471 23.49
1101-1351 Queens Park 642721 14 2301 23.28
901-1001 Lynn Valley 796250 4 2860 23.2
601-701 Downtown 741666 68 2665 23.19
501-601 Mount Pleasant 653733 9 2379 22.9
701-801 Mount Pleasant 713971 7 2599 22.89
801-901 Downtown Eastside 837394 4 3116 22.4
801-901 Lynn Valley 738667 3 2754 22.35
1001-101 Downtown 844340 5 3168 22.21
501-601 Downtown 682099 67 2560 22.2
801-901 Point Grey 791000 4 2981 22.11
1351-1601 Richmond North 736074 8 2778 22.08
901-1001 Willingdon Heights 791250 4 3006 21.94
1101-1351 Lynn Valley 815333 3 3098 21.93
501-601 Lynn Valley 624225 4 2372 21.93
701-801 Downtown Eastside 794967 3 3049 21.73
1001-101 Yaletown 938000 3 3606 21.68
701-801 Point Grey 732723 13 2818 21.67
401-501 Downtown 630488 26 2434 21.58
1101-1351 Sapperton 602025 4 2357 21.28
1101-1351 Sullivan Heights 552300 3 2196 20.96
601-701 Willingdon Heights 641400 5 2551 20.95
501-601 Point Grey 639243 7 2557 20.83
1601-1851 Maple Ridge 556567 3 2270 20.43
601-701 Lynn Valley 597950 4 2462 20.24
1351-1601 Fairview 702267 3 2916 20.07
901-1001 Kitsilano 828890 10 3466 19.93
501-601 Yaletown 714000 7 2986 19.93
801-901 Kitsilano 788317 18 3302 19.89
1101-1351 Kitsilano 889250 4 3733 19.85
601-701 Point Grey 641867 9 2710 19.74
901-1001 Mount Pleasant 680750 4 2892 19.62
601-701 Yaletown 726514 7 3096 19.56
701-801 Kitsilano 746658 24 3188 19.52
1001-101 Kitsilano 821571 7 3579 19.13
601-701 Kitsilano 650889 28 3058 17.74
501-601 Kitsilano 619907 15 2947 17.53
601-701 Coal Harbour 697950 4 3340 17.41
501-601 Coal Harbour 643065 9 3262 16.43
401-501 Kitsilano 546222 4 2834 16.06

There are still some similarities when we are looking at the lowest price to rent ratios. The Kitsilano neighborhood has very low price to rent ratios for different square feet apartments. Similarily for Yaletown. When we look at the highest price to rent ratios then we see that Cassin is on top with different square feet apartments.

Now, let's look at price to rent ratios where we predict apartment prices for the craigslist data set.

Price to Rent Ratios for Different Neighborhoods by Predicting Hosuing Prices

Here, we took the craigslist data set and predicted the housing prices with the previous regression model. The table looks like this:

# regression for hosuing prices
housing %>%
  stats::lm(price ~ bed + squares + neighborhood, data = .) -> lm_prices

# predicting rents for craigslist data set
# identifying which levels in craigslist are not in craigslist
# and then removing these levels from craigslist for predictions
unused_levels <- craigslist[which(!(craigslist$neighborhood) %in% housing$neighborhood), "neighborhood"] %>%
  unique(.) %>%
  as.character()

pred_df <- craigslist[!(craigslist$neighborhood %in% unused_levels), ] %>%
  gdata::drop.levels(.) %>%
  dplyr::rename(., bed = Bedrooms, squares = SqFt)

pred_df %>%
  dplyr::mutate(., predictions_house = predict(lm_prices, newdata = pred_df, type = "response")) %>%
  base::split(., .$neighborhood) %>%
  purrr::map(~dplyr::group_by(., SqFt_mod)) %>%
  purrr::map(~dplyr::mutate(.,
    avg_price_rent = mean(Price, na.rm = TRUE),
    predicted_house = mean(predictions_house, na.rm = TRUE),
    n = n()
  )) %>%
  purrr::map(~dplyr::distinct(., avg_price, .keep_all = TRUE)) %>%
  base::do.call(rbind, .) %>%
  dplyr::select(., SqFt_mod, neighborhood, avg_price_rent, n, predicted_house) %>%
  tidyr::drop_na(., predicted_house) %>%
  tidyr::unite(., square_neighborhood, SqFt_mod, neighborhood, sep = "_") %>%
  dplyr::filter(., n > 2) %>%
  dplyr::mutate(., price_rent_ratio = predicted_house / (avg_price_rent * 12)) %>%
  dplyr::arrange(., desc(price_rent_ratio)) %>%
  tidyr::separate(., square_neighborhood, into = c("square_feet", "neighborhood"), sep = "_") %>%
  # write.table(., file = "price_to_rent_house_predicted.txt", sep = ",", quote = FALSE, row.names = F)
  pander::pandoc.table(., split.table = Inf)
square_feet neighborhood avg_price_rent n predicted_house price_rent_ratio
South Slope 1565 5 1321591 70.37
University Hill (UBC) 2177 11 1512663 57.91
Metrotown 2111 36 1280332 50.54
Middlegate 2109 8 1254574 49.57
Maple Ridge 1818 31 1047620 48.03
Richmond Central 2291 28 1265248 46.02
Killarney 2680 5 1387764 43.15
Arbutus Ridge 2650 3 1366299 42.97
801-901 Riley Park 1660 5 828926 41.61
601-701 Univercity 1083 3 520626 40.05
701-801 Burnaby Central 1500 3 703519 39.08
401-501 Renfrew-Collingwood 1067 3 499441 39.02
901-1001 Burnaby Central 1650 3 754665 38.11
1101-1351 South Slope 1875 4 821050 36.49
701-801 South Slope 1563 3 673456 35.9
401-501 Richmond Central 1217 3 512564 35.11
801-901 Hastings-Sunrise 1680 4 694280 34.44
401-501 Univercity 1135 3 468437 34.39
2101-2351 Richmond Central 2733 3 1112829 33.93
401-501 Riley Park 1717 3 690875 33.54
1101-1351 Hastings-Sunrise 1971 9 786962 33.28
701-801 Hastings-Sunrise 1677 3 669335 33.27
601-701 Brentwood 1600 5 632144 32.92
801-901 Kerrisdale 2042 7 803525 32.79
501-601 Kerrisdale 1845 4 721919 32.61
701-801 Oakridge 1765 5 687983 32.48
2101-2351 Steveston 2806 5 1093378 32.47
601-701 Dundarave 1617 3 628213 32.38
3101-3601 Maple Ridge 3086 7 1196971 32.33
Kerrisdale 3671 9 1411035 32.03
3101-3601 Richmond Central 3660 3 1405436 32
601-701 Strathcona 1867 3 707884 31.6
1851-2101 Thompson 2633 3 992960 31.42
1001-101 Maple Ridge 1411 9 529955 31.3
401-501 Killarney 1570 5 583576 30.98
501-601 Mount Pleasant 1790 5 663103 30.87
1351-1601 Steveston 2336 4 862805 30.78
401-501 West End 1854 51 684596 30.77
1851-2101 Richmond Central 2828 12 1041157 30.69
601-701 Kensington-Cedar Cottage 1630 5 599805 30.66
901-1001 University Hill (UBC) 2327 3 855646 30.65
701-801 Kerrisdale 2122 6 779848 30.63
501-601 Maple Ridge 1017 3 373264 30.6
601-701 Oakridge 1872 5 675605 30.08
401-501 Kensington-Cedar Cottage 1549 4 556662 29.95
501-601 Eastburn 1482 5 532464 29.94
501-601 West End 1950 32 699858 29.92
1101-1351 Brentwood 2250 6 806081 29.85
601-701 Richmond Central 1547 15 552989 29.78
901-1001 Oakridge 2333 6 833809 29.78
2351-2601 Steveston 3283 3 1171805 29.74
901-1001 Grandview-Woodland 1980 3 706248 29.72
2351-2601 Maple Ridge 2853 11 1016358 29.69
601-701 Grandview-Woodland 1708 3 605424 29.53
701-801 Riley Park 2283 3 808423 29.5
1601-1851 Richmond Central 2745 4 970273 29.46
1351-1601 Brentwood 2625 4 926449 29.41
601-701 Richmond North 1705 11 598332 29.25
401-501 Yaletown 2184 16 766073 29.23
501-601 Fairview 1622 3 567945 29.19
601-701 Metrotown 1798 38 629443 29.18
701-801 Metrotown 1979 15 689254 29.02
601-701 Mount Pleasant 1990 8 692797 29.01
901-1001 Maple Ridge 1426 11 496296 29
1101-1351 Maple Ridge 1634 16 567719 28.95
1351-1601 Metrotown 2550 4 882483 28.84
1001-101 Richmond Central 2025 8 700340 28.82
601-701 University Hill (UBC) 2169 5 747245 28.71
1351-1601 Richmond Central 2536 12 869706 28.58
501-601 Strathcona 1992 7 682779 28.56
501-601 Brentwood 1720 5 587963 28.49
2601-2851 Maple Ridge 2925 4 997809 28.43
601-701 Sunset 1578 5 538020 28.41
1601-1851 Steveston 2762 4 940660 28.38
401-501 Downtown 2086 34 707491 28.27
801-901 Richmond Central 1922 22 648551 28.12
501-601 Metrotown 1819 33 613750 28.12
1001-101 Kerrisdale 2600 3 876695 28.1
701-801 Killarney 2149 4 723725 28.07
701-801 Kitsilano 2109 15 710071 28.05
1101-1351 Richmond North 2481 13 833643 28
601-701 Garden Village 1660 3 555168 27.87
701-801 Maple Ridge 1232 10 411696 27.86
501-601 Yaletown 2351 54 785809 27.85
601-701 Coal Harbour 2092 6 697992 27.81
1851-2101 Port Coquitlam 2659 9 886909 27.8
1101-1351 Kerrisdale 2841 8 947614 27.79
1351-1601 Port Coquitlam 2109 10 703131 27.78
701-801 Richmond Central 1872 9 623807 27.77
401-501 Burquitlam 1127 3 374332 27.69
501-601 Richmond North 1710 23 568024 27.68
2101-2351 Port Coquitlam 2803 3 930996 27.68
901-1001 Richmond Central 2077 10 688803 27.64
501-601 Kitsilano 1985 22 657484 27.6
801-901 Maple Ridge 1305 10 432229 27.6
1851-2101 Steveston 3025 4 999894 27.55
501-601 Oakridge 1982 5 653149 27.46
901-1001 Port Coquitlam 1666 13 548862 27.46
1851-2101 Middlegate 3033 3 999119 27.45
2351-2601 Hastings-Sunrise 3645 4 1200044 27.44
1101-1351 Richmond Central 2389 15 786493 27.43
401-501 Kitsilano 1937 11 637470 27.42
1601-1851 Riley Park 3179 5 1046048 27.42
801-901 University Hill (UBC) 2556 8 840680 27.41
601-701 Kitsilano 2101 31 691199 27.41
1101-1351 Killarney 2662 4 871841 27.29
1601-1851 Maple Ridge 2259 11 739705 27.29
501-601 Killarney 1770 6 579215 27.27
501-601 Lougheed 1362 4 445693 27.26
701-801 Kelvin 1591 3 519548 27.21
701-801 Kensington-Cedar Cottage 1981 8 646728 27.2
1101-1351 Steveston 2300 4 749464 27.15
1351-1601 Oakridge 2983 3 969202 27.07
601-701 New Westminster Downtown 1530 6 496679 27.04
801-901 Oakridge 2380 3 771258 27
601-701 Lougheed 1432 5 463385 26.97
601-701 South Slope 1854 5 597182 26.84
601-701 West End 2253 33 725370 26.83
601-701 Hastings-Sunrise 1921 9 617675 26.8
701-801 Richmond North 2109 20 676703 26.74
901-1001 Killarney 2300 3 737122 26.71
1001-101 Sunset 2117 3 677859 26.69
501-601 Kensington-Cedar Cottage 1768 8 565713 26.67
1101-1351 Oakridge 2810 5 898524 26.65
601-701 Yaletown 2569 29 821416 26.64
1101-1351 Metrotown 2702 19 860859 26.55
Seafair 3433 3 1090356 26.46
901-1001 Richmond North 2301 17 729757 26.43
701-801 West End 2476 9 784523 26.41
3101-3601 Seafair 4047 6 1281154 26.38
501-601 Downtown 2305 66 726527 26.27
1101-1351 Eastburn 2583 3 814372 26.27
601-701 Downtown 2403 59 757047 26.25
601-701 Queens Park 1695 3 533806 26.24
401-501 Strathcona 2100 3 660764 26.22
701-801 Brentwood 2180 4 684382 26.16
801-901 Victoria-Fraserview 2150 3 674422 26.14
901-1001 Metrotown 2428 23 759040 26.05
1001-101 Richmond North 2514 11 784426 26.01
601-701 Sapperton 1550 3 483564 26
801-901 Sapperton 1878 7 584136 25.92
801-901 Port Coquitlam 1639 18 509499 25.91
701-801 Port Coquitlam 1507 11 467932 25.87
2101-2351 Kerrisdale 3800 3 1179516 25.87
801-901 Richmond North 2251 27 697817 25.83
801-901 Brentwood 2330 14 719356 25.72
501-601 Richmond Central 1712 4 526152 25.6
901-1001 Strathcona 2648 3 810595 25.51
1101-1351 Buckingham Heights 2763 3 845404 25.49
3101-3601 Kerrisdale 4983 3 1521624 25.45
1101-1351 Sunset 2417 3 737826 25.44
1101-1351 Kensington-Cedar Cottage 2650 4 808707 25.43
2101-2351 Maple Ridge 2939 9 896309 25.42
801-901 Metrotown 2406 49 732719 25.37
601-701 Port Coquitlam 1348 9 409783 25.34
1001-101 Univercity 2188 4 665075 25.34
501-601 New Westminster Downtown 1573 3 477339 25.28
1601-1851 Marpole 3458 3 1047485 25.24
601-701 Maple Ridge 1265 18 382683 25.2
701-801 New Westminster Downtown 1790 3 541183 25.19
1101-1351 Port Coquitlam 2158 10 651744 25.17
1351-1601 Kelvin 2553 4 766176 25.01
801-901 Sullivan Heights 1790 3 535746 24.94
801-901 Kitsilano 2640 32 782623 24.71
501-601 Queens Park 1608 8 475763 24.66
1001-101 University Hill (UBC) 3033 6 889510 24.44
901-1001 Brentwood 2534 5 736953 24.24
1351-1601 Richmond North 2971 7 863749 24.23
801-901 Lougheed 1979 15 575111 24.22
501-601 Coal Harbour 2345 11 681396 24.21
801-901 Yaletown 3158 23 912099 24.06
701-801 Lougheed 1692 6 487273 24
701-801 Renfrew-Collingwood 2160 5 621322 23.97
701-801 Yaletown 2964 28 852293 23.96
1351-1601 Maple Ridge 2375 15 682672 23.96
601-701 Riley Park 2615 4 751389 23.94
901-1001 Mount Pleasant 2879 5 822202 23.8
701-801 Coal Harbour 2596 8 740997 23.79
701-801 Mount Pleasant 2673 6 761576 23.74
501-601 Port Coquitlam 1350 7 383638 23.68
801-901 Downtown 2980 23 842718 23.56
1001-101 Port Coquitlam 1938 8 547324 23.54
601-701 Burquitlam 1556 8 437971 23.45
3601-4101 Richmond Central 5533 3 1551987 23.37
3601-4101 Kerrisdale 6100 6 1697787 23.19
1001-101 Mount Pleasant 2932 3 815394 23.18
901-1001 Kitsilano 2909 23 809008 23.17
901-1001 Point Grey 2825 4 784292 23.14
901-1001 Lougheed 2151 7 595094 23.06
1101-1351 Strathcona 3283 3 908437 23.06
701-801 Burquitlam 1833 3 507039 23.05
801-901 Burquitlam 1936 8 535202 23.03
501-601 Sapperton 1650 3 455903 23.03
901-1001 Univercity 2367 3 650201 22.89
2101-2351 Point Grey 4358 3 1192045 22.79
901-1001 Downtown 3223 15 876897 22.67
701-801 Downtown 2985 31 809861 22.61
1101-1351 Willingdon Heights 3612 4 976527 22.53
601-701 Point Grey 2532 3 682785 22.47
1101-1351 Mount Pleasant 3331 8 896448 22.43
1101-1351 Point Grey 3282 8 877709 22.29
801-901 Mount Pleasant 2892 5 765541 22.06
1851-2101 Maple Ridge 3264 7 860232 21.96
701-801 Grandview-Woodland 2598 3 684501 21.95
1101-1351 Burquitlam 2430 5 638330 21.89
901-1001 Yaletown 3522 10 925285 21.89
801-901 West End 3182 9 834822 21.87
1101-1351 Riley Park 3547 3 929451 21.84
2601-2851 Kitsilano 5148 6 1339072 21.67
801-901 Univercity 2434 5 626850 21.46
1101-1351 West End 3629 5 929906 21.35
1351-1601 Kensington-Cedar Cottage 3390 5 852458 20.96
701-801 Downtown Eastside 2982 3 744648 20.81
1101-1351 Downtown 3778 20 931873 20.56
1101-1351 Yaletown 4146 37 1017807 20.46
1001-101 Downtown 3799 12 921307 20.21
901-1001 Coal Harbour 3394 9 822228 20.19
501-601 Sunset 1950 3 457875 19.57
1351-1601 Yaletown 4581 8 1065058 19.37
1001-101 Yaletown 4136 14 959101 19.32
2351-2601 Capitol Hill 5400 3 1225504 18.91
901-1001 West End 3846 8 858100 18.59
801-901 Coal Harbour 3610 11 805393 18.59
1351-1601 Kitsilano 4349 10 969478 18.58
1851-2101 Kitsilano 4980 5 1088365 18.21
1001-101 Kitsilano 3700 4 804437 18.12
1351-1601 Mount Pleasant 4500 3 973748 18.03
1601-1851 West End 4917 3 1063037 18.02
1601-1851 Kitsilano 4890 6 1045658 17.82
1001-101 Coal Harbour 4035 10 852856 17.61
1101-1351 Coal Harbour 4293 14 904290 17.55
1601-1851 Coal Harbour 5036 5 1036375 17.15
1351-1601 West End 4667 3 956151 17.07
1101-1351 Kitsilano 4494 12 902705 16.74
1601-1851 Yaletown 5798 6 1146764 16.48
1351-1601 Downtown 5508 5 989863 14.98
1351-1601 Coal Harbour 5439 5 939260 14.39
2351-2601 Yaletown 8500 3 1295071 12.7
1851-2101 Coal Harbour 7492 3 1079181 12
3601-4101 Kitsilano 12759 5 1628909 10.64
2351-2601 Kitsilano 11882 6 1263720 8.863
901-1001 Sunset 6183 3 619285 8.346

When we look at the highest price to rent ratios, then we can see that a lot of apartments are located in neighborhoods in Burnaby.

On the other hand, the lowest price to rent ratios appear in the Kitsilano neighborhood with various square feet. In addition to Kitsilano, some Downtown neighborhoods such as Yaletown, Coal Harbour, and West End also have very low price to rent ratios. Again, we see low price to rent ratios for apartments with high square feet.

Overall, when looking at the three tables, we can conclude that the best investment properties can be found in neighborhoods in Downtown Vancouver. These neighborhoods have the lowest price to rent ratios. Consequently, these ones are the most promising ones for a positive cashflow.

The last two tables where we predicted housing prices and rent prices can be taken with a grain of salt. This is because the covariates square feet, bedrooms, and neighborhoods only explain around 50% of the variation in rent prices and only 42% of the variation in housing prices.

The most reliable table is the first one where we calculated price to rent ratios by matching the actual housing and rent prices for certain neighborhoods and suare feet.

Google Maps of Housing Prices in the Greater Vancouver Area

x <- read.csv(here::here("data", "lat_long_housing.csv"))
x$neighborhood <- housing$neighborhood

library(ggmap)
register_google(key = "xxxxxxxxxxxxxxxxx")


real_estate_map <- ggmap(get_googlemap(
  center = c(lon = -123.037, lat = 49.24),
  zoom = 11,
  scale = 1, size = c(640, 640),
  maptype = "terrain",
  color = "color"
)) +
  scale_y_continuous(limits = c(49.125, 49.325)) +
  ylab("Latitude") +
  xlab("Longitude")

# jpeg('google_maps.jpg')
real_estate_map +
  geom_point(aes(x = longitude, y = latitude, colour = neighborhood), data = x, size = 1, alpha = 0.35) +
  theme(legend.position = "none")

# dev.off()

Limitations of the Study and Improvements

Limitations

  • We do not know how biased our home prices and rent prices are. We combined prices of multiple apartments by looking at their street addresses. Afterwards, we assigned these apartments to a specific neighborhood. This was done to lower the variance but at the same time has increased bias. Therefore, there may be some neighborhoods that only include expensive homes from a certain popular street or cheap apartments from streets less popular.

  • As already mentioned, we calculated the price to rent ratios by matching the average price of homes, for certain neighborhoods and square feet, with the average price of rents, for certain neighborhoods and square feet, for more than 3 apartments. This can be improved by also collecting age for rent apartments and then matching on these 3 variables, square feet, neighborhood, and age.

  • We also wanted to match apartments for rent and apartment prices by the number of bedrooms. However, because the data was sparse, we decided to only match on neighborhood and square feet.

  • Another limitation of our analysis is extrapolation.Extrarpolation happenes when we predicted home prices for the craigslist data set. Some predicted home prices are exceeding one million dollars. However, remember that we only collected apartment prices below one million dollars. Therefore, our regression equation does not know how to handle apartment prices that exceed one million dollars. If you are not clear about the concept, then hear is a great explanation with a great picture which explains the consept perfectly.

Improvements

  • A way to decrease the bias would be to collect more data. The data cleaning process for the craigslist data was very time intensive because the posts are not well structured. Everyone can upload apartments and it is up to the person who posts how well structured the uploads are. Therefore, the street names are missing or only mentioned in the description sometimes. Consequently, getting information from craigslist might be very time consuming. It is better to find a commercial website who posts rent prices so we can get data from well structured uploads.

  • Another improvement would be to cross-validate our results. This means that for the multiple linear regressions we do not know how large our error is. A way to solve this problem would be to scrape a validation set from craigslist or other websites and then predict rents and housing prices on this data. Afterwards, one can compare the predicted results to the actual results on the website and then determine how large the error is. This would also show us if the tables with the price to rent ratios where we predicted home and rent prices are reliable.

All analysis was done in R and can be found on my github.

I hope you have enjoyed this little project about the Vancouver housing market. Let me know in the comments below of any improvments of the analysis or if you have any suggestions. Maybe you can come up with your own analysis of real estate in your area.

If you are interested in diving deeper into the code then you can check out my github where I provided all the code for this analysis.

Additional Resources

  • If you want to create a similar analysis for your own area where you are living, then check out my blog posts about building a web scraper. Scraping Indeed job postings and scraping real estate data. These blog posts will help you to develop your own scraper for any website.

  • Also check out my github document where you can find all the analysis and code you need for your own project.

  • Here is an article about price to rent ratios in Vancouver compared to San Francisco.

  • Here is another news article which talks about renting vs. buying in the Vancouver housing market. Note that all the graphs were done with ggplot :) . They could have been a little bit nicer with a theme and a centered heading for example.