Skip to main content

Data Transformations

FRED provides powerful transformation capabilities to prepare data for analysis. Learn how to apply transformations directly in your requests.

Transformation Types

Levels (lin)

Raw, untransformed data:
{
  "series_id": "GDP",
  "observation_start": "2020-Q1",
  "units": "lin"  // Default, can be omitted
}
Output:
[
  { "date": "2024-Q2", "value": "28647.8" },
  { "date": "2024-Q1", "value": "28435.1" }
]
Units: Billions of Dollars

Change (chg)

Absolute period-to-period change:
{
  "series_id": "GDP",
  "observation_start": "2020-Q1",
  "units": "chg"
}
Formula: x_t - x_{t-1} Output:
[
  { "date": "2024-Q2", "value": "212.7" },
  { "date": "2024-Q1", "value": "157.3" }
]
Use cases:
  • Quarterly GDP additions
  • Monthly employment changes
  • Period-over-period differences

Percent Change (pch)

Period-to-period percentage change:
{
  "series_id": "GDP",
  "observation_start": "2020-Q1",
  "units": "pch"
}
Formula: ((x_t / x_{t-1}) - 1) * 100 Output:
[
  { "date": "2024-Q2", "value": "0.75" },
  { "date": "2024-Q1", "value": "0.56" }
]
Use cases:
  • Month-over-month inflation
  • Quarter-over-quarter growth
  • Short-term momentum

Percent Change from Year Ago (pc1)

Year-over-year percentage change:
{
  "series_id": "CPIAUCSL",
  "observation_start": "2020-01-01",
  "units": "pc1"
}
Formula: ((x_t / x_{t-n}) - 1) * 100 where n = periods in a year Output:
[
  { "date": "2024-09-01", "value": "2.4" },
  { "date": "2024-08-01", "value": "2.5" }
]
Use cases:
  • Annual inflation rates
  • Year-over-year GDP growth
  • Annual wage growth
pc1 is the most common transformation for inflation and growth rates

Compounded Annual Rate of Change (pca)

Annualized growth rate:
{
  "series_id": "GDPC1",
  "observation_start": "2020-Q1",
  "units": "pca"
}
Formula: (((x_t / x_{t-1})^(n)) - 1) * 100 where n = periods per year Output:
[
  { "date": "2024-Q2", "value": "3.0" },
  { "date": "2024-Q1", "value": "1.4" }
]
Use cases:
  • Quarterly GDP at annual rates (official reporting)
  • Annualizing monthly growth
pca compounds the growth rate. A 0.75% quarterly growth becomes ~3% annual rate.

Change from Year Ago (ch1)

Absolute change from same period last year:
{
  "series_id": "PAYEMS",
  "observation_start": "2020-01-01",
  "units": "ch1"
}
Formula: x_t - x_{t-n} Output:
[
  { "date": "2024-09-01", "value": "2543" },
  { "date": "2024-08-01", "value": "2619" }
]
Use cases:
  • Year-over-year job gains
  • Annual change in levels

Continuously Compounded Rate (cch)

Log difference (percentage):
{
  "series_id": "SP500",
  "observation_start": "2020-01-01",
  "units": "cch"
}
Formula: (ln(x_t) - ln(x_{t-1})) * 100 Output:
[
  { "date": "2024-10-25", "value": "0.52" },
  { "date": "2024-10-24", "value": "-0.18" }
]
Use cases:
  • Financial returns analysis
  • Statistical modeling
  • Volatility calculations

Continuously Compounded Annual Rate (cca)

Log difference annualized:
{
  "series_id": "GDP",
  "observation_start": "2020-Q1",
  "units": "cca"
}
Formula: (ln(x_t) - ln(x_{t-n})) * 100 Use cases:
  • Academic research
  • Econometric modeling

Natural Log (log)

Logarithmic transformation:
{
  "series_id": "GDP",
  "observation_start": "2020-Q1",
  "units": "log"
}
Formula: ln(x_t) Output:
[
  { "date": "2024-Q2", "value": "10.2627" },
  { "date": "2024-Q1", "value": "10.2553" }
]
Use cases:
  • Identifying exponential trends
  • Statistical analysis requiring normality
  • Growth rate calculations

Transformation Selection Guide

By Use Case

// Year-over-year (most common for news)
{ "units": "pc1" }

// Annualized rate (GDP reporting)
{ "units": "pca" }

By Data Frequency

