Skip to content

brycewang-stanford/Auto-Empirical-Research-Skills / skills/18-jusi-aalto-stata-accounting-research

stata-accounting-research

Unverified

STATA code pattern library for empirical archival accounting research. Provides tested syntax from 126 peer-reviewed JAR (Journal of Accounting Research) replication files (2017-2025). Use when the user asks procedural questions like "How do I implement [method]?" or "Show me code for [technique]" — including: entropy balancing, propensity score matching (PSM), difference-in-differences (DiD), regression discontinuity (RDD), instrumental variables (IV), event studies (CAR/BHAR), survival analysis, Fama-MacBeth regressions, bootstrap, quantile regression, reghdfe/xtreg/areg, clustering standard errors, fixed effects, esttab/outreg2 table formatting, winsorization, leads/lags. Users can specify their variables (e.g., treatment, outcomes, controls) and receive adapted syntax. NOTE: This skill provides code patterns from published papers, not research design advice.

FileKindSize
README-original.mdmarkdown2.9 KB
SKILL.mdskill md4.8 KB
references/JAR_55_bbcl.doother59.1 KB
references/JAR_55_chaplinksy-hanley-moon.doother46.3 KB
references/JAR_55_clm.doother95.1 KB
references/JAR_55_elw.doother58.0 KB
references/JAR_55_hlsw.doother104.1 KB
references/JAR_55_kks.doother365.5 KB
references/JAR_55_lzz.doother25.5 KB
references/JAR_55_madsen.doother307.5 KB
references/JAR_55_mr.doother41.5 KB
references/JAR_56_al.doother75.3 KB
references/JAR_56_bch.doother13.5 KB
references/JAR_56_blv.doother24.6 KB
references/JAR_56_csmw.doother27.6 KB
references/JAR_56_en.doother21.2 KB
references/JAR_56_granja.doother107.9 KB
references/JAR_56_htw.doother18.6 KB
references/JAR_56_kmt.doother5.6 KB
references/JAR_56_ksvw.doother8.0 KB
references/JAR_56_llz.doother3.1 KB
references/JAR_56_ls.doother147.5 KB
references/JAR_56_lv2018.doother123.7 KB
references/JAR_57_bht.doother24.4 KB
references/JAR_57_bl.doother22.6 KB
references/JAR_57_bw.doother263.2 KB
references/JAR_57_cct.doother347.1 KB
references/JAR_57_cgw.doother195.8 KB
references/JAR_57_hcp.doother38.0 KB
references/JAR_57_honigsberg.doother99.5 KB
references/JAR_57_lehmann.doother112.8 KB
references/JAR_57_lm.doother85.5 KB
references/JAR_58_bsz.doother36.9 KB
references/JAR_58_ckm.doother52.3 KB
references/JAR_58_eyring.doother58.1 KB
references/JAR_58_gj.doother187.5 KB
references/JAR_58_gsz.doother121.6 KB
references/JAR_58_htyz.doother30.9 KB
references/JAR_58_jansen.doother99.5 KB
references/JAR_58_joshi.doother43.0 KB
references/JAR_58_kvy.doother19.5 KB
references/JAR_58_msz.doother35.0 KB
references/JAR_58_rauter.doother433.2 KB
references/JAR_58_wy.doother64.5 KB
references/JAR_58_zz.doother125.5 KB
references/JAR_59_breuer.doother826.9 KB
references/JAR_59_ctv.doother383.7 KB
references/JAR_59_dess.doother78.4 KB
references/JAR_59_hmo.doother351.6 KB
references/JAR_60_abkp.doother129.9 KB
references/JAR_60_alv.doother35.4 KB
references/JAR_60_at.doother38.5 KB
references/JAR_60_barrios.doother119.6 KB
references/JAR_60_bbin.doother72.9 KB
references/JAR_60_bdem.doother11.6 KB
references/JAR_60_bl.doother43.5 KB
references/JAR_60_bmsw.doother7.7 KB
references/JAR_60_cc.doother20.1 KB
references/JAR_60_cpss.doother15.4 KB
references/JAR_60_cstv.doother175.3 KB
references/JAR_60_dg.doother19.9 KB
references/JAR_60_duguay.doother8.0 KB
references/JAR_60_fhl.doother71.3 KB
references/JAR_60_gls.doother37.0 KB
references/JAR_60_hmryz.doother28.6 KB
references/JAR_60_hst.doother18.3 KB
references/JAR_60_kt.doother10.4 KB
references/JAR_60_mliu.doother28.3 KB
references/JAR_60_nrwx.doother14.6 KB
references/JAR_60_ptwy.doother26.6 KB
references/JAR_60_skim.doother14.7 KB
references/JAR_61_bcdr.doother524.9 KB
references/JAR_61_bkr.doother51.6 KB
references/JAR_61_bls.doother79.2 KB
references/JAR_61_bo.doother29.7 KB
references/JAR_61_ccm.doother48.7 KB
references/JAR_61_cdss.doother3.9 KB
references/JAR_61_cfhll.doother47.1 KB
references/JAR_61_cfmp.doother12.7 KB
references/JAR_61_ckor.doother77.5 KB
references/JAR_61_cllw.doother11.2 KB
references/JAR_61_clm.doother11.0 KB
references/JAR_61_deller.doother368.9 KB
references/JAR_61_dlrtw.doother30.6 KB
references/JAR_61_dlz.doother13.6 KB
references/JAR_61_drs.doother15.8 KB
references/JAR_61_ds.doother197.5 KB
references/JAR_61_glt.doother1.9 KB
references/JAR_61_gyz.doother7.5 KB
references/JAR_61_ll.doother89.3 KB
references/JAR_61_lszz.doother15.9 KB
references/JAR_61_os.doother128.9 KB
references/JAR_61_zureich.doother22.2 KB
references/JAR_62_1_bdsy_banerjee_etal.doother6.6 KB
references/JAR_62_1_bhs_bouwens_etal.doother59.7 KB
references/JAR_62_1_gsz_gu_sun_zhou.doother46.6 KB
references/JAR_62_2_dgzz_defranco_etal.doother1.8 KB
references/JAR_62_2_gmp_grewal_etal.doother37.2 KB
references/JAR_62_2_xyz_xin_etal.doother25.3 KB
references/JAR_62_3_bht_bloomfield_etal.doother16.0 KB
references/JAR_62_3_ccz_cheynel_etal.doother23.3 KB
references/JAR_62_3_kim.doother2.6 KB
references/JAR_62_3_rr_raghunandan_ruchti.doother15.5 KB
references/JAR_62_4_bd_breuer_dehaan.doother15.3 KB
references/JAR_62_4_cc_cadman_carrizosa.doother20.1 KB
references/JAR_62_4_kmsv_kohler_etal.doother91.5 KB
references/JAR_62_4_mps_marra_etal.doother68.0 KB
references/JAR_62_4_raghunandan.doother50.0 KB
references/JAR_62_4_stv_sran_etal.doother41.1 KB
references/JAR_62_4_xu.doother49.4 KB
references/JAR_62_5_aov_abraham_etal.doother418.9 KB
references/JAR_62_5_gibbons.doother80.1 KB
references/JAR_62_5_jiang.doother114.3 KB
references/JAR_62_5_kstz_krueger_etal.doother26.7 KB
references/JAR_62_5_llz_li_lou_zhang.doother6.2 KB
references/JAR_62_5_lrst_lins_etal.doother66.2 KB
references/JAR_62_5_lswy_lin_etal.doother85.2 KB
references/JAR_62_5_lw_li_wang.doother16.6 KB
references/JAR_63_1_blmv_bastiaansen_etal.doother18.5 KB
references/JAR_63_1_cvw_chen_etal.doother61.2 KB
references/JAR_63_1_fgr_frankel_etal.doother30.3 KB
references/JAR_63_1_hrsx_huang_etal.doother35.5 KB
references/JAR_63_1_jia.doother12.0 KB
references/JAR_63_2_bcrw_bakke_etal.doother271.3 KB
references/JAR_63_2_dlr_desimone_etal.doother83.5 KB
references/JAR_63_2_mqtz_mao_etal.doother94.2 KB
references/JAR_63_2_npstv_nessa_etal.doother7.0 KB
references/JAR_63_3_breuer.doother51.4 KB
references/REFERENCES.mdmarkdown30.7 KB

