全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
994 0
2018-03-22
quietly su fundid
forvalues i=1/`r(max)' {
***Sharpe-ratio:
quietly sum Rf_usd  if fundid==`i' & balanced==1
replace sharpe=`r(mean)'/`r(sd)'  if fundid==`i' & year==2010 & month==1
***Regress fund excess return on market excess return:
qui reg Rf_usd Rm_ Rsmb_ Rhml_ Rumd_ if fundid==`i' & balanced==1
***use lincom to extract estimated coefficients and the t-stat of the constant:
lincom Rm_
replace mktbeta=`r(estimate)' if fundid==`i' & year==2010 & month==1
replace Treynor=`r(mean)'/`r(estimate)' if fundid==`i' & year==2010 & month==1/*这条语句有问题,求教怎么修改*/
}


程序如上图所示 所需变量已经定义  程序运行出错提示
/.196155498178398 invalid name
r(198);

求解怎么改

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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