With the advent of the COVID-19 crisis, many Americans are left uninsured, jobless, and anxious for the future. On top of that, the onslaught of articles, circulating over people facing mounting medical bills after contracting the virus has worried many Americans. Never has there been a time in American history where Universal Healthcare seem so alluring. As for America’s neighbor up north, “because they (Canada) have universal health care, it’s easier for people to access testing, and treatment, confinement, etc, than it is in the States.” The appeal of moving to Canada after this pandemic is understandable. But a looming concern for anyone wanting to move to Canada is the rent. Vancouver, a city infamous for being one of the most expensive cities in terms of rent can scare Americans away from wanting to settle there, but is that really the case? As you, Mr. and Mrs. Thompson, are eager to live in Vancouver, I will present you with an analysis on the real-estate market in Vancouver.
Let’s start off with doing some simple stats. Below you’ll see some questions most commonly raised amongst new renters moving to Vancouver.
A=matrix(c("Median home price","Mean home price","Standard deviation of home price",
"Median number of bedrooms","Median number of full bathrooms",
"Median square footage",dollar(median(vanhousing$price)),dollar(mean(vanhousing$price)),
dollar(sd(vanhousing$price)), median(vanhousing$Beds),median(vanhousing$FullBath),comma(median(vanhousing$area_sqft))), nrow=6, ncol=2)
as.data.frame(A)
When plotting the number of homes in Vancouver, we can see that the histogram is right skewed. Most of the home prices are ranged between around $250,000 - $1,000,000. Let’s take a closer look at where the distribution is centered at.
vanhousing %>%
ggplot(aes(x=price)) +
geom_histogram(color="black", fill="#85bb65", bins=30) + # Vancouver Flag Green
ggtitle("Home Prices in Vancounver") +
scale_x_continuous(name="Home Prices", labels = dollar,
breaks=c(500000,1000000,2000000,3000000,4000000)) +
scale_y_continuous(name="Houses", labels = scales::comma) + #NTS: labels: scales::comma allow me to view the numbers in commas
ggthemes::theme_clean() +
theme(plot.title= element_text(hjust=0.5))
As you can see, majority of the homes are within the $250K-$750K price range, skewed mostly towards $375K - $500K. Seems pretty reasonable? If you’re coming from Oahu, these prices are comparably more affordable!
vanhousing %>%
ggplot(aes(x=price)) +
geom_histogram(color="black", fill="#85bb65", bins=30) +
ggtitle("Home Prices in Vancounver Below $1,000,000") +
scale_x_continuous(limits= c(0,1000000), labels = dollar,
breaks=c(0,250000,375000,500000,625000,750000,875000,1000000)) +
scale_y_continuous(name="Homes", labels = scales::comma) + #NTS: labels: scales::comma allow me to view the numbers in commas +
ggthemes::theme_clean() +
theme(plot.title= element_text(hjust=0.5))
## Warning: Removed 25936 rows containing non-finite values (stat_bin).
## Warning: Removed 2 rows containing missing values (geom_bar).
After seeing those price ranges, you’re probably wondering “How many bedrooms do these houses have? Are they big enough so that I comfortably house my future children?” This distribution answers that question.
vanhousing %>%
filter(price %in%(375000:750000)) %>%
select(Beds) %>%
ggplot(aes(x=Beds)) +
geom_histogram(color="black", fill="#85bb65", bins=8) +
scale_x_continuous(breaks= c(0,1,2,3,4,5,6,7,8)) +
ggtitle("Bedrooms priced within $250,000 - $750,000") +
scale_y_continuous(name="Homes", labels = scales::comma) +
ggthemes::theme_clean() +
theme(plot.title= element_text(hjust=0.5))
Let’s now look at the average yearly prices in Vancouver. From 2005 to 2015, we see that it jumped from $616,611 to $1,203,573. Notably, we can see that Vancouver experienced its steepest increase of $146,755 from 2014 to 2015. Below you’d also find a line chart that illustrates this data.
vanhousing %>%
group_by(year_of_sale) %>%
summarise("Average Yearly Price" = dollar((mean(price)))) %>%
rename("Year of Sale" = year_of_sale) %>%
kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"), position = "left")
## `summarise()` ungrouping output (override with `.groups` argument)
| Year of Sale | Average Yearly Price |
|---|---|
| 2005 | $616,611 |
| 2006 | $726,812 |
| 2007 | $835,484 |
| 2008 | $820,825 |
| 2009 | $823,922 |
| 2010 | $936,094 |
| 2011 | $1,068,574 |
| 2012 | $1,004,024 |
| 2013 | $1,020,959 |
| 2014 | $1,056,819 |
| 2015 | $1,203,574 |
vanhousing %>%
group_by(year_of_sale) %>%
summarise("avg_yr_price" = mean(price)) %>%
ggplot(aes(x=year_of_sale,y=avg_yr_price)) +
geom_line(color = "#1F5886") + #Vancouver Flag Blue
geom_point(color = "#1F5886") +
xlab("Year") +
scale_x_continuous(breaks=c(2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015)) + #Allows me to look at the x axis as whole integers
scale_y_continuous(name="Average Yearly Prices", labels = dollar) +
labs(title="Average Yearly Prices from 2005 to 2015",
family="Helvetica") +
ggthemes::theme_clean() +
theme( plot.title= element_text(hjust=0.5))
## `summarise()` ungrouping output (override with `.groups` argument)
You’ve previously mentioned that you plan on having a big family and were wondering about houses that had the most bedrooms and the most square footage and see how they fair. Below I’ve filtered it out and it turns out it’s a 13 bedroom house located in East Vancouver. There’s also a hyperlink that will lead you to the Google Maps of the 13 bedroom house. It’s also worth noting that that the house is valued at $781,900 at 3,704 square feet, and was on sale in 2009.
dt_url <- c("https://www.google.com/maps?client=safari&rls=en&q=2177+30TH+AVE+E+VANCOUVER&oe=UTF-8&um=1&ie=UTF-8&sa=X&ved=2ahUKEwipw9O06OnoAhWCs54KHR8sCS8Q_AUoAnoECA0QBA")
vanhousing %>%
arrange(desc(Beds)) %>%
slice(1:1) %>%
mutate(Address = cell_spec(addressshort, "html", link= dt_url)) %>%
dplyr::select(Address,Beds,area_sqft,price, west, year_of_sale) %>% #bc realistically, you want to know the price
kable("html", escape= FALSE, title = "House with the Most Bedrooms") %>%
kable_styling(full_width = F, bootstrap_options = c("hover","condensed"))
| Address | Beds | area_sqft | price | west | year_of_sale |
|---|---|---|---|---|---|
| 2177 30TH AVE E VANCOUVER | 13 | 3704 | 781900 | 0 | 2009 |
Below we can also view the house with the most square footage and how it looks like on Google Maps. It’s also worth noting that than the house is valued at $4,132,920 at 11,950 square feet, has 5 bedrooms, and was on sale in 2011.
dt_url1 <- c("https://www.google.com/maps/place/4766+W+4th+Ave,+Vancouver,+BC+V6T+1C2,+Canada/@49.2685606,-123.2201462,17z/data=!3m1!4b1!4m5!3m4!1s0x548672e956b27d83:0x4808e8eca536882c!8m2!3d49.2685571!4d-123.2179575")
vanhousing %>%
arrange(desc(area_sqft)) %>%
slice(1:1) %>%
mutate(Address = cell_spec(addressshort, "html", link = dt_url1)) %>%
dplyr::select(Address,Beds,area_sqft,price, west, year_of_sale) %>%
kable("html", escape = FALSE,title = "House with the Most Square Footage") %>%
kable_styling(full_width = F, bootstrap_options = c("hover","condensed"))
| Address | Beds | area_sqft | price | west | year_of_sale |
|---|---|---|---|---|---|
| 4766 4TH AVE W VANCOUVER | 5 | 11950 | 4132920 | 1 | 2011 |
One thing new renters should be congnizant about when moving to Vancouver are the subtle differences between West and East Side. Before continuing, it should be noted that the downtown core of Vancouver is in West End (right next to Stanley Park). This article also gives a bit of background on the type of neigborhoods in Vancouver. In general, when compiling the data for the absolute median real estate price of the houses in West vs. East Vancouver, it seems that West Vancouver is slightly more expensive (seen below).
vanhousing %>%
group_by(west) %>%
summarise(medprice = dollar(median(price))) %>%
kable() %>%
kable_styling(full_width = F, bootstrap_options = c("striped", "hover", "condensed"), position = "left")
## `summarise()` ungrouping output (override with `.groups` argument)
| west | medprice |
|---|---|
| 0 | $633,604 |
| 1 | $688,820 |
But when we analyze it on a yearly basis we see that the Median prices differ between East & West Vancouver over the years. As illustrated in the line chart, we see that from 2005-2011, West Vancouver’s Real Estate market was pricier compared to East Vancouver (when comparing their median home prices). But after 2011, East Vancouver soon became significantly more expensive, as by 2015, East Vancouver’s median home prices were around $150,000 more expensive than its counterpart. The article’s claim that there is a growing demand of Vancouver’s residents of moving to the East side can be seen through the quick rise in house prices over last 4 years the data was compiled. As the article mentioned, those fleeing to the East side are vying for community that the West side residents seem to have lost in their homes. Something to considering when moving in to Vancouver is not only the differing cost of rent in the neighbourhoods, but the type of environment the neighbourhood has to offer.
westvan <- vanhousing %>%
group_by(west, year_of_sale) %>%
filter(west=='1') %>%
summarise(west_vancouver = dollar(median(price))) %>%
ungroup() %>%
select(-west)
## `summarise()` regrouping output by 'west' (override with `.groups` argument)
eastvan<- vanhousing %>%
group_by(west, year_of_sale) %>%
filter(west=='0') %>%
summarise(east_vancouver = dollar(median(price))) %>%
ungroup() %>%
select(-west)
## `summarise()` regrouping output by 'west' (override with `.groups` argument)
vannie <- left_join(westvan,eastvan, by="year_of_sale")
kable(vannie, caption = "Median Prices by Neighbourhood") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"), position = "left")
| year_of_sale | west_vancouver | east_vancouver |
|---|---|---|
| 2005 | $522,287 | $496,138 |
| 2006 | $596,080 | $571,158 |
| 2007 | $696,928 | $651,868 |
| 2008 | $670,260 | $610,216 |
| 2009 | $679,136 | $601,225 |
| 2010 | $755,985 | $666,292 |
| 2011 | $814,363 | $743,259 |
| 2012 | $744,421 | $755,560 |
| 2013 | $719,423 | $746,452 |
| 2014 | $725,282 | $838,654 |
| 2015 | $801,192 | $963,539 |
# redoing it because I need to tidy my data, plus by putting it into dollar values, it would show up with ugly axes
westvan1 <- vanhousing %>%
group_by(west, year_of_sale) %>%
filter(west=='1') %>%
summarise(west_vancouver = median(price)) %>%
ungroup() %>%
select(-west)
## `summarise()` regrouping output by 'west' (override with `.groups` argument)
eastvan1 <- vanhousing %>%
group_by(west, year_of_sale) %>%
filter(west=='0') %>%
summarise(east_vancouver = median(price)) %>%
ungroup() %>%
select(-west)
## `summarise()` regrouping output by 'west' (override with `.groups` argument)
merged_van = merge(westvan1, eastvan1, by="year_of_sale")
merged_van1<- reshape2::melt(merged_van, id.var='year_of_sale')
ggplot(merged_van1, aes(x = year_of_sale, y = value, color = variable)) +
geom_line() +
geom_point() +
scale_color_manual(name = "Neigborhood",values = c("#85bb65", "#1F5886"), labels = c('West Vancouver', "East Vancouver")) +
scale_x_continuous(name = "Year",breaks=c(2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015)) +
scale_y_continuous(name = "Price", labels=dollar) +
labs(title="Median Real Estate Value",
family="Helvetica") +
ggthemes::theme_clean() +
theme(plot.title= element_text(hjust=0.5))
#isn't that beautiful :D
Let’s now observe the median price of the Houses according the number of bedrooms. Recall that the house with the most bedrooms in Vancouver had 13 bedrooms which costs $781,900. Also, as you can see, house prices start to hit the million dollar range when there are 4 bedrooms. Something to keep in mind if you plan on housing a large family.
vanhousing %>%
group_by(Beds) %>%
summarise("Median Home Price" = dollar(median(price))) %>%
rename("Number of Bedrooms" = Beds) %>%
kable(caption="Median Prices by Bedroom Size") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"), position = "left")
| Number of Bedrooms | Median Home Price |
|---|---|
| 0 | $303,884 |
| 1 | $385,714 |
| 2 | $609,328 |
| 3 | $910,422 |
| 4 | $1,114,766 |
| 5 | $1,056,380 |
| 6 | $1,080,939 |
| 7 | $1,134,884 |
| 8 | $1,031,932 |
| 9 | $1,092,421 |
| 10 | $973,199 |
| 11 | $1,364,566 |
| 12 | $880,895 |
| 13 | $781,900 |
Below you’ll see 2 maps that depicts the neighbourhood fair in terms of the Median Home Price. It’s a great visual of the “affluent” neighbourhoods in Vancouver. A map to keep in mind when deciding a house in Vancouver.
vanhousingtracts <- vanhousing %>%
group_by(tract) %>%
summarise(medprice = median(price))
## `summarise()` ungrouping output (override with `.groups` argument)
combo <- left_join(vantracts,vanhousingtracts,by="tract")
plot(x= combo["medprice"], main="Vancouver Median House Prices", key.pos=1)
tm_shape(combo,) + tm_polygons(col = "medprice", style = "pretty", title="Price Range") #default setting is pretty
Let’s now take a look at how the change in either bedrooms, bathrooms, and location affect the change in price. To determine this, we’ll run a regression on each variable. Let’s first run a regression on bedrooms and price. As you can see, with an additional bedroom, it will cost on average an additional $215,637. It’s also statistically significant as the p-value (in laymen’s term, “given that the null hypthesis is true, there is a very low likelihood that the outcome was due to chance”) is less than 1%. Although the \(R^2\) is 0.25, meaning that it explains variation from to an additional bedroom 25% of the time.
bed.lm <- lm(price ~ Beds,vanhousing)
tab_model(bed.lm)
| price | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 312736.89 | 305049.93 – 320423.85 | <0.001 |
| Beds | 215637.74 | 213271.77 – 218003.70 | <0.001 |
| Observations | 95982 | ||
| R2 / R2 adjusted | 0.250 / 0.250 | ||
# Houses start off at $312,746
# With an additional bedroom, it will cost an additional $215,637 for the house value
# R^2 is 0.25, so explains variation from price to a bedroom 25% of the time
Let’s now run a regression on price and bath. As we can see below, with an additional bathroom the price of the house on average goes up by $379,920. It’s also statistically significant with an \(R^2\) of 0.22 meaning that it explains the variation from price to bath 22% of the time.
bath.lm = lm(price~FullBath,vanhousing)
tab_model(bath.lm)
| price | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 361629.84 | 353969.25 – 369290.43 | <0.001 |
| FullBath | 310628.34 | 306957.95 – 314298.73 | <0.001 |
| Observations | 95982 | ||
| R2 / R2 adjusted | 0.223 / 0.223 | ||
# Houses start off at $361,629
# With an additional bathroom, it'll add $310,628 to the house value
# R^2 is 0.22, explains variation from price to the bath 22% of the time
Let’s then see how it all fairs out. It starts off with having a negative intercept of -$239,995.50 but if the binary variable, west, is 1 (meaning that if a house is located on the west side), then the value of the house on average increases by $594,856.60. For every additional bedroom, the value of the house on average increases by $203,986,40, and for every additional full bathroom, the value of the house on average increases by $594,856.80. Also, each variable is statistically significant.
# Now let's run the actual regression
bathbed.lm = lm(price ~ Beds + FullBath + west, vanhousing)
tab_model(bathbed.lm)
| price | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | -239995.50 | -249579.91 – -230411.09 | <0.001 |
| Beds | 203986.42 | 200898.96 – 207073.89 | <0.001 |
| FullBath | 114413.41 | 109839.05 – 118987.78 | <0.001 |
| west | 594856.77 | 586927.17 – 602786.38 | <0.001 |
| Observations | 95982 | ||
| R2 / R2 adjusted | 0.410 / 0.410 | ||
# So it starts off with having a negative amount of -239,995.50
# By living on the west side, the value of the house increases by $594,856.60
# For every bedroom, the value of the house increases by $203,986.40
# For every full bathroom, the value of the house increases by $594,856.80
Last but not least, I recall hearing that your ideal home has at least 6 bedrooms, with at least 4 full bathrooms, located on the West Side of Vancouver, and that cost less than $500,000. So below is a table of all of the properties (though one is listed twice) that match your dream home! I added a Google Maps hyperlink to each address and a map of where all the properties are located. Hopefully one of these homes fit to your needs.
rec_url <- c("https://www.google.com/maps/place/141+E+41st+Ave,+Vancouver,+BC+V5W+1N6,+Canada/@49.2333626,-123.1050183,17z/data=!3m1!4b1!4m5!3m4!1s0x54867472be3d24b5:0xef25a56462cac16!8m2!3d49.2333591!4d-123.1028296","https://www.google.com/maps/place/163+E+41st+Ave,+Vancouver,+BC+V5W+1N6,+Canada/@49.2333401,-123.1046752,17z/data=!3m1!4b1!4m5!3m4!1s0x54867472bc20eb93:0x997dae74d1f2ed06!8m2!3d49.2333366!4d-123.1024865","https://www.google.com/maps/place/7055+Main+St,+Vancouver,+BC+V5X+3H8,+Canada/@49.2205736,-123.1042198,17z/data=!3m1!4b1!4m5!3m4!1s0x54867442a453fb7b:0x55b46e4cb6a979a0!8m2!3d49.2205701!4d-123.102031","https://www.google.com/maps/place/7494+Main+St,+Vancouver,+BC+V5X+3J8,+Canada/@49.2168845,-123.1038182,17z/data=!3m1!4b1!4m5!3m4!1s0x5486745c9521cebd:0x4eaddc1684e4cd5b!8m2!3d49.216881!4d-123.1016295","https://www.google.com/maps/place/7494+Main+St,+Vancouver,+BC+V5X+3J8,+Canada/@49.2168845,-123.1038182,17z/data=!3m1!4b1!4m5!3m4!1s0x5486745c9521cebd:0x4eaddc1684e4cd5b!8m2!3d49.216881!4d-123.1016295","https://www.google.com/maps/place/136+E+59th+Ave,+Vancouver,+BC+V5X+3B9,+Canada/@49.2165726,-123.1056315,17z/data=!3m1!4b1!4m5!3m4!1s0x5486745c5f7a6b8b:0xb755b10cadb4ef21!8m2!3d49.2165691!4d-123.1034427")
recommendation <- vanhousing %>%
filter(Beds>=6, FullBath>=4, west==1, price<=500000) %>%
mutate(price = dollar(price), Address = cell_spec(addressshort, "html", link= rec_url)) %>%
rename("Bathroom"=FullBath, "Bedroom"= Beds) %>%
dplyr::select(Address, price,Bedroom,Bathroom, area_sqft, year_of_sale)
kable(recommendation, "html", escape= FALSE, title="Recommended Houses") %>%
kable_styling(bootstrap_options = c("hover","condensed","striped"))
| Address | price | Bedroom | Bathroom | area_sqft | year_of_sale |
|---|---|---|---|---|---|
| 141 41ST AVE E VANCOUVER | $444,922 | 7 | 6 | 3521 | 2005 |
| 163 41ST AVE E VANCOUVER | $480,964 | 6 | 5 | 2583 | 2005 |
| 7055 MAIN ST VANCOUVER | $445,984 | 6 | 4 | 1500 | 2006 |
| 7494 MAIN ST VANCOUVER | $487,178 | 6 | 4 | 2018 | 2005 |
| 7494 MAIN ST VANCOUVER | $495,811 | 6 | 4 | 2018 | 2006 |
| 136 59TH AVE E VANCOUVER | $499,606 | 7 | 4 | 2679 | 2005 |
recommendation1 <- vanhousing %>%
filter(Beds>=6, FullBath>=4, west==1, price<=500000) %>%
arrange(desc(price)) %>%
mutate(price = dollar(price))
ggplot() +
geom_sf(data=vantracts, bg="#8ab88a") +
theme_void() +
geom_point(data = recommendation1,
mapping= aes(x = lon, y = lat),
pch=16, size =3,
color="#e23d4b") +
labs(title="Recommendations",
family="Helvetica") +
theme(panel.background = element_rect(fill="azure2"),
plot.title = element_text(hjust=0.5))