Daniel J. Lewis, Karel Mertens, James H. Stock, and Mihir Trivedi, "Measuring Real Activity Using a Weekly Economic Index", Journal of Applied Econometrics, Vol. 37, No. 4, 2022, pp. 667-687. All files are contained in the zip file lmst.zip. Most files are .csv or .m files, which are ASCII files in DOS format. However, there are also some .xlsx files. Linux/Unix users should be careful. ---------------------------------- DETAILS ON PUBLICLY AVAILABLE DATA ---------------------------------- -- Data on initial unemployment insurance claims (not seasonally adjusted) were downloaded from Haver Analytics (LICN@WEEKLY). Data can be publicly downloaded and updated from https://fred.stlouisfed.org/series/ICNSA. The source of the data is the Bureau of Labor Statistics. Datafile: Data/Data_WEI_Alt_Spec.csv, Header: LICN -- Data on continuing unemployment insurance claims (not seasonally adjusted) were downloaded from Haver Analytics (LIUN@WEEKLY). Data can be publicly downloaded and updated from https://fred.stlouisfed.org/series/CCNSA. The source of the data is the Bureau of Labor Statistics. Datafile: Data/Data_WEI_Alt_Spec.csv, Header: LIUN -- Data on fuel sales (not seasonally adjusted) were downloaded from Haver Analytics (sum of UGFUP@WEEKLY, UKJUP@WEEKLY, and UDIUP@WEEKLY). Data can be publicly downloaded and updated from https://www.eia.gov/dnav/pet/PET_CONS_WPSUP_K_W.htm . Fuel sales are constructed by summing Finished Motor Gasoline, Kerosene-Type Jet Fuel, and Distillate Fuel Oil. Datafile: Data/Data_WEI_Alt_Spec.csv, Header: FUEL -- Daily data on unadjusted federal tax withholdings were downloaded from Haver Analytics (TDW@Daily). Data can be publicly downloaded and updated from https://fiscaldata.treasury.gov/datasets/daily-treasury-statement/federal-tax-deposits, using Data Table: 'Federal Tax Deposits' and using the values from 'Withheld Income and Employment Taxes' Datafile: Data/daily_withholding_unadjusted.csv -- Data on the Aruba-Diebold-Scotti Business Conditions Index was downloaded from https://www.philadelphiafed.org/surveys-and-data/real-time-data-research/ads. The vintage used is from January 30th 20201. We provide a copy as a CSV and the original file as an excel sheet (.xlsx). Datafile: Data/ADS_Index_Most_Current_Vintage.csv -- Data on the Chicago Fed National Activity Index (CFNAI) was downloaded from FRED. Data can be publicly downloaded and updated from https://fred.stlouisfed.org/series/CFNAI. The source of the data is the Federal Reserve Bank of Chicago. Datafile: Data/CFNAI.csv -- Data on Industrial Production was downloaded from FRED. Data can be publicly downloaded and updated from https://fred.stlouisfed.org/series/INDPRO. The source of the data is Board of Governors of the Federal Reserve System. Datafile: Data/IP.csv -- Vintage data on GDP come from ALFRED, and can be publicly downloaded and updated from https://alfred.stlouisfed.org/series?seid=GDPC1. The source of the data is the Bureau of Economic Analysis. Datafile: Data/gdp_vintage_data_full.csv -- Alternatively formatted data on vintage data for GDP come from the Federal Reserve Bank of Philadelphia. Data can be publicly downloaded and updated from https://www.philadelphiafed.org/surveys-and-data/real-time-data-research/routput, and by clicking the hyperlink Vintages 1965:Q4 to present. The source of the data is the Bureau of Economic Analysis. Datafile: Data/GDP_level_RT.csv -- Data on the the New York Fed Staff Nowcast come from the Federal Reserve Bank of New York. Data can be updated from https://www.newyorkfed.org/research/policy/nowcast, selecting the 'Nowcast' tab, selecting 'Downloads' and then selecting 'Staff Nowcast Data 2002-Present'. Data is provided in the original format as an excel workbook and reformatted as a csv Datafile: Data/New-York-Fed_Staff-Nowcast_data_2002-present_ForecastByQuarter.csv -- Data on GDPNow come from the Federal Reserve Bank of Atlanta. Data can be publicly downloaded and updated from https://www.atlantafed.org/-/media/documents/cqer/researchcq/gdpnow/GDPTrackingModelDataAndForecasts.xlsx. We provide the original excel file and used sheets as CSV files Datafiles: Data/GDPTrackingModelDataAndForecasts_TrackingArchives.csv Data/GDPTrackingModelDataAndForecasts_TrackingHistory.csv -- Data on the published revision history of the Weekly Economic Index come from values published on https://www.newyorkfed.org/research/policy/weekly-economic-index#/interactive and Jim Stock's Blog (https://www.jimstock.org/) Datafile: Data/wei_published_revision.csv -------------------------------------- DETAILS ON NOT PUBLICLY AVAILABLE DATA -------------------------------------- - -Data on the history of adjusted federal tax withholdings (from 2008-November 2020) were obtained from Booth Financial Consulting and are not available for redistribution. The most recent data for this series can be found in the figure titled "Recent Days: Withholding Growth" on https://taxtracking.com. -- Data on raw steel production were downloaded from Haver Analytics (PSTL@WEEKLY) and are not available for redistribution. Data are provided to Haver Analytics by American Iron and Steel Institute: https://www.steel.org/industry-data/. A blank column for the data is provided in Data/Data_WEI_Alt_Spec.csv under the header PSTL. -- Data on retail sales were downloaded from Haver Analytics (JRRSX@SURVEYW) and are not available for redistribution. Data are provided to Haver Analytics by Redbook Research: http://www.redbookresearch.com/ . A blank column for the data is provided in Data/Data_WEI_Alt_Spec.csv under the header JRRSX. -- Data on electricity output were downloaded from Haver Analytics (PELOUS@EEI) and are not available for redistribution. Data are provided to Haver Analytics by Edison Electric Institute: https://www.eei.org/ . A blank column for the data is provided in Data/Data_WEI_Alt_Spec.csv under the header PELOUS. -- Data on railroad traffic were downloaded from Haver Analytics (RSTOTL@RAILSHAR) and are not available for redistribution. Data are provided to Haver Analytics by the American Association of Railroads: https://www.aar.org/data-center/rail-traffic-data/ . A blank column for the data is provided in Data/Data_WEI_Alt_Spec.csv under the header RSTOTL. -- Data on consumer confidence were obtained from Rasmussen Reports and are not available for redistribution. Given a subscription to Rasmussen Reports, data can be downloaded from: https://www.rasmussenreports.com/econ/econ_page . -- Data on the full history of the American Staffing Association Index were downloaded from Haver Analytics (ASASI@SURVEYW) and are not available for redistribution. Data are provided to Haver Analytics by the American Staffing Association: https://americanstaffing.net/staffing-research-data/asa-data-dashboard/. A blank column for the data is provided in Data/Data_WEI_Alt_Spec.csv under the header ASASI. -- Data on the MBA: Volume Index: Mortgage Loan Applications for Purchase were downloaded from Haver Analytics (MBAMPN@SURVEYW) and are not available for redistribution. Data are provided to Haver Analytics by the Mortgage Bankers Association. https://www.mba.org/news-research-and-resources/research-and-economics/single-family-research/weekly-applications-survey. A blank column for the data is provided in Data/Data_WEI_Alt_Spec.csv under the header MBAMPN. -- Consensus Real GDP Forecasts from Bluechip Economic Indicators and Financial Forecasts were downloaded from Haver Analytics (BLUECHIP and BLUECFIN databases) and are not available for redistribution. Data are provided to Haver Analytics by Wolters Kluwer. -- Data on the Bloomberg Consumer Comfort Index (COMFCOMF Index) were downloaded using Bloomberg terminal and are not available for redistribution. --------------------------------- DETAILS ON WEI INPUT VINTAGE DATA --------------------------------- Figure 7 and the rows of Table 6 corresponding to quarters in 2020 utilize historical vintages of the input series used in the baseline WEI specification. This data can be found in the folder WEI_Input_Vintage_Data, with files named Data_yyyy_mmdd.csv . Each file is formatted similarly to Data_WEI_Alt_Spec.csv. Vintages are provided for every Thursday from 3/12/2020 to 1/21/2021. Vintage data were tracked in real time by the authors from the sources listed above and follow the same redistribution restrictions. Therefore, only vintage data for initial claims, continuing claims, and fuel sales are provided. Blank columns with the same headers as in Data/Data_WEI_Alt_Spec.csv are provided for the not publicly available data. --------------------- SOFTWARE REQUIREMENTS --------------------- -- Matlab (code was run with Matlab Release 2020a) -- Statistics and Machine Learning Toolbox (code was run with version 11.5) -- Econometrics Toolbox (code was run with version 5.2) -- Stata (code was run with StataSE 16.1) ------------------- DESCRIPTION OF CODE ------------------- Given retrieval of non-publicly available data, the main files necessary to replicate the results of the paper are found in the Scripts folder. Code should be ran in the following order: 1. add_new_series.m 2. compute_WEI_dfm.do 3. wei_alt_spec.m 4-8. The files wei_alt_indicator.m, wei_nowcast_2010-2019.m, wei_nowcast_2020.m, wei_regression.m, and wei_revisions.m can be ran in any order after the files in steps 1-3 have been ran at least once. The following is a description of each script with details on the outputs: -- add_new_series.m: Converts the daily series (adjusted tax withholding, unadjusted tax withholding, and Rasmussen Consumer Confidence Index) to weekly series. Writes these series as well as additional weekly series (Bloomberg Consumer Comfort Index) and the sum of initial and continuing unemployment insurance claims to Data/Data_WEI_Alt_spec.csv. The script loads data from Data/daily_withholding_adjusted.csv, Data/bloomberg_consumer_comfort.csv, and Data/rasmussen_econ_data.csv (all not publicly available and not provided). The script also loads in Data/daily_withholding_unadjusted.csv. -- compute_WEI_dfm.do: Uses the series in baseline WEI in the baseline WEI specification to estimate a DFM with 1 factor with one autoregressive lag and no dynamics in the observation equation. The do file writes the model parameters to Data/Outdata/dfm_model_results.csv and the filtered factor (unscaled/unnormalized) to Data/Outdata/wei_dfm.csv. Both files are used as inputs for the script wei_alt_spec.m. -- wei_alt_spec.m: Generates information necessary for Tables 2 and 7, and generates figures 1, 2, 4, 5, and 8. The script generates alternative specifications of the WEI. As inputs the code uses the following files: -- Data/Data_WEI_Alt_Spec.csv: A file containing time series of the input series used in each specification -- Data/series_info.csv: A file mapping the headers of the columns of Data_WEI_Alt_Spec.csv to series names and transformations. The script outputs the following csv files: -- Data/Outdata/wei_alt_spec_series.csv: A file containing the full time series of each alternative specification. -- Data/Outdata/wei_alt_spec_weights.csv: A file containing the recovered weights from each specification of the WEI. -- Data/Outdata/wei_alt_spec_corr.csv: A file containing the correlation matrix between each specification of the WEI. -- Data/Outdata/wei_alt_spec_explvar.csv: A file containing the explained variance from each specification of the WEI. -- wei_alt_indicator.m: Constructs figures 3 and 6 from the paper. The code relies on the output file Data/Outdata/wei_alt_spec_series.csv generated from wei_alt_spec.m. The figures plot the WEI against Aruba-Diebold-Scotti Business Conditions Index, the Chicago Fed National Activity Index, and the Industrial Production Index. -- wei_revisions.m: Constructs the output necessary for Table 3 in the paper. The code outputs the following csv files: - Data/Outdata/wei_revision_rmse_hist.csv: A file contianing the RMSEs for panel a of Table 3 - Data/Outdata/wei_revision_corr_hist.csv: A file contianing the correlations for panel a of Table 3 - Data/Outdata/wei_revision_rmse_publish.csv: A file contianing the RMSEs for panel b of Table 3 - Data/Outdata/wei_revision_corr_publish.csv: A file contianing the correlations for panel b of Table 3 -- wei_regression.m: Runs the regressions necessary for Tables 4 and 5. The code relies on the output file Data/Outdata/wei_alt_spec_series.csv generated from wei_alt_spec.m. The script stores the results of the GDP regression results (Table 4) in the object QRegressStruct, and stores the results of the Industrial Production regression results (Table 5) in MRegressStruct. -- wei_nowcast_2010-2019.m: Generates nowcasts necessary for rows for quarters from 2018-2019 in Table 6 and RMSEs reported in the last row (computed using quarters in 2010-2019). The code outputs the following csv files: -- Data/Outdata/wei_nowcast_2010-2019_yoy.csv: A file containing the information needed for panel a of Table 6 for 2018-2019. -- Data/Outdata/wei_nowcast_2010-2019_qoq.csv: A file containing the information needed for panel b of Table 6 for 2019-2019. -- Data/Outdata/wei_nowcast_2010-2019_rmse_yoy.csv: A file containing the information for the RMSEs in panel a of Table 6. -- Data/Outdata/wei_nowcast_2010-2019_rmse_qoq.csv: A file containing the information for the RMSEs in panel b of Table 6. -- wei_nowcast_2020.m: Generates nowcasts necessary for 2020 portion of Table 6 and subfigures for Figure 7. The code relies on vintage data stored in Data/WEI_Input_Vintage_Data. The code also loads in Bluechip consensus forecasts of GDP from Data/bluechip.csv (not publicly available and not provided).The code outputs the following csv files: -- Data/Outdata/wei_nowcast_2020_yoy.csv: A file containing the information needed for panel a of Table 6 for quarters in 2020 -- Data/Outdata/wei_nowcast_2020_qoq.csv: A file containing the information needed for panel b of Table 6 for quarters in 2020 The code also uses the following functions located in the Functions folder: -- Functions/tightfig.m: Eliminates excess space around a given Matlab figure -- Functions/transformData.m: Transforms an input vector (T x 1) using one of the following transformations (52-week log changes, no transformation, 52-week percent change, 1-week percent change) ---------------- LICENSE FOR CODE ---------------- Copyright Federal Reserve Bank of New York and Federal Reserve Bank of Dallas. You may reproduce, use, modify, make derivative works of, and distribute this code in whole or in part so long as you keep this notice in the documentation associated with any distributed works. Neither the names of the Federal Reserve Bank of New York and the Federal Reserve Bank of Dallas nor the names of any of the authors may be used to endorse or promote works derived from this code without prior written permission. Portions of the code attributed to third parties are subject to applicable third party licenses and rights. By your use of this code you accept this license and any applicable third party license. THIS CODE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT ANY WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. THE FEDERAL RESERVE BANK OF NEW YORK AND THE FEDERAL RESERVE BANK OF DALLAS ARE NOT, UNDER ANY CIRCUMSTANCES, LIABLE TO YOU FOR DAMAGES OF ANY KIND ARISING OUT OF OR IN CONNECTION WITH USE OF OR INABILITY TO USE THE CODE, INCLUDING, BUT NOT LIMITED TO DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, SPECIAL OR EXEMPLARY DAMAGES, WHETHER BASED ON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT OR OTHER LEGAL OR EQUITABLE THEORY, EVEN IF THE FEDERAL RESERVE BANK OF NEW YORK OR THE FEDERAL RESERVE BANK OF DALLAS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR LOSS AND REGARDLESS OF WHETHER SUCH DAMAGES OR LOSS IS FORESEEABLE.