capt log close set more off clear all set memory 200m log using proxy_returns2bis2010, replace * cfb 5804, revised sheet Chuck 5A06 * cfb 6706, revised sheet 6703 * revised to pull in CRSP vwretd 6413 * keep returns data for firms flagged in proxy_proxyP2 rev 8620 * cfb 8928 rev to append with original * cfb 0422 modified to pull in updated CRSP data, including vwretd in same file cd "/Users/baum/documents/ Chucky/ ChuckLitGov2/" loc in1 monret2008 /* use CRSPmonNAQ,clear keep ym vwretd save mktret,replace use monRet, clear */ use `in1', clear g ym = mofd(date) format ym %tm sort ym su ym,mean local ymmin = r(min) local ymmax = r(max) /* merge ym using mktret, uniqusing drop if _merge<3 drop _merge */ g double abret = ret - vwretd sort permno date merge permno using proxy_proxyP2, uniqusing tab _merge * keep returns for those firms matched in proxy keep if _merge==3 drop _merge rename ym month // g month = mofd(date) format month %tm keep permno ret abret month * make returns wide so that they can be merged on to proxy reshape wide ret abret, i(permno) j(month) // forv i=396/539 { forv i=`ymmin'/`ymmax' { di "`i' -> " %tm `i' } sort permno save proxy_returns2,replace * do the merge use proxy_proxyN2, clear sort permno merge permno using proxy_returns2, uniqusing tab _merge drop if _merge<3 drop _merge sort case_code year save proxy_proxyR2, replace list in 1 list in l summ tab extd log close set more on log2html proxy_returns2bis2010, replace