references/JAR_55_mr.do

View on GitHub

*************************************************************************************************************
*DOES CORPORATE SOCIAL RESPONSIBILITY (CSR) CREATE SHAREHOLDER VALUE? 
*EVIDENCE FROM THE INDIAN COMPANIES ACT 2013

*HARIOM MANCHIRAJU & SHIVA RAJGOPAL

*PARTS OF STATA CODE AND DESCRIPTION TO REPLICATE MAIN RESULTS - TABLE 3-6

****************************************************************************************************************

************************************************************************************************************
* STEP 1: GENERATE SAMPLE FOR THE RDD ANALYSIS 
*The input dataset "acctdata" contains accountnig data for all firms with non-missing data on total assets, 
*sales, net income, book value of equity, and market capitalization
*************************************************************************************************************

/*use acctdata

gen affected = 0
gen affected1 = 0
replace affected1 = 1 if pat >= 50
gen affected2 = 0
replace affected2 = 1 if bv >= 5000
gen affected3 = 0
replace affected3 = 1 if sale >= 10000
replace affected = 1 if affected1 == 1
replace affected = 1 if affected2 == 1
replace affected = 1 if affected3 == 1



gen bin1  = 0
replace bin1 = 1 if pat >= 25 & pat <= 75
gen bin2 = 0
replace bin2 = 1 if bv >= 2500 & bv <= 7500
gen bin3 = 0
replace bin3 = 1 if sales >= 5000 & sales <= 15000

gen rd_sample = 0
replace rd_sample = 1 if bin1 == 1
replace rd_sample = 1 if bin2 == 1
replace rd_sample = 1 if bin3 == 1


gen pat1 = (pat - 50)/50
gen bv1 = (bv - 5000)/5000
gen sales1 = (sales - 10000)/10000


gen m = 0
replace m = pat1 if affected1 == 1 & affected2 ==0 & affected3 == 0
replace m = bv1 if affected1 == 0 & affected2 ==1 & affected3 == 0
replace m = sales1 if affected1 == 0 & affected2 ==0 & affected3 == 1
replace m = min(pat1, bv1, sales1) if affected1 == 1 & affected2 ==1 & affected3 == 1
replace m = max(pat1, bv1, sales1) if affected1 == 0 & affected2 ==0 & affected3 == 0
replace m = min(pat1, bv1) if affected1 == 1 & affected2 ==1 & affected3 == 0
replace m = min(pat1, sales1) if affected1 == 1 & affected2 ==0 & affected3 ==1
replace m = min(bv1, sales1) if affected1 == 0 & affected2 ==1 & affected3 ==1
replace rd_sample = 0 if m > .5

keep if rd_sample == 1

save acctdata, replace


************************************************************************************************************
* STEP 2: GET STOCK RETURN DATA FOR THE RDD SAMPLE 
*CAR is calculated using the market model around the event dates identified in the paper. The CAR data is then 
*merged with accunting data using the unique key "CMIE COMPANY CODE" to create the final dataset "FINALDATA".
*************************************************************************************************************


**************************************************************************************************************
* STEP 3 - MAIN RESULTS
*The input dataset is "tables_3_6" contains CAR and accountnig data for the RDD sample
**************************************************************************************************************

**********************************************************************************************************
*GRAPHICAL ANALYSIS OF RDD - * FIGURE 3
**********************************************************************************************************
* This set of graphs will have scatter plot of the entire data in the background
*rd file needs to be installed */


