全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1084 0
2020-01-31
执行命令后显示invalid syntax,请问是什么问题呀?具体命令如下:

gen roa_t0 =.          

gen IND_t0 = .

gen size_t0 =.  

gen yr_t0 =.

gen id_t0 =.

foreach i=1/227{

replace roa_t0 = roa[`i’]         

replace IND_t0 = IND[`i’]

replace size_t0 = size[`i’]           

replace yr_t0 = year[`i’]         

replace id_t0 = id[`i’]         

replace ratio_roa = roa/roa_t0 if year==yr_t0 & IND==IND_t0 & yesT==0

count if  ratio_roa>0.8 & ratio_roa<1.2 & year==yr_t0 & IND==IND_t0

replace n_match = r(N) if nn==1   

if r(N)>1{

replace ratio_size = abs(size/size_t0-1) if ratio_roa>0.8 & ratio_roa<1.2 & year==yr_t0 & yesT==0 & IND==IND_t0

sum ratio_size if ratio_roa>0.8 & ratio_roa<1.2 & year==yr_t0 & yesT==0 & IND==IND_t0

replace Control=1 if ratio_size==r(min) & year==yr_t0 & Control!=1

replace match_id=id_t0  if ratio_size==r(min) & year==yr_t0

}

if r(N)<2{

replace Control=1  if ratio_roa>0.8 & ratio_roa<1.2 & year==yr_t0 & IND==IND_t0 & Control!=1

replace match_id=id_t0  if ratio_roa>0.8 & ratio_roa<1.2 & year==yr_t0 & IND==IND_t0

}

}



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群