RDP 2024-04: Nowcasting Quarterly GDP Growth during the COVID-19 Crisis Using a Monthly Activity Indicator Read me file

This ‘read me’ file contains information on the files used to generate the results presented in RDP 2024-04.

All our analysis was done using the statistical programming language R. To help users to more easily replicate our work we have included the RStudio project file ‘rdp-2024-04-supplementary-information.Rproj’. By loading this project file into the program RStudio, users can run the replication codes as follows. Open the ‘Run_MAI_NC_GDP_Replication.R’ file by clicking on it in the Files window (usually located in the lower right panel). Next, either click ‘Source’ in the Console window or type ‘CTRL + SHIFT + S’ in the Console window.

Please note, our codes are distributed as is, without warranty, and are solely for replicating our results. Any alternative use of our codes is not supported.

Publicly available data used in the figures appearing in the paper can be found in the spreadsheet ‘rdp-2024-04-graph-data.xlsx’. Note for Figure A6, some series have been removed due to third party provider restrictions.

If you make use of any of these files you should clearly attribute the authors in any derivative work.

Folder Structure

The zip file ‘rdp-2024-04-supplementary-information’ contains this readme file (‘rdp-2024-04-readme.pdf’), the spreadsheet ‘rdp-2024-04-graph-data.xlsx’, the RStudio project file ‘rdp-2024-04-supplementary-information.Rproj’ and the R script ‘Run_MAI_NC_GDP_Replication.R’ which runs the replication. This zip file also contains the following folders:

Code

This folder contains the R scripts to reproduce our analysis. R scripts are listed below in the order they should be executed in. This order is important because results from one script are used by other scripts.

  • Transform_MAI_Data.R – transforms the dataset to make each series stationary with zero mean and unit variance
  • Targeted_Predictor_MAI_Dataset.R – selects the variables that will be used to estimate the dynamic factor model (DFM)
  • Determine_TP_MAI_Estimation_Options.R – used to determine DFM estimation options
  • Estimate_and_Analyse_TP_MAI.R – estimates and analyses the MAI using a DFM
  • MAI_COVID_Robustness_Analysis.R – investigates whether the COVID-19 crisis had any effect on the estimation of the MAI
  • Modelling_GDP_MIDAS_TP.R – determines the appropriate MIDAS regression modelling options
  • Recursive_Nowcast_GDP_UMIDAS_TP.R – undertakes the pseudo forecasting/nowcasting exercise
  • Recursive_Nowcast_GDP_UMIDAS_TP_MSEF_BOOTSTRAP.R – undertakes the pseudo forecasting/nowcasting exercise and computes the MSE-F test statistic for the test of equal predictive accuracy across the various models considered
  • GDP_Dependence_Analysis.R – investigates serial correlation properties of quarterly growth in first-release real GDP
  • MIDAS_Polynomial_Weight_Functions.R – estimates the polynomial weights for three different functions

This folder also contains the subfolder:

methods

This folder contains all the R functions sourced by the R scripts in the folder above.

  • lm_hac_methods.R – functions for performing OLS and estimating the Wald test statistic
  • mai_utils.R – functions used specifically for estimating the MAI
  • misc_methods.R – miscellaneous functions used by other scripts
  • ndfm_methods.R – functions for estimating the number of dynamic factors in a panel of time series data
  • qmle_dfm_methods.R – functions for estimating DFMs similar to those used in the paper
  • var_methods.R – functions for estimating VARs, including information criterion

Data

This folder contains the primary inputs used by the R scripts in the ‘Codes’ folder. For descriptions of these data, their sources, and the transformations we apply to them, see Table A1 of the paper. As noted previously some series have been removed for licensing restrictions.

With the removal of these series the replication results based on ‘mai_panel.csv’ will not be the same as that of the RDP. To overcome this, we have included two additional files. Both files are used in subsequent analysis instead of the files created using the smaller dataset. This ensures the results are consistent with the results shown in the RDP.

  • mai_data_tfs.csv – transformed (tf) and standardised (s) MAI dataset
  • mai_info.csv – provides information on data transformation and categories
  • mai_panel.csv – raw (unadjusted) MAI dataset
  • mai_q_1_s_2_p_1_rdp.csv – estimate of MAI using uncensored dataset
  • mai_tp_list.csv – selected list of 30 variables used to extract the MAI
  • qtr_int.csv – quarterly indicator variables used to get the targeted predictor dataset
  • rt_dgdp_qtr.csv – quarterly growth in first-release real GDP
  • rt_mai_pre_covid.csv – estimate of ‘real-time’ MAI using uncensored dataset with sample ending in 2020:M2
  • rt_mai_q_1_s_2_p_1_rdp.csv – estimate of ‘real-time’ MAI using uncensored dataset

Results

This folder is empty and is where all the output from the replication will be saved.

Software

We used R version 4.3.2 (64-bit) to do our analysis on a PC running Windows 11 (64-bit). The program ‘RStudio’ is needed to open and use the ‘rdp-2024-04-supplementary-information.Rproj’ file. In our work we used version 2023.12.1. For more information, see <https://www.posit.co/>.

In our analysis we used some additional R packages not provided by the base installation. We recommend you install these packages (including any dependences) before trying to run the replication files. The packages include:

midasr (version 0.8), available at <https://cran.r-project.org/package=midasr>

10 July 2024

Back to abstract