黃河泉 发表于 2017-1-12 11:35 
请试试(先将 excel 档名改为 r2.xlsx),结果存在 r2.dta (请在 Stata 命令栏中打 pwd 以确定所存目录)
insheet using C:/Users/Yolanda/Desktop/r2.csv, clear
(10 vars, 11480 obs)
. ren ( _stkcd _date _wkret _wretmc v10)(id date rs rm ri)
. statsby r2=e(r2), by(id date) saving(r2.dta, replace): regress rs rm ri
(running regress on estimation sample)
command: regress rs rm ri
r2: e(r2)
by: id date
file r2.dta is read-only; cannot be modified or erased
r(608);
就是我该怎么存储才能让这个r2文档变成可以修改的 谢谢!