cd "H:\Hariom\Research\Projects\8 Mandatory CSR\JAR\tables"

use tables_3_6

tab date, gen(event)

rd car3d m if  event1 == 1, p(1) gr 
rd car3d m if  event2 == 1, p(1) gr 
rd car3d m if  event3 == 1, p(1) gr 
rd car3d m if  event4 == 1, p(1) gr
rd car3d m if  event5 == 1, p(1) gr 
rd car3d m if  event6 == 1, p(1) gr 
rd car3d m if  event7 == 1, p(1) gr 
rd car3d m if  event8 == 1, p(1) gr 
* coefficients and z-stats are tabulated in table 4a

* this set of graphs will have bin averages. The number of bins are also reported
*rdplot file needs to be installed
rdplot car3d m if event1 == 1, h(1) p(3)
rdplot car3d m if event2 == 1, h(1) p(3)
rdplot car3d m if event3 == 1, h(1) p(3)
rdplot car3d m if event4 == 1, h(1) p(3)
rdplot car3d m if event5 == 1, h(1) p(3)
rdplot car3d m if event6 == 1, h(1) p(3)
rdplot car3d m if event7 == 1, h(1) p(3)
rdplot car3d m if event8 == 1, h(1) p(3)


**********************************************************************************************************
* TABLE 3 - UNIVARIATE TESTS
********************************************************************************************************** 

tabstat car3d if affected == 1,  by(date) stat(median)  col(stat)
tabstat car3d if affected == 0, by(date) stat(median)  col(stat)


tabstat car3d if affected == 1 , by(date) stat(median)  col(stat)
tabstat car3d if affected == 0 , by(date) stat(median)  col(stat)
 
signrank car3d = 0 if event1 == 1 & affected == 0 
signrank car3d = 0 if event1 == 1 & affected == 1 
ranksum car3d if event1 == 1, by(affected)


signrank car3d = 0 if event2 == 1 & affected == 0 
signrank car3d = 0 if event2 == 1 & affected == 1 
ranksum car3d if event2 == 1 , by(affected)


signrank car3d = 0 if event3 == 1 & affected == 0 
signrank car3d = 0 if event3 == 1 & affected == 1 
ranksum car3d if event3 == 1 , by(affected)


signrank car3d = 0 if event4 == 1 & affected == 0 
signrank car3d = 0 if event4 == 1 & affected == 1 
ranksum car3d if event4 == 1 , by(affected)


signrank car3d = 0 if event5 == 1 & affected == 0 
signrank car3d = 0 if event5 == 1 & affected == 1 
ranksum car3d if event5 == 1 , by(affected)


signrank car3d = 0 if event6 == 1 & affected == 0 
signrank car3d = 0 if event6 == 1 & affected == 1 
ranksum car3d if event6 == 1 , by(affected)


signrank car3d = 0 if event7 == 1 & affected == 0 
signrank car3d = 0 if event7 == 1 & affected == 1 
ranksum car3d if event7 == 1 , by(affected)


signrank car3d = 0 if event8 == 1 & affected == 0 
signrank car3d = 0 if event8 == 1 & affected == 1 
ranksum car3d if event8 == 1 , by(affected)


**********************************************************************************************************
* TABLE 4 - DISCONTINUITY DESIGN - NONPARAMETRIC ESTIMATES
* RDROBUST ROUTINES of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

* Panel A - CAR as a linear function of M

rdrobust car3d m if event1 == 1, p(1) bwselect(ik)
rdrobust car3d m if event2 == 1, p(1) bwselect(ik)
rdrobust car3d m if event3 == 1, p(1) bwselect(ik)
rdrobust car3d m if event4 == 1, p(1) bwselect(ik)
rdrobust car3d m if event5 == 1, p(1) bwselect(ik)
rdrobust car3d m if event6 == 1, p(1) bwselect(ik)
rdrobust car3d m if event7 == 1, p(1) bwselect(ik)
rdrobust car3d m if event8 == 1, p(1) bwselect(ik)


* Panel B - CAR as a polynomial function of M
rdrobust car3d m if event1 == 1, h(1) p(3)
rdrobust car3d m if event2 == 1, h(1) p(3)
rdrobust car3d m if event3 == 1, h(1) p(3)
rdrobust car3d m if event4 == 1, h(1) p(3)
rdrobust car3d m if event5 == 1, h(1) p(3)
rdrobust car3d m if event6 == 1, h(1) p(3)
rdrobust car3d m if event7 == 1, h(1) p(3)
rdrobust car3d m if event8 == 1, h(1) p(3)


**********************************************************************************************************
* TABLE 5 - DISCONTINUITY DESIGN - MULTIPLE RUNNING VARIABLES - PARAMETRIC ESTIMATES WITH CONTROLS
* CLUSTER2 ROUTINE of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

local firm_controls size bm lev roa capex sgrowth cash bind big4 bg govt mnc xad political polluted

tab ffind, gen(ind)

