Video summary
#65 - Working with FRB Economic Data (FRED)
Main summary
Key takeaways
Main ideas & lessons
- FRED (Federal Reserve Economic Data) is a free repository (hosted by the Federal Reserve Bank of St. Louis) of 800+ economic time series.
- FRED provides downloadable charts and underlying data (CSV/Excel/images), but Exploratory enables more advanced workflows, especially for time series:
- Data access
- Data wrangling
- Visualization
- Analytics
- Reporting (dashboards/notes)
- Typical use case: instead of relying on media summaries, directly query FRED for source economic metrics and analyze them.
Agenda (3-part structure)
- Introduce what FRED is
- Show initial setup to use FRED data inside Exploratory
- Demonstrate how to:
- download/import FRED data,
- transform and wrangle it,
- visualize it,
- (optionally) compute additional derived metrics.
FRED concepts to check (before using a series)
Before analysis, verify:
- What the metric is (title/concept)
- When it was last updated (freshness vs outdated)
- Frequency (e.g., weekly vs monthly)
- Time range (start/end dates)
- Source of the data (FRED hosts; it may not be the producer)
- Unit/meaning notes (may require reading release/source pages)
- Edit graph options:
- change chart type
- add additional lines/series for comparison
- Download formats:
- CSV, Excel, image
Exploratory workflow with FRED (methodology/instructions)
A) Connect FRED to Exploratory (one-time setup)
In Exploratory:
- Click the “+” next to the data frames
- Choose Cloud apps data
- Select FRED economic data
- Enter:
- a connection name
- a FRED API key
How to get the API key:
- Create a (free) FRED account on the FRED website
- Go to My account → API keys
- Copy and paste the API key into Exploratory
After setup, future FRED imports work without re-entering the API key.
B) Import FRED time series into Exploratory (demo approach)
Steps:
- Use the FRED website to find the series you want (e.g., gas price)
- Copy the series ID (visible on FRED pages/URLs)
- In Exploratory:
- add a new FRED data source
- paste the series ID
- optionally set start/end dates
- Save the dataset
Notes about the imported schema (columns):
- includes date, series ID, value, and metadata like real-time start (exact columns vary)
C) Visualize time series in Exploratory
- Switch to line chart
- Configure chart fields:
- x-axis: date
- y-axis: value aggregation
- Monthly data handling:
- ensure the aggregation matches the series frequency
- if multiple points occur in a month, use average instead of sum
- Add reference lines:
- x-axis vertical reference lines (e.g., president inauguration dates)
- y-axis reference lines (e.g., “last”/most recent value as a benchmark)
- Apply filters to restrict the chart’s time range:
- example: filter date >= 2008-01-01 (or similar)
D) Compare multiple geographies (US average vs specific city/region)
On the FRED site:
- use Geography/Geographies selection (e.g., metropolitan statistical areas)
- choose relevant areas (e.g., San Francisco Bay Area)
- copy each region’s series ID
In Exploratory:
- import multiple series
- combine them using Merge / add rows / union to combine datasets with the same column structure
E) Compute derived metrics (difference and percent difference)
Core example: compare San Francisco gas price vs US city average.
- difference rate = (San Francisco − US average) / US average
Method used:
- Create a chart with two lines (San Francisco + US average) first for inspection.
- Reshape data to enable math:
- convert from long format (value + identifier in the same column) to wide format
- columns become separate series columns (e.g.,
San Francisco,US cities average)
- Compute new metrics:
- create a calculation column:
San Francisco - US cities(difference)(San Francisco - US cities) / US cities(difference rate / percent gap)
- create a calculation column:
Caution:
- column naming can cause “circular relationship” errors if a column name exactly matches a data frame name; rename columns to avoid collisions.
F) Compare multiple regions/states at scale
Two approaches are described:
-
Manual repeated import
- Repeat the same import process for multiple locations (e.g., California, Texas, Florida, New York; or major metros within them)
- Tedious because each location has a different FRED series ID.
-
Automated import using an R script (recommended)
- Use the R package
fredr(called “Fred R” in the talk) to fetch series by ID. - Use a mapping function to automate multiple series IDs:
map_dfr(from the package mentioned as “purrr” in the transcript)- Build a list of series IDs (e.g., New York, Miami, Houston, San Francisco, Los Angeles, US average)
- For each ID:
- call
fredr(series_id=...)
- call
map_dfrcombines the results into one dataframe.
- After retrieval:
- use Exploratory to visualize
- optionally remap/relabel “city code” values to readable names (e.g., 12A → San Francisco)
- adjust colors for readability in multi-series charts
- Final chart goal:
- show regional differences over time, including how gaps widen after certain years.
- Use the R package
G) Automation & refresh
Two refresh approaches:
- Re-import manually inside Exploratory
- click reimport each week/month
- Publish to Exploratory Server
- enables sharing
- enables scheduling automation
Scheduling behavior:
- Exploratory Server runs the pipeline:
- fetches latest data from FRED via the stored connection
- applies wrangling/transforms
- regenerates charts/dashboards
- recipients get email notifications with snapshot thumbnails.
What the demo concluded (gas price comparisons)
- Gas prices trend upward; reference lines (presidents) used to interpret changes across eras.
- San Francisco vs US average:
- the percent difference (“difference rate”) increases over time, suggesting the gap is widening in recent years (though not inflation-adjusted).
- Multi-city/state comparisons show:
- some regions cluster near the US average while others (notably California metros in the demo) show higher levels and growing gaps over time.
Speakers / sources featured
People / hosts
- Khan (CEO at Exploratory) — primary presenter
Mentioned companies/tools
- Exploratory — tool/platform used in the seminar
- Exploratory Server — for publishing, scheduling, notifications
Data/source repositories
- FRED — “Federal Reserve Economic Data”
- Federal Reserve Bank of St. Louis (as host of FRED)
- U.S. Energy Information Administration (example data source shown on a FRED page)
- U.S. Bureau (as mentioned for gas price data source) — cited in the demo when selecting the gas price series source
- fredr (R package) and purrr (R functional utilities) — used for scripted automated fetching in the R section