搜索
人大经济论坛 附件下载

附件下载

所在主题:
文件名:  WEO.zip
资料下载链接地址: https://bbs.pinggu.org/a-1255563.html
本附件包括:
  • WEOOct2012alla.xls
  • weooct2012.dta
  • WEOOct2012all.xls
附件大小:
国际货币基金组织(IMF)世界经济展望(World Economic Outlook [WEO])
2012年10月份的数据库
数据源:
http://www.imf.org/external/pubs/ft/weo/2012/02/weodata/download.aspx
引用请注明出处:October 2012 WEO Database
附件(已更新,原先的group()用的是var应该用varlab)内含整理好的*.dta-file
(参照sungmoo的标签解法,为便于交流,do-file源码贴到尾部,大家看看有什么更快捷的办法)
以下是变量描述(Stata限定变量标签不得超出80个字符{:soso_e115:}):
variable namevariable label
countryCountry
isoISO
estyrEstimates Start After
year
BCA_NGDPDcurrent account balance;percent of gdp;
BCAcurrent account balance;u.s. dollars;billions
LEemployment;persons;millions
GGXWDGgeneral government gross debt;national currency;billions
GGXWDG_NGDPgeneral government gross debt;percent of gdp;
GGXWDNgeneral government net debt;national currency;billions
GGXWDN_NGDPgeneral government net debt;percent of gdp;
GGXCNLgeneral government net lending/borrowing;national currency;billions
GGXCNL_NGDPgeneral government net lending/borrowing;percent of gdp;
GGXONLBgeneral government primary net lending/borrowing;national
currency;billions
GGXONLB_NGDPgeneral government primary net lending/borrowing;percent of gdp;
GGRgeneral government revenue;national currency;billions
GGR_NGDPgeneral government revenue;percent of gdp;
GGSBgeneral government structural balance;national currency;billions
GGSB_NPGDPgeneral government structural balance;percent of potential gdp;
GGXgeneral government total expenditure;national currency;billions
GGX_NGDPgeneral government total expenditure;percent of gdp;
PPPPCgross domestic product based on purchasing-power-parity (ppp) per capita
gdp;cur
PPPSHgross domestic product based on purchasing-power-parity (ppp) share of
world tot
PPPGDPgross domestic product based on purchasing-power-parity (ppp) valuation
of count
NGDP_FYgross domestic product corresponding to fiscal year, current
prices;national cur
NGDPRPCgross domestic product per capita, constant prices;national
currency;units
NGDPPCgross domestic product per capita, current prices;national currency;units
NGDPDPCgross domestic product per capita, current prices;u.s. dollars;units
NGDP_Rgross domestic product, constant prices;national currency;billions
NGDP_RPCHgross domestic product, constant prices;percent change;
NGDPgross domestic product, current prices;national currency;billions
NGDPDgross domestic product, current prices;u.s. dollars;billions
NGDP_Dgross domestic product, deflator;index;
NGSD_NGDPgross national savings;percent of gdp;
PPPEXimplied ppp conversion rate;national currency per current international
dollar;
PCPIinflation, average consumer prices;index;
PCPIPCHinflation, average consumer prices;percent change;
PCPIEinflation, end of period consumer prices;index;
PCPIEPCHinflation, end of period consumer prices;percent change;
NGAP_NPGDPoutput gap in percent of potential gdp;percent of potential gdp;
LPpopulation;persons;millions
FLIBOR6six-month london interbank offered rate (libor);percent;
NID_NGDPtotal investment;percent of gdp;
LURunemployment rate;percent of total labor force;
TXGOvalue of oil exports;u.s. dollars;billions
TMGOvalue of oil imports;u.s. dollars;billions
TX_RPCHvolume of exports of goods and services;percent change;
TXG_RPCHvolume of exports of goods;percent change;
TM_RPCHvolume of imports of goods and services;percent change;
TMG_RPCHvolume of imports of goods;percent change;

开源数据,一起分享
*weom.csv消掉了源数据库里的n/a和--insheet using weom.csv, names clearinsheet using weom.csv, names clear
foreach i of numlist 10/47 {
local j=`i'+1970
rename v`i' y`j'
}
save weo,replace
rename weosubjectcode varcode
rename subjectdescri~r var
rename weocountrycode countrycode
rename estimatesstar~r estyr
egen varm=concat(var units scale), p(;)
replace varm=strlower(varm)
drop var countrycode subjectnotes units scale countryseriesspecificnotes
order country iso varcode varm estyr
rename varcode var
rename varm varlab
outsheet using work.csv,names comma replace
save weom,replace
reshape long y,i(country iso var varlab estyr) j(year)
save work,replace
use work,clear
sort iso varlab
keep if iso=="AFG"
keep var
duplicates drop
gen n=_n
gen N=_N
reshape wide var, i(N) j(n)
drop N
*字串型变量上限为244字符[只能存入前32个变量名称(共46个)],所以拆成两断(长度分别为179和146)
*用空格做断点,为后面token做铺垫
*(试过别的不成,比如分号,逗号什么的,token会把这些符号存在positional local macro里)
egen name1=concat(var1-var23),punct(" ")
egen name2=concat(var24-var46),punct(" ")
keep name*
local x=name1
*断点识别符为空格
token `x',parse(" ")
* 因为后面标签也要用到positional local macro,所以这里变量名称要转存在其他local macro名下,
* 此处用nm1-nm46,分成两次(1-23和24-46),因为之前由于字串过长拆过。
forvalues i=1/23{
local nm`i' ``i''
}
local x=name2
*断点识别符为空格
token `x',parse(" ")
forvalues i=1/23{
local j=`i'+23
local nm`j' ``i''
}
use work,clear
*加标签
egen v=group(varlab)
levelsof varlab,l(v)
token `"`v'"',p("' `")
drop varlab var
reshape wide y,i(country iso year estyr) j(v)
forv i=1/46{
la var y`i' `"``i''"'
}
*标签加完
save new,replace

use new,clear
*重命名
forvalues i=1/46{
rename y`i' `nm`i''
}
save weooct2012,replace
以上办法可实现系统自动完成标签+命名(无需在rename或renvars中手动贴入变量名称)
经测,可行,不知有没有更好的办法,求解。





    熟悉论坛请点击新手指南
下载说明
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。
2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。
3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。
(如有侵权,欢迎举报)
二维码

扫码加我 拉你入群

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

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

GMT+8, 2026-1-10 04:02