gen affected_event1 = affected*event1
gen affected_event2 = affected*event2
gen affected_event3 = affected*event3
gen affected_event4 = affected*event4
gen affected_event5 = affected*event5
gen affected_event6 = affected*event6
gen affected_event7 = affected*event7
gen affected_event8 = affected*event8

gen affected_m = affected*m
gen m_p2 = m*m
gen m_p3 = m*m*m



cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1 event2-event8,  fcluster(coid) tcluster(date)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway 

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1  `firm_controls' ind1-ind38 event2-event8,  fcluster(coid) tcluster(date)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway

areg car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1  `firm_controls' event2-event8,  cluster(coid) absorb(coid)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway



**********************************************************************************************************
* TABLE 6 - CROSS SECTIONAL ANALYSIS  - RDD WITH PARAMETRIC ESTIMATES WITH CONTROLS
* CLUSTER2 ROUTINE of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

*  VARIATION BASED ON THE BUSINESS GROUP AFFILIATION
gen affected_event1_political = affected*event1*political
gen affected_event2_political = affected*event2*political
gen affected_event3_political = affected*event3*political
gen affected_event4_political = affected*event4*political
gen affected_event5_political = affected*event5*political
gen affected_event6_political = affected*event6*political
gen affected_event7_political = affected*event7*political
gen affected_event8_political = affected*event8*political

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_political affected_event2_political affected_event3_political affected_event4_political affected_event5_political affected_event6_political affected_event7_political affected_event8_political affected_m m m_p2 m_p3 pat1 bv1 sales1 event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_political + affected_event2_political + affected_event3_political + affected_event4_political + affected_event5_political + affected_event6_political + affected_event7_political + affected_event8_political = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway


* VARIATION BASED ON HIGH ADVERTISEMENT SPENDERS

gen affected_event1_ad = affected*event1*ad
gen affected_event2_ad = affected*event2*ad
gen affected_event3_ad = affected*event3*ad
gen affected_event4_ad = affected*event4*ad
gen affected_event5_ad = affected*event5*ad
gen affected_event6_ad = affected*event6*ad
gen affected_event7_ad = affected*event7*ad
gen affected_event8_ad = affected*event8*ad

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_ad affected_event2_ad affected_event3_ad affected_event4_ad affected_event5_ad affected_event6_ad affected_event7_ad affected_event8_ad affected_m m m_p2 m_p3 pat1 bv1 sales1  event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_ad + affected_event2_ad + affected_event3_ad + affected_event4_ad + affected_event5_ad + affected_event6_ad + affected_event7_ad + affected_event8_ad = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway



gen affected_event1_polluted = affected*event1*polluted
gen affected_event2_polluted = affected*event2*polluted
gen affected_event3_polluted = affected*event3*polluted
gen affected_event4_polluted = affected*event4*polluted
gen affected_event5_polluted = affected*event5*polluted
gen affected_event6_polluted = affected*event6*polluted
gen affected_event7_polluted = affected*event7*polluted
gen affected_event8_polluted = affected*event8*polluted

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_polluted affected_event2_polluted affected_event3_polluted affected_event4_polluted affected_event5_polluted affected_event6_polluted affected_event7_polluted affected_event8_polluted affected_m m m_p2 m_p3 pat1 bv1 sales1 event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_polluted + affected_event2_polluted + affected_event3_polluted + affected_event4_polluted + affected_event5_polluted + affected_event6_polluted + affected_event7_polluted + affected_event8_polluted = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway


***************************************************************************************************************************************************************

*************************************************************************************************************
*DOES CORPORATE SOCIAL RESPONSIBILITY (CSR) CREATE SHAREHOLDER VALUE? 
*EVIDENCE FROM THE INDIAN COMPANIES ACT 2013

*HARIOM MANCHIRAJU & SHIVA RAJGOPAL

*PARTS OF STATA CODE AND DESCRIPTION TO REPLICATE MAIN RESULTS - TABLE 3-6

****************************************************************************************************************

************************************************************************************************************
* STEP 1: GENERATE SAMPLE FOR THE RDD ANALYSIS 
*The input dataset "acctdata" contains accountnig data for all firms with non-missing data on total assets, 
*sales, net income, book value of equity, and market capitalization
*************************************************************************************************************

/*use acctdata

gen affected = 0
gen affected1 = 0
replace affected1 = 1 if pat >= 50
gen affected2 = 0
replace affected2 = 1 if bv >= 5000
gen affected3 = 0
replace affected3 = 1 if sale >= 10000
replace affected = 1 if affected1 == 1
replace affected = 1 if affected2 == 1
replace affected = 1 if affected3 == 1



gen bin1  = 0
replace bin1 = 1 if pat >= 25 & pat <= 75
gen bin2 = 0
replace bin2 = 1 if bv >= 2500 & bv <= 7500
gen bin3 = 0
replace bin3 = 1 if sales >= 5000 & sales <= 15000

gen rd_sample = 0
replace rd_sample = 1 if bin1 == 1
replace rd_sample = 1 if bin2 == 1
replace rd_sample = 1 if bin3 == 1


gen pat1 = (pat - 50)/50
gen bv1 = (bv - 5000)/5000
gen sales1 = (sales - 10000)/10000


gen m = 0
replace m = pat1 if affected1 == 1 & affected2 ==0 & affected3 == 0
replace m = bv1 if affected1 == 0 & affected2 ==1 & affected3 == 0
replace m = sales1 if affected1 == 0 & affected2 ==0 & affected3 == 1
replace m = min(pat1, bv1, sales1) if affected1 == 1 & affected2 ==1 & affected3 == 1
replace m = max(pat1, bv1, sales1) if affected1 == 0 & affected2 ==0 & affected3 == 0
replace m = min(pat1, bv1) if affected1 == 1 & affected2 ==1 & affected3 == 0
replace m = min(pat1, sales1) if affected1 == 1 & affected2 ==0 & affected3 ==1
replace m = min(bv1, sales1) if affected1 == 0 & affected2 ==1 & affected3 ==1
replace rd_sample = 0 if m > .5

keep if rd_sample == 1

save acctdata, replace


************************************************************************************************************
* STEP 2: GET STOCK RETURN DATA FOR THE RDD SAMPLE 
*CAR is calculated using the market model around the event dates identified in the paper. The CAR data is then 
*merged with accunting data using the unique key "CMIE COMPANY CODE" to create the final dataset "FINALDATA".
*************************************************************************************************************


**************************************************************************************************************
* STEP 3 - MAIN RESULTS
*The input dataset is "tables_3_6" contains CAR and accountnig data for the RDD sample
**************************************************************************************************************

**********************************************************************************************************
*GRAPHICAL ANALYSIS OF RDD - * FIGURE 3
**********************************************************************************************************
* This set of graphs will have scatter plot of the entire data in the background
*rd file needs to be installed */


