knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

library(tidyverse)
library(TFP)

Annual Business Survey data

1. Update the ABS data

  1. Get the latest ABS data from ONS. The latest release can be found here. The spreadsheet we need is the one for Sections A - S.
  2. The spreadsheet needs to be manually adjusted to impute suppressed values before proceeding.
  3. Then collate the latest data for a sector using ABS.
  4. Historic ABS data is included in the package dataset abs_historic.
  5. Add the latest data to abs_historic, removing any duplicate years.
# ABS workflow

# reshape the historic data
abs_hist <- abs_historic %>% 
               filter(sector == "food manufacturing") %>% 
               select(-c(sector, sic_desc)) %>% 
               gather(year, val, num_range("", 1900:2100)) %>% 
               spread(attribute, val) %>% 
               mutate(year = as.numeric(year))

head(abs_hist)

# read in the latest
manufacturing <- ABS(file = "~/TFP_code/data/abssectionsas.xls",
                     sheets = c("Section C"),
                     siccodes = c("10", "11")) %>% 
                select(year, capex, employment_costs, employment_pit, gva, purchases, turnover)

head(manufacturing)

# bind the latest data to the older data
manu_latest <- abs_hist %>% 
                   filter(year < min(manufacturing$year)) %>% 
                   bind_rows(manufacturing)

2. update the input weights

  1. We can produce the latest input weights using input_weights on the ABS data we produced in section 1.
iw <- input_weights(manu_latest, year, capex, purchases, employment_costs)

head(iw)

Input deflators

We need to calculate all the input deflators

ONS series used: D7CW D7BU D7CA CBZW YBGB JVF4 K37L MC35 K37L



lee269/TFP documentation built on May 14, 2019, 2:08 p.m.