全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4451 5
2012-01-18
stata如何在很多变量名后统一加上2002的简便方法,谢谢
二维码

扫码加我 拉你入群

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

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

全部回复
2012-1-18 12:18:31
如果你用的是stata12,用这个命令:
rename * =2002
二维码

扫码加我 拉你入群

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

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

2012-1-18 22:44:44
use the command "rename".
二维码

扫码加我 拉你入群

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

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

2012-1-30 01:57:55
If you have 5 variables, x1, x2, x3, x4, x5, and you want to change add "2002" to the first three variables, but let the other two unchanged. Then, you can use the following syntax:
-----------------------------------.
local ivlist x1 x2 x3
local n: word count `ivlist'
tokenize `ivlist'
forvalues i = 1/`n' {
   rename ``i'' ``i''2002
   }
.
-----------------------------------.
二维码

扫码加我 拉你入群

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

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

2012-2-1 13:31:44
in stata 12 try this command "rename * *2002", and you will get a surprise!
二维码

扫码加我 拉你入群

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

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

2012-2-1 19:37:35
是的stata的rename的功能增强了不少
多看帮助和manual


复制代码

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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