FrequencyCommon TransformationsExample
Dailylin, pch, cchStock returns
Weeklylin, pch, pc1Initial claims
Monthlypc1, pch, ch1Inflation, employment
Quarterlypca, pc1, logGDP growth
Annualpc1, chgDemographics

Practical Examples

Inflation Analysis

{
  "series_id": "CPIAUCSL",
  "units": "pch"
}
// Shows monthly price changes

GDP Growth

{
  "series_id": "GDPC1",
  "units": "pch"
}
// Simple quarterly growth

Employment Changes

{
  "series_id": "PAYEMS",
  "units": "chg"
}
// Net jobs added/lost (in thousands)

Combining Transformations

Compare Multiple Views

// Original levels
const levels = {
  "series_id": "UNRATE",
  "observation_start": "2020-01-01",
  "units": "lin"
};

// Month-over-month change
const monthly = {
  "series_id": "UNRATE",
  "observation_start": "2020-01-01",
  "units": "chg"
};

// Year-over-year change
const annual = {
  "series_id": "UNRATE",
  "observation_start": "2020-01-01",
  "units": "ch1"
};

Growth Decomposition

// Nominal GDP growth
const nominal = {
  "series_id": "GDP",
  "units": "pc1"
};

// Real GDP growth
const real = {
  "series_id": "GDPC1",
  "units": "pc1"
};

// Implicit: Price change ≈ Nominal - Real

Advanced Techniques

Detrending

Remove long-term trends using logs:
// Step 1: Get log values
{
  "series_id": "GDPC1",
  "observation_start": "2000-Q1",
  "units": "log"
}

// Step 2: Calculate deviations from trend
// (done in analysis tool)

Volatility Measurement

Use continuous compounding for returns:
{
  "series_id": "SP500",
  "observation_start": "2023-01-01",
  "units": "cch"  // Daily log returns
}

// Calculate standard deviation for volatility

Real vs Nominal

Deflate nominal series:
// Nominal wages
const nominal_wages = {
  "series_id": "CES0500000003"
};

// CPI (for deflation)
const cpi = {
  "series_id": "CPIAUCSL"
};

// Real wages = (Nominal / CPI) * 100
FRED often provides pre-calculated real series (look for “Real” in title)

Common Pitfalls

Don’t: Compare monthly % change with quarterly
{ "series_id": "CPIAUCSL", "units": "pch" }  // Monthly
{ "series_id": "GDP", "units": "pch" }       // Quarterly
Do: Use consistent frequencies
{ "series_id": "CPIAUCSL", "units": "pc1" }  // Annual
{ "series_id": "GDP", "units": "pc1" }       // Annual
Don’t: Apply transformations to already-transformed series
// Series ending in "CHG" or "PC1" are already transformed
{ "series_id": "GDPC1CHG", "units": "pch" }  // Wrong!
Do: Use base series
{ "series_id": "GDPC1", "units": "pch" }  // Correct
Don’t: Forget to check original units
// Some series are in billions, others in thousands
{ "series_id": "GDP" }      // Billions
{ "series_id": "PAYEMS" }   // Thousands
Do: Verify units in response
Don’t: Use NSA data for growth rates
{ "series_id": "UNRATENSA", "units": "pch" }  // Seasonal distortion
Do: Use SA data for comparisons
{ "series_id": "UNRATE", "units": "pch" }  // Seasonally adjusted

Transformation Reference

Quick Reference Table

CodeNameFormulaPeriodUse Case
linLevelsx_t-Raw data
chgChangex_t - x_PriorAbsolute change
ch1Change YoYx_t - x_Year agoAnnual absolute change
pch% Change((x_t/x_)-1)*100PriorGrowth rate
pc1% Change YoY((x_t/x_)-1)*100Year agoAnnual growth
pcaCompounded Annual(((x_t/x_)^n)-1)*100AnnualAnnualized rate
cchLog Change(ln(x_t)-ln(x_))*100PriorLog returns
ccaLog Change Annual(ln(x_t)-ln(x_))*100AnnualAnnual log returns
logNatural Logln(x_t)-Log levels

Frequency Multipliers (n)

Frequencyn (per year)
Daily365 (business) / 260 (trading)
Weekly52
Monthly12
Quarterly4
Semi-annual2
Annual1

Best Practices

1

Start with Levels

Always examine raw data first to understand scale and patterns
2

Match Use Case

Choose transformation based on your analysis needs
3

Document Choices

Note which transformations you applied for reproducibility
4

Verify Results

Sanity-check transformed values against known economic facts

Next Steps