This file accompanies Stata .do files for the following paper:

	Bordeman, A., B. Kannan, and R. Pinheiro. "Rival Growth Prospects and Equity Prices: Evidence from Mass Layoff Announcements" 
		Accepted at The Journal of Money, Credit, and Banking. 

We obtain our primary data from the following sources:

	Layoff sample: Hand collected from the Wall Street Journal via Factiva
	Financial characteristics: Obtained from Compustat, accessed through WRDS
	Stock Prices and Returns: Obtained from CRSP, accessed through EVENTUS in WRDS
	For more detail on data, please refer to the original paper.

Our program is broken into seven steps, each with a defined objective, as well as a starting and ending dataset. The essential details of the different programs 
can be found below:

Step 1: 
	Objective: Aggregate and clean financial statement data from Compustat
	Code File: 'step1_winsorize compustat data.do'
	Input: compustat_raw_data.dta
	Process: From an initial Compustat download, we retain only those observations of interest (US firms, data from 1979-2010, non-financial and non-utilities).
	We then ensure valid, non-missing data and create a set of financial variables to be used in our analysis. We create lagged versions of variables, as 
	necessary, and we winsorize continuous independent variables. The final dataset is a clean set of financial characteristics by firm and year. 
	Output: compustat_data.dta

Step 2:
	Objective: Group announcers with peers and prepare to gather returns data
	Code File: 'step2_setting up layoff data.do'
	Input: layoff_announcements_raw.dta
	Process: We begin with our hand collected dataset of layoff announcements. We merge with our Compustat dataset from Step 1 and perform further cleaning.
	Then, for each announcement we create a Cartesian product of announcer and each peer firm in the same three-digit SIC code and year. With the set of peers
	and the layoff announcement date, we prepare a Request/input file to be used in Eventus/WRDS Event Study to obtain cumulative abnormal returns (CARs) for 
	announcers and peers.  
	Outputs: reshaped_layoff_data_sic3dig.dta ; primary_eventus_input.txt

Step 3A:
	Objective: Combine layoff data, financial data, and returns data
	Code File: 'step3a_event_study_varibales.do'
	Input: reshaped_layoff_data_sic3dig.dta
	Process: Announcer-peer pair observations are merged with financial and returns data. Then we create an identifier for those peers with some presence in the 
	S&P 500 index. We then identify layoff events/peers with concurrent news announcements (earnings, stock splits, dividends, delistings, etc.). Next we create
	indicators for "good news" and "bad news" announcements, based on announcer CAR. 
	Output: ready_for_analysis_MAR.dta

Step 3B:
	Objective: Identifying the time between layoff announcements for announcers with more than one layoff in the sample period
	Code File: 'step3b_distance_between_announcements.do'
	Input: layoff_temp_for_distance.dta
	Process: This step simply focuses on announcer layoffs. Announcements are sorted by announcer and date. Then the distance to the prior announcement by the same
	firm is calculated. We create an indicator if an announcement occurs within 100 days after a previous announcement by the same firm.
	Outputs: layoff_times_Bharad.dta ; distance_ann_Bharad.dta

Step 4:
	Objective: Finalize sample for analysis
	Code File: 'step4_analysis.do'
	Input: ready_for_analysis_MAR.dta
	Process: We first ensure that all observations have valid data for analysis. Then we flag those announcement events with a potential confounding event (earnings
	announcement, stock split, dividend, delisting, etc.). 
	Output: ready_for_tables.dta

Step 5:
	Objective: Run analysis and generate results
	Code File: 'step5_tables.do'
	Input: ready_for_tables.dta
	Process: This file produces all of our primary results and tables. 
	Output: a multitude of different tables, mostly in .tex format to easily bring into the paper. 

Step 6: 
	Objective: Run a placebo test using randomized event dates between 1980 and 2010
	Codes: Codes can be found in the 'for placebo test' folder. They have to be run in order. 'Step5_tables_placeb.do' produces Table 6.
	Output: Table 6 - Placebo Test: Rivals' Stock Return Reaction

Step 7: 
	Objectives: Generate Appendix Graphs 
	Code: 'Step6_Appendix Graphs.do'
	Input: ready_for_tables.dta ; operating_info_compustat.dta 
	Output: Appendix graphs on long run operating performance


* NOTE: Tables 2 and 3 are directly downloaded from EVENTUS in the WRDS database. The input files to download this data are called: 
	1. positive_announcer_input.txt
	2. rivals_for_pos_ann_input.txt
	3. negative_announcer_input.txt
	4. rivals_for_neg_ann_input.txt
	
	We upload each of these input files (one at a time) to EVENTUS and download event study results using the Scholes Williams model with a value weighted index.
	These input files are generated using the 'Input File Generator.do' code file.