ECON2209 Research Assignment Part 2
Coding Hints
1 Description
A program that performs the Diewert-Fox Value Added Decomposition on the 12 Industry Market Sector, and produces plots for the decomposition of industry multifactor productivity growth for Australia.
The code sets up the data and applies the dfvad package by Shipei Zeng (shipei.zeng@unsw.edu.au). https://cran.r-project.org/web/packages/dfvad/index.html
Reference: Diewert, W.E. and K.J. Fox (2018), “Decomposing Value Added Growth into Explanatory Factors,” in E. Grifell-Tatje, C.A.K. Lovell and R. Sickles (eds.), The Oxford Handbook of Productivity Analysis, Oxford University Press: New York, NY, Chapter 19, 625-662.
2 Data
12 Industry Market Sector:
- A Agriculture, Forestry and Fishing
- B Mining
- C Manufacturing
- D Electricity, Gas, Water and Waste Services
- E Construction
- F Wholesale Trade
- G Retail Trade
- H Accommodation and Food Services
- I Transport, Postal and Warehousing
- J Information, Media and Telecommunications
- K Financial and Insurance Services
- R Arts and Recreation Services
- 12 Aggregate Twelve Industry Market Sector
ABS Data Used in this Code
- 5260.0.55.002 Estimates of Industry Multifactor Productivity, Australia
- 5204.0 Australian System of National Accounts
The required data are automatically downloaded by this code, as long as you’re connected to the internet, so there is no need to manually download Excel spreadsheets from the ABS website.
3 Outputs by Part
This code has three parts, as follows:
Part 1: Data constructed for use with the DFVAD package, each industry’s data on a separate worksheet, labelled with the industry’s official letter code. The data are put in a file labelled DFVAD_data12.xlsx
Part 2: DFVAD_growth12.xlsx: Growth rate results DFVAD_levels12.xlsx: Level results
Part 3: DFVAD_plots12.xls: MFP decomposition figures, each industry’s data on a separate worksheet, labelled with the industry’s official letter code
4 Part 2B: Mining
ind_codes <- c("A","B","C","D","E","F","G","H","I","J","K","R","12")
lev_B <- openxlsx::read.xlsx("DFVAD_levels12.xlsx",
sheet = "B", colNames = TRUE)
dfvad_B <- data.frame(
year = lev_B$period,
TFP_DF = lev_B$TFP
)
row_B <- which(ind_codes == "B")
abs_B <- data.frame(
year = year,
TFP_ABS = as.numeric(MFPdata[row_B, ])
)
B <- merge(dfvad_B, abs_B, by = "year")
B <- B[order(B$year), ]
B$TFP_DF_idx <- B$TFP_DF / B$TFP_DF[1] * 100
B$TFP_ABS_idx <- B$TFP_ABS / B$TFP_ABS[1] * 100
# 4. PLot
plot(B$year, B$TFP_DF_idx,
type = "l", col = "black", lwd = 2,
xlab = "Year",
ylab = "MFP index (first common year = 100)",
main = "Mining (B): DFVAD MFP vs ABS MFP")
lines(B$year, B$TFP_ABS_idx,
lwd = 2, lty = 2)
legend("topleft",
legend = c("DFVAD MFP", "ABS official MFP"),
lty = c(1, 2), lwd = 2, bty = "n")