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);
求解怎么改