stata现在很流行,一些主流的国际机构和大公司都开始提供stata接口了,今天为大家介绍三个可以直接从stata导入外部数据的软件。这里只是简单介绍,具体操作请安装命定后看help文件。你们也使用过类似的命定???欢迎交流共享!
stockquote:
shows Yahoo Finance data. You need to lookup for the tecker in yahoo, but once you have it; then it’s quite easy to work with. (installed by simply typing ssc install stockquote and then doing help stockquote)
/* Command below gives you the stock prices for BHP Billiton, the Mining company from 1/2/2000 to 3/4/2012 on a daily basis */
stockquote BHP , fm(1) fd(2) fy(2000) lm(03) ld(4) ly(2012) frequency(d)
wbopendata: allows for access to the broad set of yearly Panel data of the “World Development Indicators” compiled by the world bank; as well as to other series compiled by them. (installed by simply typing ssc install wbopendata and then doing help wbopendata)
/* This gets you many indicators on a yearly basis, for example CPI inflation and lending rate for many countries, although with missing values */
set more off
wbopendata , indicator(fp.cpi.totl.zg ; fr.inr.lend) year(1960:2012) long clear
freduse:
gets data directly from FRED, which is the Federal Reserve Economic Data , compiled by St Louis’ Fed. It has many series. (installed typing ssc install freduse and then doing help freduse).
/*For example this short do file gets you the unemployment data for Chile */
freduse CHLURHARMMDSMEI CHLCPIALLQINMEI
line CHLURHARMMDSMEI daten if year(daten)>=1986, ///
ytitle(“Unemployment in Chile [OECD Stats]“)