cd "H:\Hariom\Research\Projects\8 Mandatory CSR\JAR\tables"

use tables_3_6

tab date, gen(event)

rd car3d m if  event1 == 1, p(1) gr 
rd car3d m if  event2 == 1, p(1) gr 
rd car3d m if  event3 == 1, p(1) gr 
rd car3d m if  event4 == 1, p(1) gr
rd car3d m if  event5 == 1, p(1) gr 
rd car3d m if  event6 == 1, p(1) gr 
rd car3d m if  event7 == 1, p(1) gr 
rd car3d m if  event8 == 1, p(1) gr 
* coefficients and z-stats are tabulated in table 4a

* this set of graphs will have bin averages. The number of bins are also reported
*rdplot file needs to be installed
rdplot car3d m if event1 == 1, h(1) p(3)
rdplot car3d m if event2 == 1, h(1) p(3)
rdplot car3d m if event3 == 1, h(1) p(3)
rdplot car3d m if event4 == 1, h(1) p(3)
rdplot car3d m if event5 == 1, h(1) p(3)
rdplot car3d m if event6 == 1, h(1) p(3)
rdplot car3d m if event7 == 1, h(1) p(3)
rdplot car3d m if event8 == 1, h(1) p(3)


**********************************************************************************************************
* TABLE 3 - UNIVARIATE TESTS
********************************************************************************************************** 

tabstat car3d if affected == 1,  by(date) stat(median)  col(stat)
tabstat car3d if affected == 0, by(date) stat(median)  col(stat)


tabstat car3d if affected == 1 , by(date) stat(median)  col(stat)
tabstat car3d if affected == 0 , by(date) stat(median)  col(stat)
 
signrank car3d = 0 if event1 == 1 & affected == 0 
signrank car3d = 0 if event1 == 1 & affected == 1 
ranksum car3d if event1 == 1, by(affected)


signrank car3d = 0 if event2 == 1 & affected == 0 
signrank car3d = 0 if event2 == 1 & affected == 1 
ranksum car3d if event2 == 1 , by(affected)


signrank car3d = 0 if event3 == 1 & affected == 0 
signrank car3d = 0 if event3 == 1 & affected == 1 
ranksum car3d if event3 == 1 , by(affected)


signrank car3d = 0 if event4 == 1 & affected == 0 
signrank car3d = 0 if event4 == 1 & affected == 1 
ranksum car3d if event4 == 1 , by(affected)


signrank car3d = 0 if event5 == 1 & affected == 0 
signrank car3d = 0 if event5 == 1 & affected == 1 
ranksum car3d if event5 == 1 , by(affected)


signrank car3d = 0 if event6 == 1 & affected == 0 
signrank car3d = 0 if event6 == 1 & affected == 1 
ranksum car3d if event6 == 1 , by(affected)


signrank car3d = 0 if event7 == 1 & affected == 0 
signrank car3d = 0 if event7 == 1 & affected == 1 
ranksum car3d if event7 == 1 , by(affected)


signrank car3d = 0 if event8 == 1 & affected == 0 
signrank car3d = 0 if event8 == 1 & affected == 1 
ranksum car3d if event8 == 1 , by(affected)


**********************************************************************************************************
* TABLE 4 - DISCONTINUITY DESIGN - NONPARAMETRIC ESTIMATES
* RDROBUST ROUTINES of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

* Panel A - CAR as a linear function of M

rdrobust car3d m if event1 == 1, p(1) bwselect(ik)
rdrobust car3d m if event2 == 1, p(1) bwselect(ik)
rdrobust car3d m if event3 == 1, p(1) bwselect(ik)
rdrobust car3d m if event4 == 1, p(1) bwselect(ik)
rdrobust car3d m if event5 == 1, p(1) bwselect(ik)
rdrobust car3d m if event6 == 1, p(1) bwselect(ik)
rdrobust car3d m if event7 == 1, p(1) bwselect(ik)
rdrobust car3d m if event8 == 1, p(1) bwselect(ik)


* Panel B - CAR as a polynomial function of M
rdrobust car3d m if event1 == 1, h(1) p(3)
rdrobust car3d m if event2 == 1, h(1) p(3)
rdrobust car3d m if event3 == 1, h(1) p(3)
rdrobust car3d m if event4 == 1, h(1) p(3)
rdrobust car3d m if event5 == 1, h(1) p(3)
rdrobust car3d m if event6 == 1, h(1) p(3)
rdrobust car3d m if event7 == 1, h(1) p(3)
rdrobust car3d m if event8 == 1, h(1) p(3)


