<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/rents-in-melbourne-by-ellis2013nz/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://freerangestats.info/blog/2018/08/31/melbourne-rents"> free range statistics - R</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>Motivation</h2>
<p>So, I'm in the process of moving to Melbourne and have a personal interest in the rental market there. But I'm also more generally interested in the economics of housing. Purchase costs get most of the attention, but rental costs are generally recognised as <a rel="nofollow" href="https://theconversation.com/why-rents-not-property-prices-are-best-to-assess-housing-supply-and-need-driven-demand-100383" target="_blank">the better indication of the real &quot;priceâ€� of housing</a> in supply and demand terms. Variance from speculative booms and busts is smoothed out, but even more fundamentally, it is rent that reflects the cost of living in a home. Perhaps an analogy helps – when we are interested in the price of going to the movies we look at what it costs to receive the service of sitting in the cinema for two hours, not of purchasing the cinema.</p>
<p>My interest was also piqued by a tweet (perhaps in May or June 2018, that I can no longer locate) indicating that housing price growth in Sydney and Melbourne (but not Perth) is being led by lower-cost suburbs; I think the punch line was something like &quot;first home owners are the ones driving the housing boomâ€�. There are a lot of implicit assumptions in that conclusion but without being able to track down the tweet and the article it was referring to I can't address them here.</p>
<p>I did wonder though whether the trend was actually a regression to the mean of sorts. If there is an element of randomness in suburbs' house prices (as surely there is), some suburbs would be higher-priced than their fundamentals support at one point in time due to chance. We would expect their growth from that point in time to be less than average, precisely because the starting point is an artifical and unsustainable high. And vice versa for suburbs that happen to be lower than average at a particular point in time.</p>
<p>Anyway, I was interested in seeing if there was a pattern like this in rent prices in Melbourne. To cut to the chase, here's what I found:</p>
<p><img width="100%" src="http://freerangestats.io/img/0123-melbourne-growth-scatter.svg"></p>
<p>For flats/apartments in Melbourne and perhaps for smaller houses, the higher priced suburbs in 2000 have had weaker rental growth in the intervening period.</p>
<p>Notably, other than flats in Port Melbourne (which started out the period as the most expensive by far), <em>all</em> the suburbs' median rental rates have grown faster than inflation as measured by the consumer price index, <a rel="nofollow" href="https://www.rba.gov.au/calculator/annualDecimal.html" target="_blank">which has grown at around 2.6% over this time period</a>. Over this time period (which is long compared to the breathless up-and-down commentary we often get with housing markets), rents have generally grown pretty steadily, without some of the <a rel="nofollow" href="http://www.abc.net.au/news/2018-06-30/melbourne-falling-unit-prices/9918452" target="_blank">fluctuations seen in purchase prices</a>. This growth in the real price of rent isn't surprising, but it is also definitely less than the growth in the cost of purchasing houses and flats.</p>
<h2>Data from DHHS</h2>
<p>Luckily there is a great data source available, to a high degree of granularity, from the Victorian Department of Housing and Human Services who produce a report at least annually on key statistics on the private rental market in Victoria. The most recent report has re-usable data to the March 2018 quarter. The data are in an Excel workbook that covers all of Victoria. There is a separate worksheet for each housing type: &quot;1 bedroom flatâ€�, &quot;2 bedroom flatâ€�, &quot;3 bedroom flatâ€�, &quot;2 bedroom houseâ€�, &quot;3 bedroom houseâ€�,<br>
&quot;4 bedroom houseâ€� and &quot;All propertiesâ€�. Each actual value is either a median annual rent at the time of moving, or a count of how many dwellings had a change in tenant in the given quarter.</p>
<p>The data aren't &quot;tidyâ€�, because there are two columns for each year, rather than a longer thin format with a single column for year, one for variable type (median rent or count) and one for value. Also, there is a bug – column Z in each sheet has the heading &quot;Dec 2003â€� when it clearly should be &quot;Dec 2002â€�. However, it's pretty straightforward to read in all the data, fix the bug and tidy it up (including by adding a &quot;Year Ending Marchâ€� column which I'll be using as the latest data is finishes in March 2018 and I want to use a full year's worth for growth comparisons down the track):</p>
<figure>
<pre><code data-lang="r"><span>library</span><span>(</span><span>openxlsx</span><span>)</span><span>
</span><span>library</span><span>(</span><span>tidyverse</span><span>)</span><span>
</span><span>library</span><span>(</span><span>foreach</span><span>)</span><span>
</span><span>library</span><span>(</span><span>ggpmisc</span><span>)</span><span> </span><span># for selecting objects to label based on 2d density
</span><span>library</span><span>(</span><span>ggrepel</span><span>)</span><span>
</span><span>library</span><span>(</span><span>scales</span><span>)</span><span>
</span><span>library</span><span>(</span><span>viridis</span><span>)</span><span>
</span><span>library</span><span>(</span><span>MASS</span><span>)</span><span>
</span><span># Caution - this URL: &quot;https://dhhs.vic.gov.au/moving-annual-rents-suburb&quot; - # looks like a permanent location but it's not, it's for a particular year # (not the latest).
</span><span>
</span><span># Instead, see https://dhhs.vic.gov.au/publications/rental-report
</span><span>url</span><span> </span><span>&lt;-</span><span> </span><span>&quot;https://www.dhhs.vic.gov.au/sites/default/files/documents/201805/Moving%20Annual%20rents%20by%20suburb%20-%20March%20quarter%202018.xlsx&quot;</span><span>
</span><span>download.file</span><span>(</span><span>url</span><span>,</span><span> </span><span>destfile</span><span> </span><span>=</span><span> </span><span>&quot;melb-rents.xlsx&quot;</span><span>,</span><span> </span><span>mode</span><span> </span><span>=</span><span> </span><span>&quot;wb&quot;</span><span>)</span><span>
</span><span># what are all the worksheet names in that workbook?
</span><span>sns</span><span> </span><span>&lt;-</span><span> </span><span>getSheetNames</span><span>(</span><span>&quot;melb-rents.xlsx&quot;</span><span>)</span><span>
</span><span>sns</span><span> </span><span>&lt;-</span><span> </span><span>sns</span><span>[</span><span>!</span><span>sns</span><span> </span><span>%in%</span><span> </span><span>&quot;Suburb groupings&quot;</span><span>]</span><span>
</span><span># read the data in one worksheet at a time and combine with rbind():
</span><span>rents</span><span> </span><span>&lt;-</span><span> </span><span>foreach</span><span>(</span><span>i</span><span> </span><span>=</span><span> </span><span>1</span><span>:</span><span>length</span><span>(</span><span>sns</span><span>),</span><span> </span><span>.combine</span><span> </span><span>=</span><span> </span><span>rbind</span><span>)</span><span> </span><span>%do%</span><span> </span><span>{</span><span>
</span><span>sheet_name</span><span> </span><span>&lt;-</span><span> </span><span>sns</span><span>[</span><span>i</span><span>]</span><span>
</span><span>rawdata</span><span> </span><span>&lt;-</span><span> </span><span>read.xlsx</span><span>(</span><span>&quot;melb-rents.xlsx&quot;</span><span>,</span><span> </span><span>sheet</span><span> </span><span>=</span><span> </span><span>sheet_name</span><span>)</span><span>
</span><span># Correct an annoying bug where column Z, which should be Dec 2002, is actually Dec 2003:
</span><span> </span><span>the_dates</span><span> </span><span>&lt;-</span><span> </span><span>as.character</span><span>(</span><span>unique</span><span>(</span><span>rawdata</span><span>[</span><span>1</span><span>,</span><span> </span><span>]))</span><span>
</span><span>the_dates</span><span> </span><span>&lt;-</span><span> </span><span>the_dates</span><span>[</span><span>!</span><span>is.na</span><span>(</span><span>the_dates</span><span>)]</span><span>
</span><span>sep02</span><span> </span><span>&lt;-</span><span> </span><span>which</span><span>(</span><span>the_dates</span><span> </span><span>==</span><span> </span><span>&quot;Sep 2002&quot;</span><span>)</span><span>
</span><span>the_dates</span><span>[</span><span>sep02</span><span> </span><span>+</span><span> </span><span>1</span><span>]</span><span> </span><span>&lt;-</span><span> </span><span>&quot;Dec 2002&quot;</span><span>
</span><span># read in data:
</span><span> </span><span>data</span><span> </span><span>&lt;-</span><span> </span><span>rawdata</span><span>[</span><span> </span><span>,</span><span> </span><span>-3</span><span>]</span><span>
</span><span>data</span><span>[</span><span>1</span><span>,</span><span> </span><span>]</span><span> </span><span>&lt;-</span><span> </span><span>c</span><span>(</span><span>&quot;&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>rep</span><span>(</span><span>the_dates</span><span>,</span><span> </span><span>each</span><span> </span><span>=</span><span> </span><span>2</span><span>))</span><span>
</span><span>names</span><span>(</span><span>data</span><span>)</span><span> </span><span>&lt;-</span><span> </span><span>paste</span><span>(</span><span>data</span><span>[</span><span>1</span><span>,</span><span> </span><span>],</span><span> </span><span>data</span><span>[</span><span>2</span><span>,</span><span> </span><span>])</span><span>
</span><span>names</span><span>(</span><span>data</span><span>)[</span><span>1</span><span>:</span><span>2</span><span>]</span><span> </span><span>&lt;-</span><span> </span><span>c</span><span>(</span><span>&quot;district&quot;</span><span>,</span><span> </span><span>&quot;area&quot;</span><span>)</span><span>
</span><span>data</span><span> </span><span>&lt;-</span><span> </span><span>data</span><span> </span><span>[</span><span>-</span><span>(</span><span>1</span><span>:</span><span>2</span><span>),</span><span> </span><span>]</span><span>
</span><span># tidy up:
</span><span> </span><span>data</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>variable</span><span>,</span><span> </span><span>value</span><span>,</span><span> </span><span>-</span><span>district</span><span>,</span><span> </span><span>-</span><span>area</span><span>)</span><span> </span><span>%>%</span><span> </span><span>as_tibble</span><span> </span><span>%>%</span><span>
</span><span>separate</span><span>(</span><span>variable</span><span>,</span><span> </span><span>c</span><span>(</span><span>&quot;mon&quot;</span><span>,</span><span> </span><span>&quot;yr&quot;</span><span>,</span><span> </span><span>&quot;variable&quot;</span><span>),</span><span> </span><span>sep</span><span> </span><span>=</span><span> </span><span>&quot;\\s&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>
</span><span>yr</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>yr</span><span>),</span><span>
</span><span>value</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>gsub</span><span>(</span><span>&quot;$&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>value</span><span>,</span><span> </span><span>fixed</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)),</span><span>
</span><span>property</span><span> </span><span>=</span><span> </span><span>sheet_name</span><span>,</span><span>
</span><span>mon_num</span><span> </span><span>=</span><span> </span><span>case_when</span><span>(</span><span>
</span><span>mon</span><span> </span><span>==</span><span> </span><span>&quot;Mar&quot;</span><span> </span><span>~</span><span> </span><span>3</span><span>,</span><span>
</span><span>mon</span><span> </span><span>==</span><span> </span><span>&quot;Jun&quot;</span><span> </span><span>~</span><span> </span><span>6</span><span>,</span><span>
</span><span>mon</span><span> </span><span>==</span><span> </span><span>&quot;Sep&quot;</span><span> </span><span>~</span><span> </span><span>9</span><span>,</span><span>
</span><span>mon</span><span> </span><span>==</span><span> </span><span>&quot;Dec&quot;</span><span> </span><span>~</span><span> </span><span>12</span><span>),</span><span>
</span><span>yr_mon</span><span> </span><span>=</span><span> </span><span>yr</span><span> </span><span>+</span><span> </span><span>(</span><span>mon_num</span><span> </span><span>-</span><span> </span><span>1.5</span><span>)</span><span> </span><span>/</span><span> </span><span>12</span><span>,</span><span>
</span><span>ye_mar</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>mon</span><span> </span><span>==</span><span> </span><span>&quot;Mar&quot;</span><span>,</span><span> </span><span>yr</span><span>,</span><span> </span><span>yr</span><span> </span><span>+</span><span> </span><span>1</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>fill</span><span>(</span><span>district</span><span>)</span><span>
</span><span>}</span></code></pre>
</figure>
<p>The lowest number of counts for any suburb – quarter – dwelling combination is 10:</p>
<div>
<pre><code>> rents %>% filter(variable == &quot;Count&quot;) %>% summarise(min(value, na.rm = TRUE))
# A tibble: 1 x 1
  `min(value, na.rm = TRUE)`
                       </code></pre></div>