-------------------------------------------------------------------------------
       log:  /Volumes/ecxs2/users/baum/crsp/327evstud3.smcl
  log type:  smcl
 opened on:  20 Feb 2008, 16:57:58


. use crspret200106, clear

. su

Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- permno | 10657623 72581.18 22849.81 10001 93105 permco | 10657623 21437.27 12927.71 5 51568 date | 0 ret | 10528995 .0009371 .0433201 -.9565217 15.955 caldt | 10657623 16041.71 639.1697 14977 17164

. // merge on the event_dates file by permno . merge permno using 327event_dates, uniqusing variable permno does not uniquely identify observations in the master data

. tab _merge

_merge | Freq. Percent Cum. ------------+----------------------------------- 1 | 10,502,698 98.55 98.55 3 | 154,925 1.45 100.00 ------------+----------------------------------- Total | 10,657,623 100.00

. drop if _merge < 3 (10502698 observations deleted)

. drop _merge

. . // generate trading day counter . bys permno (caldt): g trday = _n

. bys permno: g target = trday if caldt == event_date (154818 missing values generated)

. egen td = min(target), by(permno) (34885 missing values generated)

. drop if td == . (34885 observations deleted)

. g dif = trday - td

. . // merge on NYSE VWRETD index . sort caldt

. merge caldt using nyse_vwretd, uniqusing variable caldt does not uniquely identify observations in the master data caldt was int now float

. tab _merge

_merge | Freq. Percent Cum. ------------+----------------------------------- 3 | 120,040 100.00 100.00 ------------+----------------------------------- Total | 120,040 100.00

. drop _merge

. sort permno caldt

. su

Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- permno | 120040 73573.67 20615.54 10016 91581 permco | 120040 20760.68 13750.25 323 51428 date | 0 ret | 119658 .0008281 .036728 -.7 2.333333 caldt | 120040 16093.33 635.5842 14977 17164 -------------+-------------------------------------------------------- event_date | 120040 16102.33 371.4021 15013 17141 first_date | 120040 15098.66 352.4275 14977 17111 last_date | 120040 17083.34 307.1394 15022 17164 trday | 120040 684.4097 433.7066 1 1507 target | 107 565.5514 318.2292 13 1107 -------------+-------------------------------------------------------- td | 120040 690.1725 252.0905 13 1107 dif | 120040 -5.762862 449.3579 -1106 1121 yymmdd | 0 vwretd | 120040 .0002864 .0095211 -.0468039 .0530638

. saveold 327evstud, replace file 327evstud.dta saved

. . log close log: /Volumes/ecxs2/users/baum/crsp/327evstud3.smcl log type: smcl closed on: 20 Feb 2008, 16:58:15 -------------------------------------------------------------------------------