早教吧作业答案频道 -->其他-->
本人做eventstudy中,参考princeton大学给的代码整理数据,但是运行到下面的时候总是提示错误,感激不尽!源代码如下:forvaluesi=1(1)r(max){/*note:replaceNwiththehighestvalueofid*/listidStkcdifid=='i'&dif
题目详情
本人做event study中,参考princeton大学给的代码整理数据,但是运行到下面的时候总是提示错误,感激不尽!
源代码如下:
forvalues i=1(1)r(max){/*note:replace N with the highest value of id*/
list id Stkcd if id=='i' & dif==0
reg Dretwd Mkttrt if id=='i' & estimation_window==1
predict p if id=='i' /*此处i是什么?*/
replace predicted_return=p if id=='i' & event_window==1
drop p
}
错误提示:
invalid syntax
r(198);
源代码如下:
forvalues i=1(1)r(max){/*note:replace N with the highest value of id*/
list id Stkcd if id=='i' & dif==0
reg Dretwd Mkttrt if id=='i' & estimation_window==1
predict p if id=='i' /*此处i是什么?*/
replace predicted_return=p if id=='i' & event_window==1
drop p
}
错误提示:
invalid syntax
r(198);
▼优质解答
答案和解析
把forvalues i=1(1)r(max){
改为
forvalues i=1(1)`r(max)'{
试试
改为
forvalues i=1(1)`r(max)'{
试试
看了 本人做eventstudy中...的网友还看了以下:
已知复数z1=2-i与z2=x(1-i)+y(1+i)是共轭复数,z=x+yi,求|z| 2020-06-05 …
x/(1+i)+y/(1-i)=1求x+y详细过程 2020-06-12 …
设x是纯虚数,y是实数,且2x-1+i=y-(3-y)i,则x+y等于-1-52i-1-52i. 2020-08-01 …
已知复数z=icos140°,则argz=若x是纯虚数,y是实数,且(2x-1)i=y-(3-y) 2020-08-01 …
有关复数的题目一.求适合下列方程的x与y(x,y全属于R)的值:1)(1+2i)x+(3-10i) 2020-08-02 …
求适合于下式的实数x和y:[(y^2+x^2i)+(10+i)]/[x(1+2i)+y(1+3i)] 2020-11-01 …
当x,y等于什么实数时,x+1+i(y-3)/5+3i=1+i成立 2020-11-01 …
当x,y等于什么实数时,等式[x+1+i*(y-3)]/(5+3*i)=1+i成立? 2020-11-01 …
设z=x+iy满足x-1+i(y+2)=(1+i)(1-i)求z 2020-12-05 …
求一道复数题求合适等式(2x-1)+i=y+(y-3)i的x,y值,其中x属于实数,y是纯虚数.其中 2020-12-13 …