Video summary

#65 - Working with FRB Economic Data (FRED)

Main summary

Key takeaways

Educational

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)

  1. Introduce what FRED is
  2. Show initial setup to use FRED data inside Exploratory
  3. 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:

  1. Click the “+” next to the data frames
  2. Choose Cloud apps data
  3. Select FRED economic data
  4. 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:

  1. Use the FRED website to find the series you want (e.g., gas price)
  2. Copy the series ID (visible on FRED pages/URLs)
  3. In Exploratory:
    • add a new FRED data source
    • paste the series ID
    • optionally set start/end dates
  4. 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

  1. Switch to line chart
  2. Configure chart fields:
    • x-axis: date
    • y-axis: value aggregation
  3. Monthly data handling:
    • ensure the aggregation matches the series frequency
    • if multiple points occur in a month, use average instead of sum
  4. 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)
  5. 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:

  1. Create a chart with two lines (San Francisco + US average) first for inspection.
  2. 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)
  3. Compute new metrics:
    • create a calculation column:
      • San Francisco - US cities (difference)
      • (San Francisco - US cities) / US cities (difference rate / percent gap)

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:

  1. 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.
  2. 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=...)
      • map_dfr combines 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.

G) Automation & refresh

Two refresh approaches:

  1. Re-import manually inside Exploratory
    • click reimport each week/month
  2. 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

Original video