This repository contains the main industry-level measures used in Corporate Flexibility in a Time of Crisis by John W. Barry, Murillo Campello, John R. Graham and Yueran Ma, along with the code to reproduce them.
Please read Section 2 of the paper and specifically the Data Appendix (Appendix C of the Internet Appendix for more detail on construction. The four measures included here are:
- Workplace Flexibility - four-digit NAICS measure of ability to move to a remote working environment
- The main measure of workplace flexibility is named
workfromhome
- The main measure of workplace flexibility is named
- Investment Flexibility - four-digit NAICS measure of flexibility with respect to speed of completion of investment projects
- The main measure of investment flexibility is named
flex_speed
- The main measure of investment flexibility is named
- Customer Interactions - four-digit NAICS measure of importance of interactions with customers/consumers to a firm's business that captures both direct customer interactions and "indirect" customer interactions (i.e., the importance of direct customer interactions of downstream industries)
- The main measure of customer interactions is
cust_int_tot
, which is a weighted average of the direct and indirect measures of customer interactions
- The main measure of customer interactions is
- Fixed Cost Share - four-digit NAICS measure of the relative importance of fixed costs (to variable costs) for a firm's business
- The main measure of fixed cost share is named
fc_ind
- The main measure of fixed cost share is named
All code is contained in subdirectory Code:
download_data.py
contains functions that download the raw data needed for each measure.workplace_flex.py
contains functions that build the workplace flexibility measureinvestment_flex.py
contains functions that build the investment flexibility measure- Please note: the underlying data to build this measure comes from the Duke/CFO survey, which is not available publicly, so only the code to produce the measure and the measure itself are included.
customer_interactions.py
contains functions that build the customer interactions measure (direct, indirect, and combined)fixed_cost_share.py
contains functions that build the fixed cost share measurerunfile.py
downloads the data and then compiles the four measures
- Download (or clone) this repository.
- Open a prompt and navigate to the folder location on your machine
- Run
pip install -r requirements.txt
, or install the packages wrds and pyDataverse yourself (if you do not have them already). - Either open runfile.py in your Python IDE, or enter
python runfile.py
in your prompt - The raw data will then download to directory Data and the industry measures will download and overwrite the files in Out_Data