全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
2431 2
2011-01-07
我的数据是这样子的:列是年,行是国家,数据是各国当年汇率,想转成列数据,一列年,一列国家,一列汇率,有没有什么方法?
二维码

扫码加我 拉你入群

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

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

全部回复
2012-12-15 11:43:03
task.txt
大小:(587 Bytes)

 马上下载

直接标价法
insheet using task.txt,clear
outsheet using xrate.txt,replace comma
drop if year==.
drop v*
reshape long usd, i(year) j(country) string
为什么要转成long的,我觉得wide更方便画图看趋势:
rename usd xrate
replace country=upper(country)
reshape wide xrate, i(year) j(country) string
line xrate* year, ///
scheme(s2mono) xline(2008) ///
plotregion(style(none) fcolor(white) margin(0)) ///
graphregion(fcolor(white)) ///
xlabel(2000(2)2011) ///
legend(cols(1) ring(0) position(11) )



附件列表

task.xls

大小:26 KB

 马上下载

二维码

扫码加我 拉你入群

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

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

2012-12-15 12:17:05
Reshape long rate, i(year)j(country)str
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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