**********************************************************************************************************
* TABLE 5 - DISCONTINUITY DESIGN - MULTIPLE RUNNING VARIABLES - PARAMETRIC ESTIMATES WITH CONTROLS
* CLUSTER2 ROUTINE of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

local firm_controls size bm lev roa capex sgrowth cash bind big4 bg govt mnc xad political polluted

tab ffind, gen(ind)

gen affected_event1 = affected*event1
gen affected_event2 = affected*event2
gen affected_event3 = affected*event3
gen affected_event4 = affected*event4
gen affected_event5 = affected*event5
gen affected_event6 = affected*event6
gen affected_event7 = affected*event7
gen affected_event8 = affected*event8

gen affected_m = affected*m
gen m_p2 = m*m
gen m_p3 = m*m*m



cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1 event2-event8,  fcluster(coid) tcluster(date)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway 

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1  `firm_controls' ind1-ind38 event2-event8,  fcluster(coid) tcluster(date)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway

areg car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1  `firm_controls' event2-event8,  cluster(coid) absorb(coid)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway



**********************************************************************************************************
* TABLE 6 - CROSS SECTIONAL ANALYSIS  - RDD WITH PARAMETRIC ESTIMATES WITH CONTROLS
* CLUSTER2 ROUTINE of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

*  VARIATION BASED ON THE BUSINESS GROUP AFFILIATION
gen affected_event1_political = affected*event1*political
gen affected_event2_political = affected*event2*political
gen affected_event3_political = affected*event3*political
gen affected_event4_political = affected*event4*political
gen affected_event5_political = affected*event5*political
gen affected_event6_political = affected*event6*political
gen affected_event7_political = affected*event7*political
gen affected_event8_political = affected*event8*political

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_political affected_event2_political affected_event3_political affected_event4_political affected_event5_political affected_event6_political affected_event7_political affected_event8_political affected_m m m_p2 m_p3 pat1 bv1 sales1 event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_political + affected_event2_political + affected_event3_political + affected_event4_political + affected_event5_political + affected_event6_political + affected_event7_political + affected_event8_political = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway


* VARIATION BASED ON HIGH ADVERTISEMENT SPENDERS

gen affected_event1_ad = affected*event1*ad
gen affected_event2_ad = affected*event2*ad
gen affected_event3_ad = affected*event3*ad
gen affected_event4_ad = affected*event4*ad
gen affected_event5_ad = affected*event5*ad
gen affected_event6_ad = affected*event6*ad
gen affected_event7_ad = affected*event7*ad
gen affected_event8_ad = affected*event8*ad

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_ad affected_event2_ad affected_event3_ad affected_event4_ad affected_event5_ad affected_event6_ad affected_event7_ad affected_event8_ad affected_m m m_p2 m_p3 pat1 bv1 sales1  event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_ad + affected_event2_ad + affected_event3_ad + affected_event4_ad + affected_event5_ad + affected_event6_ad + affected_event7_ad + affected_event8_ad = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway



gen affected_event1_polluted = affected*event1*polluted
gen affected_event2_polluted = affected*event2*polluted
gen affected_event3_polluted = affected*event3*polluted
gen affected_event4_polluted = affected*event4*polluted
gen affected_event5_polluted = affected*event5*polluted
gen affected_event6_polluted = affected*event6*polluted
gen affected_event7_polluted = affected*event7*polluted
gen affected_event8_polluted = affected*event8*polluted

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_polluted affected_event2_polluted affected_event3_polluted affected_event4_polluted affected_event5_polluted affected_event6_polluted affected_event7_polluted affected_event8_polluted affected_m m m_p2 m_p3 pat1 bv1 sales1 event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_polluted + affected_event2_polluted + affected_event3_polluted + affected_event4_polluted + affected_event5_polluted + affected_event6_polluted + affected_event7_polluted + affected_event8_polluted = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway


***************************************************************************************************************************************************************

*************************************************************************************************************
*DOES CORPORATE SOCIAL RESPONSIBILITY (CSR) CREATE SHAREHOLDER VALUE? 
*EVIDENCE FROM THE INDIAN COMPANIES ACT 2013

*HARIOM MANCHIRAJU & SHIVA RAJGOPAL

*PARTS OF STATA CODE AND DESCRIPTION TO REPLICATE MAIN RESULTS - TABLE 3-6

****************************************************************************************************************

************************************************************************************************************
* STEP 1: GENERATE SAMPLE FOR THE RDD ANALYSIS 
*The input dataset "acctdata" contains accountnig data for all firms with non-missing data on total assets, 
*sales, net income, book value of equity, and market capitalization
*************************************************************************************************************

