Home  /  Products  /  Stata 15  /  Import FRED

This page announced the new features in Stata 15. Please see our Stata 18 page for the new features in Stata 18.

Easy import of Federal Reserve Economic Data

Highlights

  • Click to search, browse, and import
  • Access over 470,000 time series
  • Access both FRED and archived data (ALFRED)
  • Combine multiple series

What's this about?

The St. Louis Federal Reserve makes available over 470,000 U.S. and international economic and financial time series to registered users. It's free. It's easy to register. It's called FRED.

In Stata 15, you can directly access FRED! You can search. You can browse. By category. By release. By source. You can click to download, and Stata will combine the series and load them instantly into memory.

Or you can do the same with the import fred command, which is especially convenient when you want to automate updating 27 different series that you are tracking.

Let's see it work

You need GDP for Venezuela, Colombia, and Peru. You launch Stata. You choose File > Import > Federal Reserve Economic Data (FRED). You type "Venezuela Gross Domestic Product" and click on Search. It looks like this:

screenshot

There's a lot to choose from. You choose RGDPNAVEA666NRUG, which fortunately you do by clicking on it. The series is added to the import list on the right. Now repeat the process for Columbia and Peru, and you have three series listed for download.

screenshot

Click on Import, and choose the date range and aggregation.

screenshot

Click on Submit, and Stata swings into action. Stata downloads the data into its memory and combines them into a single dataset. To find out what you now have, just type describe.

. describe

Contains data
  obs:            25                          
 vars:             5                          
 size:           600                          
storage display value variable name type format label variable label
datestr str10 %-10s observation date daten int %td numeric (daily) date RGDPNAVEA666N~G float %9.0g Real GDP at Constant National Prices for Bolivarian Republic of Venezuela RGDPNACOA666N~G float %9.0g Real GDP at Constant National Prices for Colombia RGDPNAPEA666N~G float %9.0g Real GDP at Constant National Prices for Peru
Sorted by: datestr Note: Dataset has changed since last saved.

If you prefer, you can type commands to search and load instead.

However you do it, you will want to rename the variables. Who wants variables with names like RGDPNAVEA666NRUG? You could type

. rename RGDPNAVEA666NRUG venezuela 

but don't do that. Instead, just type

. rename

Double-click on the variable name in Stata's Variables pane. You will see

. rename RGDPNAVEA666NRUG 

Now type venezuela and press Enter.

. rename RGDPNAVEA666NRUG venezuela 

One down, two more to go! Then, you can analyze the series by using Stata's time-series commands.

Tell me more

Learn more about the import fred command at [D] import fred.

Learn more about Stata's data management features.

ORDER STATA   UPGRADE NOW