My purpose is to make a list of 60 lag variables, but there are always errors in logs which makes me suffer. I'll appreciate if someone could help me out with that!Attaching file is my code and sorry for the Chinese version of log error. data stock_return3;
set stock_return2;
by permno date;
Er = alpha + beta * vwretd; /*Expected return*/
AR = RET -Er; /*Abnormal retrun*/
PER=1+RET;
if first.permno then i=0;
i+1;
x=lag(1+ret);
x1=lag2(1+ret);
do i=2 to 59;
x&i=lag(&i+1)(1+ret);
end;
keep permno date ret vwretd month Er AR PER x x1-x59 i;
run
... View more