proc sql; create table exe_ccn_lancmpcrsp as select a.*,std(b.RET)*sqrt(250) as lstkvol "lag annualized stock volitality" from exe_ccn_lancmpllq a left join crspa.DSF b on a.lpermno=b.permno and b.DATE between a.lfybegdt and a.lfyenddt group by a.lpermno,a.fyear having sum(b.RET is not missing)>1; quit; I use the same method as suggest to obtain stock volitality from crsp daily stock file. But my problem is that the observations go from 36 thousand to more than 1 billion. And there are many same results, with same lpermno, same fyear and same lstkvol. I couldn't find the reason. Thanks!
... View more