Cost of living getting tougher

by Paul Murrell

The New Zealand Herald ran an article by Peter Lyons titled Cost of living getting tougher for Mr Median Kiwi. The article discusses the fact that the overall inflation rate (for the past seven years, 2008 to 2015) hides differences in price increases or decreases for different areas of expenditure. For example, overall inflation was 11 percent, but cost of housing increased 38 percent while communication costs dropped 18 percent.

This report explores CPI data in an attempt to reproduce the results in the original article and to explore the data in different ways (e.g., visually).

CPI data

Inflation is calculated from the Consumer Price Index (the Reserve Bank has an explanation), so we need CPI data. The article did not include any links to data, but Statistics New Zealand provides a number of CPI data sources:

The data from the CPI visualisation is the easiest to use, so we will work with that. A local copy of the CSV file for these data is provided here.

The first few rows of data are shown below. The 'Level' column shows that we have CPI data for "All groups" at once and for each separate "Group" (Food, Clothing and footwear, etc). The CPI values themselves are in the 'Index.number' column. The file contains data from 2006 Q2 to 2015 Q4.

Visualising differences in CPI changes

Inflation is just the percent change in CPI from one time period to another, so if we look at CPI over time, an increase represents inflation and a decrease represents deflation. The plot below uses the 'lattice' package in R to plot CPI over time for each separate "Group".

This clearly shows CPI increasing substantially for most groups, but staying remarkably constant for several other groups, and decreasing significantly for "Communication."

Resources

This web page was generated from a source document that underwent transformation to an XML format, then an Rhtml format (for use with the R package 'knitr'), then finally this HTML format. The transformation was managed using a Makefile, which also required an XSL file or two for some of the transformations.