The Missing Inflation Puzzle
Sebastian Heise, Fatih Karahan, and Aysegul Şahin
Last Updated: August 24th, 2021

This document describes how the results in the paper can be replicated. We proceed in three steps. The first section describes how we construct and clean the data. We then describe the files generating the figures. Finally, we explain the files generating the tables. 

##################################################
1. DATA CONSTRUCTION
##################################################
There are a variety of data sources that must be cleaned and then merged together. We now delineate what each do-file does and any additional steps (if needed) to download or update the data that is read into each of these do-files. All files are called by the 00_master.do file.


%%%%%%%%%%%%%%%%%
prep_01_data_ppi
%%%%%%%%%%%%%%%%%
This file loads the price series from the BLS (both current and discontinued series with their labels and descriptions) and cleans the dataset. 

Input files: The Stata datasets used are created from raw text files that are downloaded from the BLS:
1. Labels:
a. ppi_data_industry_labels.dta: Downloaded from https://download.bls.gov/pub/time.series/pc/pc.product

b. ppi_data_industry_sic_disc_labels.dta: Downloaded from https://download.bls.gov/pub/time.series/pd/pd.product

c. ppi_data_industry_naics_disc_labels.dta: Downloaded from https://download.bls.gov/pub/time.series/nd/nd.product

2. Prices:
a. ppi_data_industry_current.dta: Downloaded from https://download.bls.gov/pub/time.series/pc/pc.data.XXX, where XXX is an industry group, using all files

b. ppi_data_industry_current.dta: Downloaded from https://download.bls.gov/pub/time.series/nd/nd.data.XXX, where XXX is an industry group, using all files

c. ppi_data_industry_sic_disc.dta: Downloaded from https://download.bls.gov/pub/time.series/pd/pd.data.XXX, where XXX is an industry group, using all files

3. Concordances:
sic_to_naics.dta: Downloaded from https://www.bls.gov/ppi/additional-resources/sic-publication-structure-and-comparable-naics-indexes-in-the-ppi.htm

Output file: ppi_noadj1.dta


%%%%%%%%%%%%%%%%%%%
prep_02_weights
%%%%%%%%%%%%%%%%%%
This file prepares sales weights (“total value of shipments”) from the Economic Census for all NAICS industries in 2002. These weights are needed to generate time-consistent 5-digit industries.