/*use acctdata

gen affected = 0
gen affected1 = 0
replace affected1 = 1 if pat >= 50
gen affected2 = 0
replace affected2 = 1 if bv >= 5000
gen affected3 = 0
replace affected3 = 1 if sale >= 10000
replace affected = 1 if affected1 == 1
replace affected = 1 if affected2 == 1
replace affected = 1 if affected3 == 1



gen bin1  = 0
replace bin1 = 1 if pat >= 25 & pat <= 75
gen bin2 = 0
replace bin2 = 1 if bv >= 2500 & bv <= 7500
gen bin3 = 0
replace bin3 = 1 if sales >= 5000 & sales <= 15000

gen rd_sample = 0
replace rd_sample = 1 if bin1 == 1
replace rd_sample = 1 if bin2 == 1
replace rd_sample = 1 if bin3 == 1


gen pat1 = (pat - 50)/50
gen bv1 = (bv - 5000)/5000
gen sales1 = (sales - 10000)/10000


gen m = 0
replace m = pat1 if affected1 == 1 & affected2 ==0 & affected3 == 0
replace m = bv1 if affected1 == 0 & affected2 ==1 & affected3 == 0
replace m = sales1 if affected1 == 0 & affected2 ==0 & affected3 == 1
replace m = min(pat1, bv1, sales1) if affected1 == 1 & affected2 ==1 & affected3 == 1
replace m = max(pat1, bv1, sales1) if affected1 == 0 & affected2 ==0 & affected3 == 0
replace m = min(pat1, bv1) if affected1 == 1 & affected2 ==1 & affected3 == 0
replace m = min(pat1, sales1) if affected1 == 1 & affected2 ==0 & affected3 ==1
replace m = min(bv1, sales1) if affected1 == 0 & affected2 ==1 & affected3 ==1
replace rd_sample = 0 if m > .5

keep if rd_sample == 1

save acctdata, replace


************************************************************************************************************
* STEP 2: GET STOCK RETURN DATA FOR THE RDD SAMPLE 
*CAR is calculated using the market model around the event dates identified in the paper. The CAR data is then 
*merged with accunting data using the unique key "CMIE COMPANY CODE" to create the final dataset "FINALDATA".
*************************************************************************************************************


**************************************************************************************************************
* STEP 3 - MAIN RESULTS
*The input dataset is "tables_3_6" contains CAR and accountnig data for the RDD sample
**************************************************************************************************************

**********************************************************************************************************
*GRAPHICAL ANALYSIS OF RDD - * FIGURE 3
**********************************************************************************************************
* This set of graphs will have scatter plot of the entire data in the background
*rd file needs to be installed */


cd "H:\Hariom\Research\Projects\8 Mandatory CSR\JAR\tables"

use tables_3_6

tab date, gen(event)

rd car3d m if  event1 == 1, p(1) gr 
rd car3d m if  event2 == 1, p(1) gr 
rd car3d m if  event3 == 1, p(1) gr 
rd car3d m if  event4 == 1, p(1) gr
rd car3d m if  event5 == 1, p(1) gr 
rd car3d m if  event6 == 1, p(1) gr 
rd car3d m if  event7 == 1, p(1) gr 
rd car3d m if  event8 == 1, p(1) gr 
* coefficients and z-stats are tabulated in table 4a

* this set of graphs will have bin averages. The number of bins are also reported
*rdplot file needs to be installed
rdplot car3d m if event1 == 1, h(1) p(3)
rdplot car3d m if event2 == 1, h(1) p(3)
rdplot car3d m if event3 == 1, h(1) p(3)
rdplot car3d m if event4 == 1, h(1) p(3)
rdplot car3d m if event5 == 1, h(1) p(3)
rdplot car3d m if event6 == 1, h(1) p(3)
rdplot car3d m if event7 == 1, h(1) p(3)
rdplot car3d m if event8 == 1, h(1) p(3)


**********************************************************************************************************
* TABLE 3 - UNIVARIATE TESTS
********************************************************************************************************** 

tabstat car3d if affected == 1,  by(date) stat(median)  col(stat)
tabstat car3d if affected == 0, by(date) stat(median)  col(stat)


tabstat car3d if affected == 1 , by(date) stat(median)  col(stat)
tabstat car3d if affected == 0 , by(date) stat(median)  col(stat)
 
signrank car3d = 0 if event1 == 1 & affected == 0 
signrank car3d = 0 if event1 == 1 & affected == 1 
ranksum car3d if event1 == 1, by(affected)


signrank car3d = 0 if event2 == 1 & affected == 0 
signrank car3d = 0 if event2 == 1 & affected == 1 
ranksum car3d if event2 == 1 , by(affected)


signrank car3d = 0 if event3 == 1 & affected == 0 
signrank car3d = 0 if event3 == 1 & affected == 1 
ranksum car3d if event3 == 1 , by(affected)


signrank car3d = 0 if event4 == 1 & affected == 0 
signrank car3d = 0 if event4 == 1 & affected == 1 
ranksum car3d if event4 == 1 , by(affected)


signrank car3d = 0 if event5 == 1 & affected == 0 
signrank car3d = 0 if event5 == 1 & affected == 1 
ranksum car3d if event5 == 1 , by(affected)


signrank car3d = 0 if event6 == 1 & affected == 0 
signrank car3d = 0 if event6 == 1 & affected == 1 
ranksum car3d if event6 == 1 , by(affected)


signrank car3d = 0 if event7 == 1 & affected == 0 
signrank car3d = 0 if event7 == 1 & affected == 1 
ranksum car3d if event7 == 1 , by(affected)


signrank car3d = 0 if event8 == 1 & affected == 0 
signrank car3d = 0 if event8 == 1 & affected == 1 
ranksum car3d if event8 == 1 , by(affected)


**********************************************************************************************************
* TABLE 4 - DISCONTINUITY DESIGN - NONPARAMETRIC ESTIMATES
* RDROBUST ROUTINES of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

* Panel A - CAR as a linear function of M

