knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
  )
knitr::opts_chunk$set(fig.width=7, fig.height=3)

Introduction

This document is an analysis for residential auction results in NZ from 2018 to early in 2021. The data are scraped from interest.co.nz website. We are mainly interested in the change in the number of auction property sold with months for each year, how the auction price changed with years for each district in Auckland and several problems.

library(kiaora)
library(stringr)
library(lubridate)
library(ggridges)
library(dplyr)
library(ggplot2)
nzpropertygeo %>%
  filter(lon > 160) %>%
  ggplot(aes(lon, lat)) +
  geom_point(size = 0.5) +
  geom_density2d()

This is a map which describes the locations of the auction property sold. It is very obvious that most properties sold in Auckland region, followed by Canterbury and Bay of Plenty region.

dataset <- nzhousingprice %>%
  mutate(
    group = ifelse(region == "Auckland", region, "Others"),
    auction_yrmth = zoo::as.yearmon(auction_dates)
  )
dataset_month <- dataset %>%
  mutate(
    month = month(auction_dates, label = TRUE),
    year = as.factor(year(auction_dates))) %>%
  group_by(month, year) %>%
  summarise(counts = n())
ggplot(dataset_month, aes(month, counts, group = year, colour = year)) +
  geom_line(size = 1) +
  geom_point() +
  labs(x = "Month", colour = "Year") +
  theme(legend.position = "top") +
  scale_color_manual(values = c("#ffd080", "#ff6666", "#cc6600", "#660000"))

The line graph above illustrates the number of auction properties sold for New Zealand over months from 2018 to early in 2021.

It can be seen form the line graph that the sales trends for 2018 and 2019 are similar. Initially, the figure reached its lowest point in Jan. Then the figure experienced an upward trend over next two months. After that , the figure dropped slightly and kept relatively stable. Afterwards, the figure reached the peak around 600 in Oct and Nov respectively. Finally, we can see a decline over last month.

On the other hand, the sales for 2020 saw a different trend. It is particularly noticeable that there was a dramatic decline from Mar to Apr and reached the lowest point around 0 due to lockdown for Covid-19. The next seven months saw a sharp rise , with the number of auction property sold reaching around 1170 in Nov. At last,a slight decline occurred as well.

dataset_group <- dataset %>%
  mutate(month = month(auction_dates, label = TRUE),
         year = as.factor(year(auction_dates))) %>%
  group_by(month, year, group) %>%
  summarise(counts = n())
ggplot(dataset_group, aes(month, counts, group = year, colour = year)) +
  geom_line(size = 1) +
  geom_point() +
  labs(x = "Month", colour = "Year") +
  theme(legend.position = "top") +
  scale_color_manual(values = c("#ffd080", "#ff6666", "#cc6600", "#660000")) +
  facet_wrap(~ group, scales = "free_y", ncol = 1)

So from this graph it does look like that great change in the number of auction property sold for 2020 mainly occurred in Auckland region. The figure in Nov for 2020 in Auckland is about 500 more than that for 2019.

dataset_day <- dataset %>%
  mutate(
  year = year(auction_dates),
  day = wday(auction_dates, label = TRUE, week_start = 1)
) %>%
  group_by(day, group) %>%
  summarise(counts = n())
ggplot(dataset_day, aes(day, counts)) +
  geom_col(aes(fill = group), position = position_dodge(1))

The bar chart above shows that the number of auction property sold for Auckland region and other regions from Monday to Sunday between 2018 and early in 2021.

It is clear that for Auckland region the figure for Tuesday, Wednesday and Thursday was significantly higher than other days. Especially Thursday, on which most auction properties were sold. By contrast, the figure for Monday was only around 250.

Compared to Auckland region, apart from Wednesday and Thursday, the volume was low on the rest days for other regions.

We also can see from this bar chart that overall, the number of auction property sold for Auckland region was higher than that for other regions.

dataset_auckland <- dataset %>%
  mutate(year = year(auction_dates)) %>%
  filter(region == "Auckland")
ggplot(dataset_auckland, aes(auction_price, district, fill = district)) +
  geom_density_ridges() +
  theme_ridges() +
  xlim(c(0, 6e+06))

This density plot is a representation of distribution for auction price of each district in Auckland region.

There is a fluctuation for auction price in Waiheke Island due to small sales. We can see that most auction price for each district is under $2,000,000. And districts like Waitakere City, Papakura and Franklin are with narrow interval for auction price, which means that there is less variability of auction price for these districts. On the other hand, except large variance of auction price for Auckland City, auction price for quite a few properties is over $2,000,000.

group_by(dataset, bedrooms, bathrooms) %>%
  summarise(counts = n()) %>%
  ggplot(aes(factor(bedrooms), factor(bathrooms))) +
  geom_tile(aes(fill = counts), colour = "white") +
  geom_text(aes(label = counts), colour = "white") +
  scale_fill_viridis_c(breaks = seq(0, 4000, by = 500)) +
  labs(x = "Bedrooms", y = "Bathrooms")

From this graph, we con conclude that properties with 3 bedrooms and 1 bathroom are most popular. The number of this kind of property sold is 4023. Property with 4 bedrooms and 2 bathrooms ranks second with sales 3028. Property with 3 bedrooms, 2 bathrooms and property with 2 bedrooms and 1 bathroom come next in third and fourth position.



Tina-ye112/kiaora documentation built on Feb. 25, 2021, 2:03 p.m.