Input files: 
ECN_2002_US_XXXX_with_ann.csv files:  Downloaded from the 2002 Economic Census (https://www.census.gov/programs-surveys/economic-census/data/tables.2002.html). The CMF_2002 is for manufacturing from here (https://www.census.gov/data/tables/2002/econ/census/manufacturing-reports.html).

Output file: naics2002weights.dta. This is an important file to aggregate any 6-digit NAICS codes into 5-digit NAICS codes.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_03_wage_aggregation_5digit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file loads the QCEW wage data from the BLS and maps each 5-digit NAICS  code to a time-consistent analogue. In some cases, 6-digit codes provide better coverage than 5-digit. In this case, we aggregate the codes to the 5-digit level using sales weights from the Census Bureau.

Input files: 
1. Wages
a. qcew_wages_qtr.dta: This Stata dataset is created from raw csv files that are downloaded from the BLS: https://www.bls.gov/cew/downloadable-data-files.htm, using CSVs by industry and U.S. total private wages. We provide sample code to facilitate in the generation of this dataset in qcew_wages_by_industry.do.
2. Concordances
a. wage_price_code_map_5digit.xlsx: This file contains for 5-digit NAICS codes in the PPI a mapping to 5-digit NAICS codes in the QCEW. We generate this mapping manually based on the NAICS concordances available from the Census Bureau at https://www.census.gov/eos/www/naics/concordances/concordances.html. In some cases, a longer price or wage series is available at the 6-digit level. In this case, we aggregate the 6-digit codes to the 5-digit level using sales weights.
b. naics2002weights.dta: 2002 sales weights file which is generated in prep_02_naics_mappings.do

Output file: “wages_aggregated_naics5.dta”. This file contains the wage series from the QCEW at the time-consistent 5-digit NAICS industry level.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_04_qcew_naics5_sa
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file prepares the seasonal adjustment of the wage data from the QCEW, runs the seasonal adjustment, and then saves the file. We seasonally adjust the NSA data using the Census' X-12-ARIMA Seasonal Adjustment program in SAS, which requires the auxiliary file sa_quarterly_qcew_naics5.sas. Therefore, this do-file will not output in one run. 

Input files: “wages_aggregated_naics5.dta”, which was generated by prep_03_wage_aggregation_5digit.do.

Output file: “wages_aggregated_naics5_sa.dta”, which contains the seasonally adjusted wages.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_05_data_concentration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file cleans raw concentration data downloaded from the Economic Census. 

Input files:
a. Economic Census concentration files: Downloaded from
https://www.census.gov/programs-surveys/economic-census/data/tables.2002.html for the 2002 data
https://www.census.gov/programs-surveys/economic-census/data/tables.2007.html for the 2007 data
https://www.census.gov/programs-surveys/economic-census/data/tables.2012.html for the 2012 data
 We use a bash script to download the 2017 data (EC1700SIZECONCEN.dat), and the reference code can be found in pull_2017conc_data.sh.
Manufacturing concentration in 1997 is downloaded from https://www.census.gov/prod/ec97/m31s-cr.pdf.
b. NETS concentration files: hhi_emp_allind.dta and hhi_sales_allind.dta are generated using the National Establishment Time-Series (NETS) database. The concentration measures are generated using the NETS*.do codes.

Output file: concentration.dta. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_06_data_ workers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code prepares the worker demographic data to be used as controls within the regression. We prepare the data at the 3-digit and the 4-digit level. The latter is the highest available disaggregation.

Input files:
a. state_qwi_naics*_age.csv: Downloaded from https://ledextract.ces.census.gov/static/data.html
b.  state_qwi_naics*_edu.csv: Downloaded from https://ledextract.ces.census.gov/static/data.html
c.  state_qwi_naics*_gender.csv: Downloaded from https://ledextract.ces.census.gov/static/data.html
At the time we downloaded these files, the national level datasets were not available, so our code collapses these counts up from the state level.
b. industry_labels.do is a file where the variables are relabeled for ease of use.
 
Output file: Various cuts of worker demographic shares. (gender/educ/age_3/4_digit.dta)


%%%%%%%%%%%%%%%%%%
prep_07_data_ tfp
%%%%%%%%%%%%%%%%%%%
This file prepares the TFP dataset for manufacturing industries. 

Input files: 
a. industry_tfp.dta: This file is downloaded from https://download.bls.gov/pub/time.series/ip/ , using file ip.data.1.AllData. This file is combined with the labels from file ip.series.txt.

Output file: industry_tfp2.dta


%%%%%%%%%%%%%%%%%%%%%%
prep_08_data_ lp_mfp
%%%%%%%%%%%%%%%%%%%%%%
This file prepares the multifactor productivity (MFP) dataset for non-manufacturing industries, which are more aggregated and based on KLEMS.

Input files: 
a. klemscombinedbymeasure_1-10.2.csv: Downloaded from https://www.bls.gov/mfp/mprdload.htm , file klemscombinedbymeasure.xlsx
b. klemscombinedbymeasure_3-20.2.csv: Downloaded from https://www.bls.gov/mfp/mprdload.htm , file klemscombinedbymeasure.xlsx

Output file: data/industry_productivity.dta


%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_09_data_labor_costs
%%%%%%%%%%%%%%%%%%%%%%%%%%%
This loads and cleans annual unit labor costs for disaggregated industries from the BLS industry productivity series. 

Input files: 
a. ip.data.1.AllData.txt: Downloaded from https://download.bls.gov/pub/time.series/ip/

Output file: data/ip_labor_costs.dta


%%%%%%%%%%%%%%%%%%%
prep_10_data_ jtoj
%%%%%%%%%%%%%%%%%%%%%%
This file prepares the job-to-job transition dataset. J2J is used in the IV regressions. 

Input files: 
a. JtoJ_rates_industry_educ.dta: Downloaded as csv file from the Census Bureau’s LEHD program, lehd.ces.census.gov/data/. We use the job-to-job flows for the U.S. overall by industry, as rates, with disaggregation by education. This is obtained from the file j2jr_us_se_f_gn_ns_oslp_u.csv.

Output file: j2j_2_educ.dta


%%%%%%%%%%%%%%%%%%%%%%%%%
prep_11_interpolate_ppi
%%%%%%%%%%%%%%%%%%%%%%%%%%
This file prepares the seasonal adjustment of the PPI data by filling in gaps in the series. The seasonal adjustment does not work if a series has gaps, hence we need to fill them.
1-month gaps: fill by taking a simple average in the month before and after
2-month gaps: fill by linear interpolation
>2 month gaps: do not fill in, and generate two separate series IDs for the purpose of the seasonal adjustment
 At the end of the file, we seasonally adjust the NSA data using the Census' X-12-ARIMA Seasonal Adjustment program in SAS, which requires the auxiliary file sa_monthly.sas. 

Input file: ppi_noadj1.dta from prep_01_data_ppi.do. 

Output file: nsa.csv (to be run in SAS, which exports sa.csv). The reference code for monthly seasonal adjustment is sa_monthly.sas. sa_monthly.sas outputs sa.csv, which is to be loaded into prep_12_seasonal_adj_ppi to reformat the data.


%%%%%%%%%%%%%%%%%%%%%%%%%
prep_12_seasonal_adj_ppi
%%%%%%%%%%%%%%%%%%%%%%%%%
Loads in seasonally adjusted data to reformat correctly.

Input file: sa.csv:  Generated by sa_monthly.sas, which was called in prep_11_interpolate_ppi

Output file: ppi_adj1.dta


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_13_ppi_aggregation_naics5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file maps the 5-digit NAICS codes in the PPI data to time-consistent 5-digit codes. In some cases, 6-digit codes provide better coverage than 5-digit. In this case, we aggregate the codes to the 5-digit leve  using sales weights from the Census Bureau.
 
Input files: 
a. ppi_adj1.dta from prep_12_seasonal_adj_ppi.
b. wage_price_code_map_5digit.xlsx: Contains for 5-digit NAICS codes in the PPI a mapping to 5-digit NAICS codes in the QCEW. We generate this mapping manually based on the NAICS concordances available from the Census Bureau at https://www.census.gov/eos/www/naics/concordances/concordances.html.
c. naics2002weights.dta generated from prep_02_naics_mappings.do

Output file: ppi_aggregated_5digit.dta


%%%%%%%%%%%%%%%%%%%%%
prep_14_census_asm
%%%%%%%%%%%%%%%%%%%%%
This code cleans total sales, value added, and payoll data from the Economic Census and ASM for all available years. The sales data are used as weights for the wage-price pass-through regressions, and the payroll data are used to compute labor shares (by industry).
For non-manufacturing industries, we have the 2002, 2007, and 2012 Census, and use values from 2012 in following years and from 2002 in earlier years
For manufacturing, we have the ASM since 1997 to 2016, and use values from 1997 before that year and from 2016 after that year

Input files: 
a. weightsXX.csv: Census data from different industries obtained from the 2002, 2007, and 2012 Economic Census. The file pull_census_data.sh available in the code folder pulls in the Economic Census data from the Census websites. The source is
 https://www.census.gov/programs-surveys/economic-census/data/tables.2002.html
https://www.census.gov/programs-surveys/economic-census/data/tables.2007.html https://www2.census.gov/programs-surveys/economic-census/2012/naics/ <- there is an FTP site for more recent (2012-2017) Census data
b. ASM_XX_31GS101_with_ann.csv: ASM data obtained for different years. The file pull_asm_data.sh available in the code folder pulls in the data from the Census websites. The source is:
https://www.census.gov/data/developers/data-sets/asm-timeseries.html
For 2001, the ASM data is from https://www.census.gov/prod/2003pubs/m01as-1.pdf
For 1997-2000, the ASM data is from https://www.census.gov/prod/2002pubs/m00as-1.pdf

Output files: “census_asm_share.dta”


%%%%%%%%%%%%%%%%%%%%%%%%%
prep_15_naics_mappings
%%%%%%%%%%%%%%%%%%%%%%%%%%
This file loads in NAICS concordance files from the Census to generate time-consistent 6-digit NAICS codes. These will then be used to aggregate the trade data to the 5-digit level, since the trade data is only available at 6 digit

Input files: 
a. NAICS concordances: https://www.census.gov/eos/www/naics/concordances/concordances.html

Output files:
a. naicsXX_backmap.dta: NAICS concordance between year XX and XX-5
b. naicsXX.dta: List of NAICS that exist in a given vintage


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_16_import_penetration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Generates time-consistent 6-digit NAICS codes in the trade data, which can then be aggregated to 5-digit.

Input files: 
a. yearly_imports.dta: Generated by yearly_imp_exp.do, in the code folder. The raw data is downloaded from https://faculty.som.yale.edu/peterschott/international-trade-data/
b. yearly_exports.dta: Generated by yearly_imp_exp.do, in the code folder. The raw data is downloaded from https://faculty.som.yale.edu/peterschott/international-trade-data/
c. naicsXX.dta: List of NAICS that exist in a given vintage, from prep_15_naics_mappings.do
d. naicsXX_backmap.dta: NAICS concordance between year XX and XX-5, from prep_15_naics_mappings.do

Output file: imp_exp_naicsg.dta


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_17_import_penetration_concord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code concords the 6-digit NAICS time series in the trade data together and aggregates them to 5-digit and higher.

Input file: 
a. imp_exp_naicsg.dta from prep_16_import_penetration
b. yearly_imports.dta: Generated by yearly_imp_exp.do, in the code folder. The raw data is downloaded from https://faculty.som.yale.edu/peterschott/international-trade-data/
c. yearly_exports.dta: Generated by yearly_imp_exp.do, in the code folder. The raw data is downloaded from https://faculty.som.yale.edu/peterschott/international-trade-data/

Output file: yearly_imp_exp.dta


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_18_wage_price_map_naics5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file merges all of our datasets together to obtain the baseline regression data at the quarterly level.

Input files: 
a. ppi_aggregated_5digit.dta: Generated by prep_13_ppi_aggregation_naics5.do
b. wages_aggregate_naics5_sa.dta: Generated by prep_04_qcew_naics5_sa.do
c. concentration.dta: Generated by prep_05_data_concentration.do
d. age_4digit.dta and age_3digit.dta: Generated from prep_06_data_workers.do
e. educ_4digit.dta and educ_3digit.dta: Generated from prep_06_data_workers.do
f. gender_4digit.dta and gender_3digit.dta: Generated from prep_06_data_workers.do
g. industry_tfp2.dta: Generated from prep_07_data_tfp.do.
h. industry_productivity.dta: Generated from prep_08_data_lp_mfp.do
i. j2j_2_educ.dta: Generated from prep_10_data_jtoj.do
j. census_asm_share.dta: Generated from prep_14_census_asm.do
k. yearly_imp_exp.dta: Generated from prep_17_import_penetration_concord.do
l. ip_labor_costs.dta: Generated from prep_09_data_labor_costs.do

Output file: ppi_wages_q1_naics5.dta. This is the base file for the regressions. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_19_data_pass_through_lags
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file prepares the baseline regression dataset for all regressions using both manufacturing and services (2003-2016).

Input files: ppi_wages_q1_naics5.dta, from prep_18_wage_price_map_naics5.do

Output file: ppi_wages_q3_lags.dta


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prep_20_data_pass_through_long_lags
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file prepares the baseline regression dataset for all regressions using only manufacturing for the longer time period (1993-2016).

Input files: ppi_wages_q1_naics5.dta, from prep_18_wage_price_map_naics5.do

Output file: ppi_wages_q2_long_lags.dta



############################
2. GRAPHS
#############################
We first provide a list of all figures and the corresponding files generating them. We then go through these files and list their inputs and outputs.

Figures in the main text: 
Figure 1: Evolution of Core CPI Inflation During Economic Expansions
fig_main_appendix_spidercharts.do

Figure 2: Inflation versus Unemployment Recovery from Four Previous Recessions
fig_main_appendix_spidercharts.do

Figure 3: Counterfactual Inflation for the 2003-2007 and 2009-2020 Expansions
fig_main_spider_counterfactuals.do

Figure 4: Cumulative Growth in Wages (Top Panels) and in Unit Labor Costs (Bottom Panels) Relative to Unemployment Recovery Gap.
fig_main_appendix_spidercharts.do

Figure 5: Pass-Through-Analysis: Response of Price Inflation to Wage Inflation
fig_main_irf_ugap_lags.do

Figure 6: Pass-Through at Different Time Horizons
fig_main_passthrough_time_horizons.do

Figure 7: Rising Import Penetration and Concentration in the Manufacturing Sector
fig_main_appendix_table_ip_concentration.do

Figure 8: Import Penetration versus Market Concentration
fig_main_appendix_ip_vs_concentration.do


Figures in the Appendix: 
Figure B.1: Impulse Response Functions
fig_appendix_irf.do

Figure B.2: Impulse Response Functions using the IV-LP Approach
fig_appendix_irfIV.do


Figures in the Online Appendix:
Figure D.1: Inflation versus GDP Growth from Four Previous Recessions
fig_main_appendix_spidercharts.do

Figure D.2: Inflation from Four Previous Recessions
fig_main_appendix_spidercharts.do

Figure D.3: Inflation versus Employment-to-Population Ratio from Four Previous Recessions
fig_appendix_epop.do

Figure D.4: Wage Growth versus GDP Growth from Four Previous Recessions
fig_main_appendix_spidercharts.do

Figure D.5: Wage Growth from Four Previous Recessions
fig_main_appendix_spidercharts.do

Figure D.6: Aggregate Pass-Through Excluding Unemployment Gap
fig_appendix_no_ugap.do

Figure G.1: Concentration Trends in Manufacturing
fig_main_appendix_table_ip_concentration.do

Figure G.2: Market Concentration versus Import Penetration from China
fig_main_appendix_ip_vs_concentration.do

Figure H.1: Inflation versus Unemployment Recovery from Four Previous Recessions for Canada
fig_main_appendix_spidercharts.do

Figure H.2: Inflation versus Unemployment Recovery from Two Previous Recessions for the UK
fig_main_appendix_spidercharts.do

Figure H.3: Inflation versus Unemployment Recovery from Two Previous Recessions for the Eurozone
fig_main_appendix_spidercharts.do


Description of files: 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_main_appendix_spidercharts.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code generates all spider charts in the paper.

Input files:
1. cpi_vs_unemployment_updated.xlsx and cpi_vs_unemployment_lc.xlsx: Raw data downloaded from Haver Analytics
Series:
a. ra16@empl: Unemployment Rate: 16 Years + (SA, %)
b. pcuslfe@usecon: CPI-U: All Items Less Food and Energy (SA, 1982-84=100)
c. pcuscfe@usecon: CPI-U: Commodities Less Food & Energy Commodities (SA, 1982-84=100)
d. pcussle@usecon: CPI-U: Services Less Energy Services (SA, 1982-84=100)
e. GDPH@USECON: Real Gross Domestic Product (SAAR, Bil.Chn.2012$)
f. QA16@EMPL: Employment-Population Ratio: 16 Years + (SA, %)

2. cpi_vs_unemployment_eurozone.xlsx: Raw data downloaded from Haver Analytics
a. S023R@EUDATA: EA11-19: Unemployment Rate (SA, %)
b. H023HOEU@EUDATA: EA11-19: HICP: Total ex Energy & Unprocessed Food (SA, 2015=100)
c. H023HNIG@EUDATA: EA11-19: HICP: Nonenergy Industrial Goods (SA, 2015=100)
d. H023HSL@EUDATA: EA11-19: HICP: Core Services (SA, 2015=100)
e. J023GDPT@EUDATA: EA 11-19: Gross Domestic Product (SWDA, Mil.Ch.2015.EUR)

3. cpi_vs_unemployment_uk.xlsx: Raw data downloaded from Haver Analytics
a. MGSXQ@UK: UK: LFS: Unemployment Rate: Aged 16 and Over (SA, %)
b. sa(DKC7@UK): UK: CPI: All Items excl Energy & Unprocessed Food (NSA, 2015=100)  - Seasonal Adjustment, All
c. sa(DK9J@UK): UK: CPI: Nonenergy Industrial Goods (NSA, 2015=100)  - Seasonal Adjustment, All
d. sa(D7F5@UK): UK: Consumer Price Index: All Services (NSA, 2015=100)  - Seasonal Adjustment, All
e. ABMIQ@UK: U.K.: Real Gross Domestic Product (SA, Mil.Chn.2016.GBP)

 4. cpi_vs_unemployment_canada.xlsx: Raw data downloaded from Haver Analytics
a. V2062815@CANADA: Canada: Unemployment Rate: Both Sexes, 15 Years and Over (SA, %)
b. sa(V4C91233@CANADA): Canada: CPI: All Items ex Food and Energy [V41691233] (NSA, 2002=100)  - Seasonal Adjustment, All
c. sa(V4C91229@CANADA): Canada: CPI: Goods excl Food Purch from Stores/Energy [V41691229](NSA, 2002=100)  - Seasonal Adjustment, All
d. sa(V4C91230@CANADA): Canada: CPI: Services [V41691230] (NSA, 2002=100)  - Seasonal Adjustment, All
e. V6E05752@CANADA: Canada: Gross Domestic Product at Market Prices (SAAR, Mil.Chn.2012.C$)

5. wages_vs_unemployment_updated.xlsx: Raw data downloaded from Haver Analytics
6. wages_vs_unemployment_quarterly.xlsx: Raw data downloaded from Haver Analytics
a. ra16@empl: Unemployment Rate: 16 Years + (SA, %)
b. legooda@labor: Avg Hrly Earnings of Prod & Nonsup Employees: Goods-Producing (SA, $/Hour)
c. lepsrva@labor: Avg Hrly Earn of Prod & Nonsup Employ: Private Service-Providing (SA, $/Hour)
d. GDPH@USECON: Real Gross Domestic Product (SAAR, Bil.Chn.2012$)

 7. pr.data.1.AllData.txt: Downloaded from https://download.bls.gov/pub/time.series/pr/

Outputs:
1. Figure 1: Evolution of CPI Inflation During Economic Expansions
2. Figure 2: Inflation versus Unemployment Recovery from Four Previous Recessions
3. Figure 4: Cumulative Growth in Wages (Top Panels) and in Unit Labor Costs (Bottom Panels) Relative to Unemployment Recovery Gap.
4. Figure D.1: Inflation versus GDP Growth from Four Previous Recessions
5. Figure D.2: Inflation from Four Previous Recessions
6. Figure D.4: Wage Growth versus GDP Growth from Four Previous Recessions
7. Figure D.5: Wage Growth from Four Previous Recessions
8. Figure H.1: Inflation versus Unemployment Recovery from Four Previous Recessions for Canada
9. Figure H.2: Inflation versus Unemployment Recovery from Two Previous Recessions for the UK
10. Figure H.3: Inflation versus Unemployment Recovery from Two Previous Recessions for the Eurozone


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_main_spider_counterfactuals.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code generates the spider charts with the counterfactuals.

Input files:
1. cpi_counterfactual.xlsx: This Excel file is based on the raw CPI data for goods and for services and their relative importance weights
Series:
a. ra16@empl: Unemployment Rate: 16 Years + (SA, %)
b. pcuslfe@usecon: CPI-U: All Items Less Food and Energy (SA, 1982-84=100)
c. pcuscfe@usecon: CPI-U: Commodities Less Food & Energy Commodities (SA, 1982-84=100)
d. pcussle@usecon: CPI-U: Services Less Energy Services (SA, 1982-84=100)
e. Weights...
The calculations of the counterfactuals are then done by hand in the Excel file

Outputs:
1. Figure 3: Counterfactual Inflation for the 2003-2007 and 2009-2020 Expansions


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_main_irf_ugap_lags.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the aggregate pass-through from wage inflation to price inflation figures.

Input files:
1. replicate_haver_data.xlsx: The data series are downloaded from Haver Analytics
Series:
a. pcu@usecon: CPI-U: All Items (SA, 1982-84=100)
b. pcuslfe@usecon: CPI-U: All Items Less Food and Energy (SA, 1982-84=100)
c. jc@usecon: Personal Consumption Expenditures: Chain Price Index (SA, 2012=100)
d. jcxfe@usecon: PCE less Food & Energy: Chain Price Index (SA, 2012=100)
e. sp3000@usecon: PPI: Finished Goods (SA, 1982=100)
f. sp3500@usecon: PPI: Finished Goods less Food and Energy (SA, 1982=100)
g. jgdp@usecon: Gross Domestic Product: Chain Price Index (SA, 2012=100)
h. ls@usecon: Employment Cost Index: Compensation: Civilian Workers (SA, Dec-05=100)
i. lepriva@usecon: Avg Hourly Earnings: Prod & Nonsupervisory: Total Private Industries(SA, $/Hour)
j. lr@usecon: Civilian Unemployment Rate: 16 yr + (SA, %)
k. nairuq@usecon: Natural Rate of Unemployment [CBO] (%)
l. UCCXFDG@CPIDATA: CPI-U: Commodities Less Food & Energy (SA, 1982-84=100)
m. USXEG@CPIDATA: CPI-U: Services Less Energy Services (SA, 1982-84=100)
n. LEGOODA@USECON: Avg Hourly Earnings: Prod & Nonsupervisory: Goods-producing Industries(SA, $/Hr)
o. LEPSRVA@USECON: Avg Hrly Earn: Prod & Nonsupervisory: Private Svc-providing Industries(SA, $/Hr)
p. pcuslfn@usecon: CPI-U: All Items Less Food (NSA, 1982-84=100)
q. pd49104@usecon: PPI: Final Demand Less Foods and Energy (NSA, Apr-10=100)

Output:
1. Figure 5: Pass-Through Analysis: Response of Price Inflation to Wage Inflation
2. replicate_aggdata_ugaplags.dta: Intermediate dataset used for the structural break analysis


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_main_passthrough_time_horizons.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the pass-through of wages to prices at different time horizons.

Input files:
1. ppi_wages_q3_lags.dta: Generated by prep_19_data_pass_through_lags.do

Output:
1. Figure 6: Pass-Through at Different Time Horizons


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_main_appendix_table_ip_concentration.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the time series of import penetration and concentration and some summary statistics

Input files:
1. ppi_wages_q1_naics5.dta: Generated by prep_18_wage_price_map_naics5.do

Output:
1. Figure 7: Rising Import Penetration and Concentration in the Manufacturing Sector
2. Figure G.1: Concentration Trends in Manufacturing 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_main_appendix_ip_vs_concentration.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file computes the correlation between import penetration and concentration and generates a scatterplot

Input files:
1. ppi_wages_q1_naics5.dta: Generated by prep_18_wage_price_map_naics5.do

Output:
1. Figure 8: Import Penetration versus Market Concentration
2. Figure G.2: Market Concentration versus Import Penetration from China


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_ appendix_baseline_irf.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates impulse response functions in the micro data similar to those in the aggregate data for Appendix B.

Input files:
1. ppi_wages_q1_naics5.dta: Generated by prep_18_wage_price_map_naics5.do

Output:
1. Figure B.1: Impulse Response Functions


%%%%%%%%%%%%%%%%%%%%%%%%
fig_ appendix_irfIV.do
%%%%%%%%%%%%%%%%%%%%%%%
This file generates the IV-LP estimates in Appendix B.

Input files:
1. ppi_wages_q3_lags.dta: Generated by prep19_data_pass_through_lags.do

Output:
1. Figure B.2: Impulse Response Functions using the IV-LP Approach


%%%%%%%%%%%%%%%%%%%%%%%
fig_ appendix_epop.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the spider chart with the Employment-to-Population Ratio in Appendix D

Input data:
1. cpi_vs_epop.xlsx: Downloaded from Haver Analytics
Series:
a. qa16@empl: Employment-Population Ratio: 16 Years + (SA, %)
b. pcuslfe@usecon: CPI-U: All Items Less Food and Energy (SA, 1982-84=100)
c. pcuscfe@usecon: CPI-U: Commodities Less Food & Energy Commodities (SA, 1982-84=100)
d. pcussle@usecon: CPI-U: Services Less Energy Services (SA, 1982-84=100)
e. GDPH@USECON: Real Gross Domestic Product (SAAR, Bil.Chn.2012$)

Output:
1. Figure D.3: Inflation versus Employment-to-Population Ratio for Four Previous Recessions


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_ appendix_ no_ugap.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the aggregate pass-through from wage inflation to price inflation figures in Appendix D, excluding the unemployment gap.

Input data:
1. replicate_haver_data.xlsx: The data series are downloaded from Haver Analytics
Series:
a. pcu@usecon: CPI-U: All Items (SA, 1982-84=100)
b. pcuslfe@usecon: CPI-U: All Items Less Food and Energy (SA, 1982-84=100)
c. jc@usecon: Personal Consumption Expenditures: Chain Price Index (SA, 2012=100)
d. jcxfe@usecon: PCE less Food & Energy: Chain Price Index (SA, 2012=100)
e. sp3000@usecon: PPI: Finished Goods (SA, 1982=100)
f. sp3500@usecon: PPI: Finished Goods less Food and Energy (SA, 1982=100)
g. jgdp@usecon: Gross Domestic Product: Chain Price Index (SA, 2012=100)
h. ls@usecon: Employment Cost Index: Compensation: Civilian Workers (SA, Dec-05=100)
i. lepriva@usecon: Avg Hourly Earnings: Prod & Nonsupervisory: Total Private Industries(SA, $/Hour)
j. lr@usecon: Civilian Unemployment Rate: 16 yr + (SA, %)
k. nairuq@usecon: Natural Rate of Unemployment [CBO] (%)
l. UCCXFDG@CPIDATA: CPI-U: Commodities Less Food & Energy (SA, 1982-84=100)
m. USXEG@CPIDATA: CPI-U: Services Less Energy Services (SA, 1982-84=100)
n. LEGOODA@USECON: Avg Hourly Earnings: Prod & Nonsupervisory: Goods-producing Industries(SA, $/Hr)
o. LEPSRVA@USECON: Avg Hrly Earn: Prod & Nonsupervisory: Private Svc-providing Industries(SA, $/Hr)
p. pcuslfn@usecon: CPI-U: All Items Less Food (NSA, 1982-84=100)
q. pd49104@usecon: PPI: Final Demand Less Foods and Energy (NSA, Apr-10=100)

Output:
1. Figure D.6: Aggregate Pass-Through Excluding Unemployment Gap





##########################
3. TABLES
##########################

We first provide a list of all tables and the corresponding files generating them. We then go through these files and list their inputs and outputs.
Tables in the main text: 
Table 1: Structural Breaks
table_irf_ugap_lags_structural_breaks.do

Table 2: Pass-Through Regressions for Manufacturing versus Services, 2003-2016 (h = 8)
table_pass_through_reg_time_horizons.do 

Table 3: Pass-Through Regressions in Manufacturing, 1993 - 2016 (h = 8)
table_pass_through_long_reg_time_horizons.do

Table 4: Pass-Through and Import Penetration in Manufacturing, 1993 - 2016 (h=8)
table_pass_through_long_reg_time_horizons.do

Table 5: Measures of Concentration in 1997 and 2016
fig_main_appendix_table_ip_concentration.do (line 86)

Table 6: Pass-Through and Sales Concentration in Manufacturing, 1997-2016 (h = 8)
table_pass_through_long_reg_time_horizons.do

Table 7: Pass-Through Regressions: Import Penetration versus Concentration, 1997-2016 (h = 8)
table_pass_through_long_reg_time_horizons.do


Tables in the Online Appendix: 
Table E.1: Pass-Through Regressions for Manufacturing versus Services, 2003-2016 (h = 4)
table_pass_through_reg_time_horizons.do 

Table E.2: Pass-Through Regressions for Manufacturing versus Services, 2003-2016 (h = 12)
table_pass_through_reg_time_horizons.do 

Table E.3: Pass-Through Regressions for Manufacturing versus Services, Unweighted Regressions, 2003-2016 (h = 8)
table_pass_through_reg_time_horizons.do 

Table E.4: Pass-Through Regressions for Manufacturing versus Services with Different Fixed Effects, 2003-2016 (h = 8)
table_pass_through_reg_time_horizons.do 

Table E.5: Pass-Through Regressions in Manufacturing, 1993-2016 (h = 4)
table_pass_through_long_reg_time_horizons.do

Table E.6: Pass-Through Regressions in Manufacturing, 1993-2016 (h = 12)
table_pass_through_long_reg_time_horizons.do

Table E.7 Pass-Through Regressions with Value-Added for Labor Share, 1993-2016 (h=8)
table_pass_through_long_VA.do

Table F.1: IV Regressions, 2003-2016 (h = 8)
table_pass_through_reg_IV.do

Table G.1: Pass-Through and Import Penetration, 1993-2016 (h = 4)
table_pass_through_long_reg_time_horizons.do

Table G.2: Pass-Through and Import Penetration, 1993-2016 (h = 12)
table_pass_through_long_reg_time_horizons.do

Table G.3: Pass-Through and Import Penetration from China, 1993-2016
table_pass_through_long_reg_time_horizons.do

Table G.4: Pass-Through and Sales Concentration in Manufacturing, 1997-2016 (h = 4)
table_pass_through_long_reg_time_horizons.do

Table G.5: Pass-Through and Sales Concentration in Manufacturing, 1997-2016 (h = 12)
table_pass_through_long_reg_time_horizons.do

Table G.6: Pass-Through and Employment Concentration in Manufacturing, 1993-2014 (h = 8)
table_pass_through_long_reg_time_horizons.do

Table G.7: Import Penetration versus Concentration, 1997-2016 (h = 4)
table_pass_through_long_reg_time_horizons.do

Table G.8: Import Penetration versus Concentration, 1997-2016 (h = 12)
table_pass_through_long_reg_time_horizons.do

Table G.9: Import Penetration versus Concentration without Labor Share, 1997-2016 (h = 4)
table_pass_through_long_reg_time_horizons.do

Table G.10: Import Penetration versus Concentration without Labor Share, 1997-2016 (h = 8)
table_pass_through_long_reg_time_horizons.do

Table G.11: Import Penetration versus Concentration without Labor Share, 1997-2016 (h = 12)
table_pass_through_long_reg_time_horizons.do


Description of files: 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
table_irf_ugap_lags_structural_breaks.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code re-runs the aggregate IRF regressions at the peak lag length in the aggregate data and checks for structural breaks. Generates Table 1.

 Input data:
1. replicate_aggdata_ugaplags.dta: Generated as intermediate dataset in fig_main_irf_ugap_lags.do

Output:
1. Table 1: Structural Breaks


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
table_pass_through_reg_time_horizons.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code contains the pass-through regressions for manufacturing vs. services (2003-2016).

Input data:
1. ppi_wages_q3_lags.dta: Generated in prep_19_data_pass_through_lags.do

Output:
1. Table 2: Pass-Through in Manufacturing versus Services, 2003-2016 (h=8)
2. Table E.1 and E.2: Pass-Through in Manufacturing versus Services, 2003-2016 (h=4 and h=12)
3. Table E.3: Pass-Through in Manufacturing versus Services, Unweighted Regressions, 2003-2016 (h=8)
4. Table E.4: Pass-Through in Manufacturing versus Services with Different Fixed Effects, 2003-2016 (h=8)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
table_pass_through_long_reg_time_horizons.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code contains the pass-through regressions for manufacturing only (1993-2016).

Input data:
1. ppi_wages_q2_long_lags.dta: Generated in prep_20_data_pass_through_long_lags.do

Output:
1. Table 3: Pass-Through Regressions in Manufacturing, 1993-2016 (h=8)
2. Table 4: Pass-Through and Import Penetration in Manufacturing (h=8)
3. Table 6: Pass-Through and Sales Concentration in Manufacturing, 1997-2016 (h=8)
4. Table 7: Pass-Through Regressions: Import Penetration versus Concentration, 1997-2016 (h=8)
5. Tables E.5 and E.6: Pass-Through Regressions in Manufacturing, 1993-2016 (h=4 and h=12)
6. Tables G.1 and G.2: Pass-Through and Import Penetration in Manufacturing (h=4 and h=12)
7. Table G.3: Pass-Through and Import Penetration from China (h=8)
8. Tables G.4 and G.5: Pass-Through and Sales Concentration in Manufacturing, 1997-2016 (h=4 and h=12)
9. Table G.6: Pass-Through and Employment Concentration in Manufacturing, 1993-2014 
10. Tables G.7 and G.8: Import Penetration versus Concentration, 1997-2016 (h=4 and h=12)
11. Tables G.9, G.10, and G.11: Import Penetration versus Concentration without Labor Share, 1997-2016 (h=4, h=8, and h=12)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fig_main_appendix_table_ip_concentration.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the time series of import penetration and concentration and some summary statistics

Input files:
1. ppi_wages_q1_naics5.dta: Generated by prep_18_wage_price_map_naics5.do

Output:
1. Table 5: Measures of Concentration in 1997 and 2016


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
table_pass_through_long_VA.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the pass-through regressions for manufacturing. All labor share variables are constructed using value added, instead of total sales.

Input files:
1. ppi_wages_q3_lags.dta: Generated in prep_19_data_pass_through_lags.do
2. ppi_wages_q2_long_lags.dta: Generated in prep_20_data_pass_through_long_lags.do

Output:
1. Table E.7: Pass-Through Regressions with Value-Added for Labor Share, 1993-2016 (h=8)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
table_pass_through_reg_IV.do
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This file generates the IV pass-through regressions (2003-2016). The instrument are J2J transitions.

Input files:
1. ppi_wages_q1_naics5.dta: Generated by prep_18_wage_price_map_naics5.do.

Output:
1. Table F.1: IV Regressions, 2003-2016 (h=8)