rdrobust car3d m if event1 == 1, p(1) bwselect(ik)
rdrobust car3d m if event2 == 1, p(1) bwselect(ik)
rdrobust car3d m if event3 == 1, p(1) bwselect(ik)
rdrobust car3d m if event4 == 1, p(1) bwselect(ik)
rdrobust car3d m if event5 == 1, p(1) bwselect(ik)
rdrobust car3d m if event6 == 1, p(1) bwselect(ik)
rdrobust car3d m if event7 == 1, p(1) bwselect(ik)
rdrobust car3d m if event8 == 1, p(1) bwselect(ik)


* Panel B - CAR as a polynomial function of M
rdrobust car3d m if event1 == 1, h(1) p(3)
rdrobust car3d m if event2 == 1, h(1) p(3)
rdrobust car3d m if event3 == 1, h(1) p(3)
rdrobust car3d m if event4 == 1, h(1) p(3)
rdrobust car3d m if event5 == 1, h(1) p(3)
rdrobust car3d m if event6 == 1, h(1) p(3)
rdrobust car3d m if event7 == 1, h(1) p(3)
rdrobust car3d m if event8 == 1, h(1) p(3)


**********************************************************************************************************
* TABLE 5 - DISCONTINUITY DESIGN - MULTIPLE RUNNING VARIABLES - PARAMETRIC ESTIMATES WITH CONTROLS
* CLUSTER2 ROUTINE of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

local firm_controls size bm lev roa capex sgrowth cash bind big4 bg govt mnc xad political polluted

tab ffind, gen(ind)

gen affected_event1 = affected*event1
gen affected_event2 = affected*event2
gen affected_event3 = affected*event3
gen affected_event4 = affected*event4
gen affected_event5 = affected*event5
gen affected_event6 = affected*event6
gen affected_event7 = affected*event7
gen affected_event8 = affected*event8

gen affected_m = affected*m
gen m_p2 = m*m
gen m_p3 = m*m*m



cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1 event2-event8,  fcluster(coid) tcluster(date)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway 

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1  `firm_controls' ind1-ind38 event2-event8,  fcluster(coid) tcluster(date)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway

areg car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_m m m_p2 m_p3 pat1 bv1 sales1  `firm_controls' event2-event8,  cluster(coid) absorb(coid)
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = 0
test  affected_event1 + affected_event2 + affected_event3 + affected_event4 + affected_event5 + affected_event6 + affected_event7 + affected_event8 = -.014
outreg2 using t5.xls,  stats( coef  tstat)  aster paren dec(3) sideway



**********************************************************************************************************
* TABLE 6 - CROSS SECTIONAL ANALYSIS  - RDD WITH PARAMETRIC ESTIMATES WITH CONTROLS
* CLUSTER2 ROUTINE of STATA NEED TO BE INSTALLED BEFORE RUNNING THIS PART OF THE CODE

**********************************************************************************************************

*  VARIATION BASED ON THE BUSINESS GROUP AFFILIATION
gen affected_event1_political = affected*event1*political
gen affected_event2_political = affected*event2*political
gen affected_event3_political = affected*event3*political
gen affected_event4_political = affected*event4*political
gen affected_event5_political = affected*event5*political
gen affected_event6_political = affected*event6*political
gen affected_event7_political = affected*event7*political
gen affected_event8_political = affected*event8*political

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_political affected_event2_political affected_event3_political affected_event4_political affected_event5_political affected_event6_political affected_event7_political affected_event8_political affected_m m m_p2 m_p3 pat1 bv1 sales1 event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_political + affected_event2_political + affected_event3_political + affected_event4_political + affected_event5_political + affected_event6_political + affected_event7_political + affected_event8_political = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway


* VARIATION BASED ON HIGH ADVERTISEMENT SPENDERS

gen affected_event1_ad = affected*event1*ad
gen affected_event2_ad = affected*event2*ad
gen affected_event3_ad = affected*event3*ad
gen affected_event4_ad = affected*event4*ad
gen affected_event5_ad = affected*event5*ad
gen affected_event6_ad = affected*event6*ad
gen affected_event7_ad = affected*event7*ad
gen affected_event8_ad = affected*event8*ad

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_ad affected_event2_ad affected_event3_ad affected_event4_ad affected_event5_ad affected_event6_ad affected_event7_ad affected_event8_ad affected_m m m_p2 m_p3 pat1 bv1 sales1  event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_ad + affected_event2_ad + affected_event3_ad + affected_event4_ad + affected_event5_ad + affected_event6_ad + affected_event7_ad + affected_event8_ad = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway



gen affected_event1_polluted = affected*event1*polluted
gen affected_event2_polluted = affected*event2*polluted
gen affected_event3_polluted = affected*event3*polluted
gen affected_event4_polluted = affected*event4*polluted
gen affected_event5_polluted = affected*event5*polluted
gen affected_event6_polluted = affected*event6*polluted
gen affected_event7_polluted = affected*event7*polluted
gen affected_event8_polluted = affected*event8*polluted

cluster2 car3d  affected_event1 affected_event2 affected_event3 affected_event4 affected_event5 affected_event6 affected_event7 affected_event8 affected_event1_polluted affected_event2_polluted affected_event3_polluted affected_event4_polluted affected_event5_polluted affected_event6_polluted affected_event7_polluted affected_event8_polluted affected_m m m_p2 m_p3 pat1 bv1 sales1 event1-event8 `firm_controls' ind1-ind38,  fcluster(coid) tcluster(date)
test affected_event1_polluted + affected_event2_polluted + affected_event3_polluted + affected_event4_polluted + affected_event5_polluted + affected_event6_polluted + affected_event7_polluted + affected_event8_polluted = 0
outreg2 using t6.xls,  stats( coef  tstat)  aster paren dec(3) sideway


***************************************************************************************************************************************************************

brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 323kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall