This file contains three SAS programs: 1. Data_Construction_Independence_Variables. 2. Data_Construction_Execucomp_Variables. 3. Data_Analysis You can cut and paste each of the programs into SAS /************************************************************************************************************* /************************************************************************************************************* /************************************************************************************************************* /************************************************************************************************************* 1. Data_construction_independence_Variables: /************************************************************************************************************* This program converts the IRRC database (year 2002) to the board_independence database Files: gvkey_id - a file with the list of all firms that exist in the IRRC database with 6 years of data (2000-2005). The list consists of 941 firms. To each id we manually matched a GVKEY. Available to download. irrc2002 - original database from IRRC for the year 2002 - needs to be downloaded from WRDS (We use the WRDS version which has new names of variables compared to the old database. We choose the WRDS version to allow researchers to replicate the results more easily) director_Independence - temporary file which contains modified independence definition for each director. board_independence - file which contains the following variables for the regressions: maj_ind - equals 1 if the firm has a majority of independent directors in 2002 and 0 otherwise. ind_com - equals 1 if the firm has an independent compensation committee in 2002 and 0 otherwise. ind_nom - equals 1 if the firm has an independent nominating committee in 2002 and 0 otherwise. block_director - equals 1 if the firm has a non employee director who holds more than 5% of the voting rights (pcnt_ctrl_votingpower>0.05) and 0 otherwise. ***************************************************************************************************************/ LIBNAME x 'F:/data/online appendix/'; /*********************************************/ PROC SORT DATA=x.gvkey_id;BY legacy_pps_id; PROC SORT DATA=x.irrc2002;BY legacy_pps_id; DATA irrc2002_gvkey; MERGE x.gvkey_id (IN=in1) x.irrc2002 (IN=in2);BY legacy_pps_id;IF in1 AND in2; DATA director_independence (KEEP = gvkey ind comp_mbr nom_mbr ind_comp_mbr ind_nom_mbr non_employee_holdings non_employee_voting); SET irrc2002_gvkey; /*initializing indicator variables*/ ind=0;ind_comp=0;ind_nom=0;comp_mbr=0;nom_mbr=0;ind_comp=0;ind_nom=0;non_employee_holdings=0; /*Using IRRC Definition of independence*/ IF classification="I" THEN ind=1; /***************************************************************************************************************/ /*IF the manager is a former employee AND three or more years have passed since employment THEN treat seperately. There are five directors in 2002 who are former employees with no other affiliation but the year of termination is not provided by IRRC. We checked the proxy statements whether they left before 2000. These are Ronald Cosgrave from Alaska Airline (GVKEY 001230 Legacy_director_id 32453) - retired before 2000 Stephen Purdom from AFLAC (GVKEY 001449 Legacy_director_id 31974) - retired in 2001 Thomas Salis from Waters (GVKEY 061574 Legacy_director_id 47706) - retired before 2000 Edward Conard from Waters (GVKEY 061574 Legacy_director_id 47703) - retired before 2000 Bernard Myerson from Loews (GVKEY 006781 Legacy_director_id 32208) - retired before 2000 */ /***************************************************************************************************************/ IF gvkey="001230" AND legacy_director_id=32453 THEN year_of_termination=0; IF gvkey="001449" AND legacy_director_id=31974 THEN year_of_termination=2001; IF gvkey="061574" AND legacy_director_id=47706 THEN year_of_termination=0; IF gvkey="061574" AND legacy_director_id=47703 THEN year_of_termination=0; IF gvkey="006781" AND legacy_director_id=32208 THEN year_of_termination=0; IF (Classification="L" AND Former_Employee_YN=1 AND year_of_termination<2000) THEN DO; ind=1; IF (prof_services_yn=1 or business_transaction=1 or relative_yn=1 or designated=1 or interlocking=1 or charity=1 or otherlink=1) THEN ind=0; END; IF comp_membership=1 THEN comp_mbr=1; IF nom_membership=1 THEN nom_mbr=1; ind_comp_mbr=comp_mbr*ind; ind_nom_mbr=nom_mbr*ind; /******************************************************************************************************************/ /*There is one director whose pcnt_ctrl_votingpower variable is missing. This is Robert J Torcolini from Carpenter Technology(GVKEY 002787 Legacy_director_id 73004). This director is an employee of the company and therefore is not considered a director blockholder by definition. /******************************************************************************************************************/ non_employee_voting=pcnt_ctrl_votingpower;IF Classification="E" THEN non_employee_voting=0; PROC SORT DATA=director_independence;BY gvkey; PROC MEANS DATA=Director_Independence NOPRINT; OUTPUT OUT=temp SUM(comp_mbr nom_mbr ind_nom_mbr ind_comp_mbr ind) = scom_mbr snom_mbr sind_nom sind_com sind MAX(non_employee_voting)=max_non_employee_voting; BY gvkey; DATA x.board_independence (KEEP=gvkey maj_ind ind_com ind_nom director_blockholder no_director_blockholder); SET temp; maj_ind=0;ind_com=0;ind_nom=0; board_size=_freq_;ind_fraction=sind/board_size; IF scom_mbr>0 AND scom_mbr=sind_com THEN ind_com=1; IF snom_mbr>0 AND snom_mbr=sind_nom THEN ind_nom=1; IF ind_fraction>0.5 THEN maj_ind=1; block_director=max_non_employee_voting; no_director_blockholder=0; IF block_director<=0.05 THEN no_director_blockholder=1; director_blockholder=1-no_director_blockholder; RUN; /************************************************************************************************************* /************************************************************************************************************* /************************************************************************************************************* /************************************************************************************************************* 2. Data_Construction_Execucomp_Variables. /*******************************************************************************************************/ /* This program computes the compensation and control variables to be used in the analysis /* /* File names: /* x.executive contains the following execucomp variables for each of the executives in execucomp: /* gvkey, year, tdc1, options, becameceo, ceoann, co_per_rol /* /* x.financial contains the following execucomp variables /* gvkey, year, sales, tsr1yr (1-year shareholder return), roa /*******************************************************************************************************/ LIBNAME x 'F:/DATA/online appendix/'; PROC SORT DATA=x.executive;BY gvkey year; PROC SORT DATA=x.financial;BY gvkey year; DATA x.execucomp9205; merge x.executive x.financial;BY gvkey year; if year<2006; /************************************************************************/ /* Keeping only CEOs, and computing the tenure variable for each of them /************************************************************************/ PROC SORT DATA=x.execucomp9205;BY gvkey year co_per_rol;run; DATA ceo_data (KEEP = gvkey coname tdc1 option_awards_blk_value bonus salary sic year tenure roa trs1yr sales co_per_rol); SET x.execucomp9205; IF co_per_rol~=lag(co_per_rol); IF ceoann="CEO"; if becameceo~=. then tenure=year-year(becameceo); DATA x.main_variables_m0; set ceo_data; /********************************************************/ /*Inflation adjustment and adding 48 fama french dummies*/ /*base year=2002 */ /********************************************************/ if year = 1993 then do;tdcinf=tdc1*1.2450;salesinf=sales*1.2450;optionsinf=option_awards_blk_value*1.2450;end; if year = 1994 then do;tdcinf=tdc1*1.2139;salesinf=sales*1.2139;optionsinf=option_awards_blk_value*1.2139;end; if year = 1995 then do;tdcinf=tdc1*1.1804;salesinf=sales*1.1804;optionsinf=option_awards_blk_value*1.1804;end; if year = 1996 then do;tdcinf=tdc1*1.1466;salesinf=sales*1.1466;optionsinf=option_awards_blk_value*1.1466;end; if year = 1997 then do;tdcinf=tdc1*1.1209;salesinf=sales*1.1209;optionsinf=option_awards_blk_value*1.1209;end; if year = 1998 then do;tdcinf=tdc1*1.1037;salesinf=sales*1.1037;optionsinf=option_awards_blk_value*1.1037;end; if year = 1999 then do;tdcinf=tdc1*1.0798;salesinf=sales*1.0798;optionsinf=option_awards_blk_value*1.0798;end; if year = 2000 then do;tdcinf=tdc1*1.0447;salesinf=sales*1.0447;optionsinf=option_awards_blk_value*1.0447;end; if year = 2001 then do;tdcinf=tdc1*1.0158;salesinf=sales*1.0158;optionsinf=option_awards_blk_value*1.0158;end; if year = 2002 then do;salesinf=sales;tdcinf=tdc1;optionsinf=option_awards_blk_value;end; if year = 2003 then do;salesinf=sales*0.9842;tdcinf=tdc1*0.9842;optionsinf=option_awards_blk_value*0.9842;end; if year = 2004 then do;salesinf=sales*0.9621;tdcinf=tdc1*0.9621;optionsinf=option_awards_blk_value*0.9621;end; if year = 2005 then do;salesinf=sales*0.9368;tdcinf=tdc1*0.9368;optionsinf=option_awards_blk_value*0.9368;end; if tdcinf>0 then ltdc=log(tdcinf); if salesinf>0 then lsales=log(salesinf); if roa>-100 then lroa=log(1+roa/100); if trs1yr>-100 then lret=log(1+trs1yr/100); if tenure>-2 then ltenure=log(2+tenure);/*The tenure variable is 2+tenure instead of 1+tenure to allow for cases where the CEO entered in calendar year>fiscal year end*/ /*Adding Fama-French indusry definition*/ *1. AGRICULTURE; if ((100<=sic<=199) | (200<=sic<=299) | (700<=sic<=799) | (910<=sic<=919) | sic = 2048) then do; ind=1 ; end; *2. FOOD PRODUCTS; else if ((2000<=sic<=2009) | (2010<=sic<=2019) | (2020<=sic<=2029) | (2030<=sic<=2039) | (2040<=sic<=2046) | (2050<=sic<=2059) | (2060<=sic<=2063) | (2070<=sic<=2079) | (2090<=sic<=2092) | (2095<=sic<=2095) | (2098<=sic<=2099)) then do; ind=2 ; end; *3. CANDY & SODA; else if ((2064<=sic<=2068) | (2086<=sic<=2087) | (2096<=sic<=2097)) then do; ind=3 ; end; *4. BEER & LIQUOR; else if sic in (2080,2082,2083,2084,2085)then do; ind=4 ; end; *5. TOBACCO PRODUCTS; else if (2100 <= sic <= 2199) then do; ind=5 ; end; *6. TOYS AND RECREATION; else if ((920<=sic<=999) | (3650<=sic<=3652) | (sic=3732) | (3930<=sic<=3931) | (3940<=sic<=3949)) then do; ind=6 ; end; *7. FUN AND ENTERTAINMENT; else if ((7800<=sic<=7829) | (7830<=sic<=7833) | (7840<=sic<=7841) | (sic=7900) | (7910<=sic<=7911) |(7920<=sic<=7929) | (7930<=sic<=7933) | (7940<=sic<=7949) |(sic=7980) | (7990<=sic<=7999)) then do; ind=7 ; end; *8. BOOKS; else if ((2700<=sic<=2749) | (2770<=sic<=2771) | (2780<=sic<=2789) | (2790<=sic<=2799)) then do; ind=8 ; end; *9. CONSUMER GOODS; else if ((sic=2047) | (2391<=sic<=2392) | (2510<=sic<=2519) | (2590<=sic<=2599) | (2840<=sic<=2844) |(3160<=sic<=3161) | (3170<=sic<=3172) | (3190<=sic<=3199) |(sic=3260) | (sic = 3229)| (3262<=sic<=3263) |(sic=3269) | (3230<=sic<=3231) | (3630<=sic<=3639) |(3750<=sic<=3751) | (sic=3800) |(3860<=sic<=3861) | (3870<=sic<=3873) | (3910<=sic<=3911) |(3914<=sic<=3915) |(3960<=sic<=3962) | (sic=3991) | (sic=3995)) then do; ind=9 ; end; *10. APPAREL; else if ((2300<=sic<=2390) | (3020<=sic<=3021) | (3100<=sic<=3111) | (3130<=sic<=3131) | (3140<=sic<=3151) |(3963<=sic<=3965)) then do; ind=10 ; end; *11. HEALTHCARE; else if (8000<=sic<=8099) then do; ind=11 ; end; *12. MEDICAL EQUIPMENT; else if ((sic=3693) | (3840<=sic<=3849) | (3850<=sic<=3851)) then do; ind=12 ; end; *13. PHARMACEUTICAL PRODUCTS; else if ((2830<=sic<=2831) | (2833<=sic<=2836)) then do; ind=13 ; end; *14. CHEMICALS; else if ((2800<=sic<=2829) | (2850<=sic<=2879) | (2890<=sic<=2899)) then do; ind=14 ; end; *15. RUBBER AND PLASTIC PRODUCTS; else if ((sic in (3031,3041,3050,3051,3052,3053)) | (3060<=sic<=3099)) then do; ind=15 ; end; *16. TEXTILES; else if ((2200<=sic<=2284) | (2290<=sic<=2295) | (2297<=sic<=2299) | (2393<=sic<=2395) | (2397<=sic<=2399)) then do; ind=16 ; end; *17. CONSTRUCTION MATERIALS; else if ((800<=sic<=899) | (2400<=sic<=2439) | (2450<=sic<=2459) | (2490<=sic<=2499) | (2660<=sic<=2661) |(2950<=sic<=2952) | (sic=3200) | (3210<=sic<=3211) | (3240<=sic<=3241) | (3250<=sic<=3259) |(sic=3261) |(sic=3264) |(3270<=sic<=3275) | (3280<=sic<=3281) | (3290<=sic<=3293) | (3295<=sic<=3299) |(3420<=sic<=3433) | (3440<=sic<=3442) | (sic in (3446,3448,3449)) | (3450<=sic<=3452) | (3490<=sic<=3499) |(sic=3996)) then do; ind=17 ; end; *18. CONSTRUCTION; else if ((1500<=sic<=1511) | (1520<=sic<=1549) | (1600<=sic<=1799)) then do; ind=18 ; end; *19. STEEL WORKS ETC; else if ((sic=3300) | (3310<=sic<=3317) | (3320<=sic<=3325) | (3330<=sic<=3341) |(3350<=sic<=3357) | (3360<=sic<=3369) | (3370<=sic<=3379) | (3390<=sic<=3399)) then do; ind=19 ; end; *20. FABRICATED PRODUCTS; else if ((sic in (3400,3443,3444)) | (3460<=sic<=3479)) then do; ind=20 ; end; *21. MACHINERY; else if ((3510<=sic<=3536) | (sic = 3538) | (3540<=sic<=3569) | (3580<=sic<=3582) | (3585<=sic<=3586) | (3589<=sic<=3599)) then do; ind=21 ; end; *22. ELECTRICAL EQUIPMENT; else if ((sic = 3600) | (3610<=sic<=3613) | (3620<=sic<=3621) | (3623<=sic<=3629) | (3640<=sic<=3646) | (3648<=sic<=3649) | (sic in (3660,3690,3691,3692,3699))) then do; ind=22 ; end; *23. AUTOMOBILES AND TRUCKS; else if (sic in (2296,2396,3010,3011,3537,3647,3694,3700,3710,3711,3713,3714,3715,3716,3792,3790,3791,3799)) then do; ind=23 ; end; *24. AIRCRAFT; else if ((3720<=sic<=3721) | (3723<=sic<=3725) | (3728<=sic<=3729)) then do; ind=24 ; end; *25. SHIPBUILDING, RAILROAD EQUIPMENT; else if ((3730<=sic<=3731) | (3740<=sic<=3743)) then do; ind=25 ; end; *26. DEFENSE; else if ((3760<=sic<=3769) | (sic=3795) | (3480<=sic<=3489)) then do; ind=26 ; end; *27. PRECIOUS METALS; else if (1040<=sic<=1049) then do; ind=27 ; end; *28. NON-METALLIC AND ind=USTRIAL METAL MINING; else if ((1000<=sic<=1039) | (1050<=sic<=1119) | (1400<=sic<=1499)) then do; ind=28 ; end; *29. COAL; else if (1200<=sic<=1299) then do; ind=29 ; end; *30. PETROLEUM AND NATURAL GAS; else if ((sic=1300) | (1310<=sic<=1339) | (1370<=sic<=1382) | (sic=1389) | (2900<=sic<=2912) | (2990<=sic<=2999)) then do; ind=30 ; end; *31. UTILITIES; else if ((sic = 4900) | (4910<=sic<=4911) | (4920<=sic<=4925) | (4930<=sic<=4932) | (4939<=sic<=4942)) then do; ind=31 ; end; *32. COMMUNICATION; else if ((sic = 4800) | (4810<=sic<=4813) | (4820<=sic<=4822) | (4830<=sic<=4841) | (4880<=sic<=4892) | (sic = 4899)) then do; ind=32 ; end; *33. PERSONAL SERVICES; else if ((7020<=sic<=7021) | (7030<=sic<=7033) | (sic=7200) | (7210<=sic<=7212) | (7214<=sic<=7217) |(7219<=sic<=7221) | (7230<=sic<=7231) | (7230<=sic<=7231) | (7240<=sic<=7241) | (7250<=sic<=7251) |(7260<=sic<=7269) | (7270<=sic<=7290) | (7291<=sic<=7299) | (sic in (7395,7500)) | (7520<=sic<=7549) |(sic in (7600,7620,7622,7623,7629,7630,7631,7640,7641)) |(7690<=sic<=7699) | (8100<=sic<=8499) |(8600<=sic<=8699) | (8800<=sic<=8899)) then do; ind=33 ; end; *34. BUSINESS SERVICES; else if ((2750<=sic<=2759) | (sic in (3993,7218,7300,7399,8700)) | (7310<=sic<=7342) | (7349<=sic<=7353) |(7359<=sic<=7372) | (7374<=sic<=7385) | (7389<=sic<=7394) | (7396<=sic<=7397) | (7510<=sic<=7519) |(8710<=sic<=8713) | (8720<=sic<=8721) | (8730<=sic<=8734) | (8740<=sic<=8748) | (8900<=sic<=8911) |(8920<=sic<=8999)) then do; ind=34 ; end; *35. COMPUTERS; else if ((3570<=sic<=3579) | (3680<=sic<=3689) | (sic in (3695,7373))) then do; ind=35 ; end; *36. ELECTRONIC EQUIPMENT; else if ((3661<=sic<=3666) | (sic in (3622,3810,3812)) | (3669<=sic<=3679)) then do; ind=36 ; end; *37. MEASURING AND CONTROL EQUIPMENT; else if ((3820<=sic<=3827) | (sic=3811) | (3829<=sic<=3839)) then do; ind=37 ; end; *38. BUSINESS SUPPLIES; else if ((2520<=sic<=2549) | (2600<=sic<=2639) | (2670<=sic<=2699) | (2760<=sic<=2761) | (3950<=sic<=3955)) then do; ind=38 ; end; *39. SHIPPING CONTAINERS; else if ((2440<=sic<=2449) | (2640<=sic<=2659) | (3220<=sic<=3221) | (3410<=sic<=3412)) then do; ind=39 ; end; *40. TRANSPORTATION; else if ((4000<=sic<=4013) | (4040<=sic<=4049) | (sic in (4100,4780,4789)) | (4110<=sic<=4121) | (4130<=sic<=4031) | (4140<=sic<=4142) | (4150<=sic<=4151) | (4170<=sic<=4173) | (4190<=sic<=4200) | (4210<=sic<=4231) | (4240<=sic<=4249) | (4400<=sic<=4700) | (4710<=sic<=4712) | (4720<=sic<=4749) | (4782<=sic<=4785)) then do; ind=40 ; end; *41. WHOLESALE; else if ((sic=5000) | (5010<=sic<=5015) | (5020<=sic<=5023) | (5030<=sic<=5060) | (5063<=sic<=5065) | (5070<=sic<=5078) | (5080<=sic<=5088) | (5090<=sic<=5094) | (5099<=sic<=5100) | (5110<=sic<=5113) | (5120<=sic<=5122) | (5130<=sic<=5172) | (5180<=sic<=5182) | (5190<=sic<=5199)) then do; ind=41 ; end; *42. RETAIL; else if ((sic in (5200,5300,5320,5334,5400,5900,5999)) | (5210<=sic<=5231) | (5250<=sic<=5251) | (5260<=sic<=5261) | (5270<=sic<=5271) | (5310<=sic<=5311) | (5330<=sic<=5331) | (5340<=sic<=5349) | (5390<=sic<=5399) | (5410<=sic<=5412) | (5420<=sic<=5469) | (5490<=sic<=5500) | (5510<=sic<=5579) | (5590<=sic<=5700) | (5710<=sic<=5722) | (5730<=sic<=5736) | (5750<=sic<=5799) | (5910<=sic<=5912) | (5920<=sic<=5932) | (5940<=sic<=5990) | (5992<=sic<=5995)) then do; ind=42 ; end; *43. RESTAURANTS, HOTELS, MOTELS; else if ((sic in (7000,7213)) | (5800<=sic<=5829) | (5890<=sic<=5899) | (7010<=sic<=7019) | (7040<=sic<=7049)) then do; ind=43 ; end; *44. BANKING; else if ((sic = 6000) | (6010<=sic<=6036) | (6040<=sic<=6062) | (6080<=sic<=6082) | (6090<=sic<=6100) | (6110<=sic<=6113) | (6120<=sic<=6179) | (6190<=sic<=6199)) then do; ind=44 ; end; *45. INSURANCE; else if ((sic = 6300) | (6310<=sic<=6331) | (6350<=sic<=6351) | (6360<=sic<=6361) | (6370<=sic<=6379) | (6390<=sic<=6399) | (6400<=sic<=6411)) then do; ind=45 ; end; *46. REAL ESTATE; else if ((sic in (6500,6510)) | (6512<=sic<=6515) | (6517<=sic<=6532) | (6540<=sic<=6541) | (6550<=sic<=6553) | (6590<=sic<=6599) | (6610<=sic<=6611)) then do; ind=46 ; end; *47. TRADING; else if ((6200<=sic<=6299) | (sic=6700) | (6710<=sic<=6725) | (6730<=sic<=6733) | (6740<=sic<=6779) | (6790<=sic<=6795) | (6798<=sic<=6799)) then do; ind=47 ; end; *48. MISCELLANEOUS; else if ((3992<=sic<=2994) | (sic=3990) | (3997<=sic<=3999) | (4950<=sic<=4961) | (4970<=sic<=4971) | (4990<=sic<=4991) | (9900<=sic<=9999)) then do; ind=48 ; end; /********************************************/ /********************************************/ /********************************************/ /*Adding lagged variables for roa and return*/ DATA x.main_variables_m1 (keep=gvkey year lretm1 lroam1); set x.main_variables; year=year+1; lretm1=lret; lroam1=lroa; PROC SORT DATA=x.main_variables_m1;BY gvkey year; PROC SORT DATA=x.main_variables_m0;BY gvkey year; DATA x.main_variables; MERGE x.main_variables_m1 x.main_variables_m0 (IN=in1); BY gvkey year;IF in1; RUN; /************************************************************************************************************* /************************************************************************************************************* /************************************************************************************************************* /************************************************************************************************************* 3. Data_Analysis /*******************************************************************************************************/ /*This program produces the final database for the analysis in Chhaochharia and Grinstein (2009). */ /* The final database is called x.analysis_balanced and contains 824 firm observations. */ /*******************************************************************************************************/ LIBNAME x 'F:/DATA/online appendix/'; PROC SORT DATA=x.main_variables;BY gvkey year; PROC SORT DATA=x.board_independence;BY gvkey; DATA x.analysis; MERGE x.main_variables (IN=in1) x.board_independence (IN=in2);BY gvkey;IF in1 AND in2; /***********************************************************************************/ /*Note: the following line is for balancing firms for the years 2000-2005. To */ /*perform the analysis over the period 1996-2005 one needs to make two adjustments:*/ /*a. change the line below to: "IF year>1995" */ /*b. change line 51 from "IF _freq_=6" to "IF _freq_=10" */ /***********************************************************************************/ IF year>1999; /***********************************************************************************/ /* Constructing additional variables for the analysis */ /***********************************************************************************/ flag_majperiod1=0;flag_indnomperiod1=0;flag_indcomperiod1=0; IF year>2002 and maj_ind=0 THEN flag_majperiod1=1; IF year>2002 and ind_nom=0 THEN flag_indnomperiod1=1; IF year>2002 and ind_com=0 THEN flag_indcomperiod1=1; before=0;after=0; IF year<2003 THEN before=1; IF year>2002 THEN after=1; /**********************************************************************************/ /*Balancing the sample with respect to the variables */ /* in the regression analysis: ltdc, lsales, lretm1,ltdc, lroam1, ind */ /**********************************************************************************/ DATA balancing; SET x.analysis; IF lretm1~=.; IF lsales~=.; IF ltdc~=.; IF lroam1~=.; IF ind~=.; IF ltenure~=.; /**********************************************************************************/ /*Note: this balancing is done with the tenure variable. To balance without the */ /*tenure variable one should cancel the line "IF ltenure~=.;" from the */ /*above procedure. The sample without the tenure variable includes 876 firms */ /**********************************************************************************/ PROC SORT DATA=balancing;BY gvkey; PROC MEANS DATA=balancing noprint; output out=balancing1 mean(ltdc)=mltdc; BY gvkey; DATA balancing2; set balancing1; IF _freq_=6; PROC SORT DATA=balancing2;BY gvkey; PROC SORT DATA=x.analysis;BY gvkey; DATA x.analysis_balanced (KEEP = gvkey year ind lsales before after lroam1 lretm1 flag_majperiod1 flag_indcomperiod1 flag_indnomperiod1 ltenure director_blockholder no_director_blockholder ltdc); MERGE balancing2 (IN=in2) x.analysis (IN=in1);BY gvkey;IF in1 AND in2; RUN;