<p>It is because you are using wrong data, in fact the two series you plot never overlap save for some crossing points, and given you are using wrong datasets its actually weird why they follow each other so close at the beginning in the first place (although probably it is just optical illusion due to scaling).</p>
<p>If you are using <a href="https://fred.stlouisfed.org/series/GDP" rel="noreferrer">Gross Domestic Product (GDP)</a> dataset for Y the correct datasets for components of Y are:</p>
<p><a href="https://fred.stlouisfed.org/series/PCEC" rel="noreferrer">C = Personal Consumption Expenditures (PCEC)</a></p>
<p><a href="https://fred.stlouisfed.org/series/GPDI" rel="noreferrer">I =  Gross Private Domestic Investment (GPDI)</a></p>
<p><a href="https://fred.stlouisfed.org/series/GCE" rel="noreferrer">G = Government Consumption Expenditures and Gross Investment (GCE)</a></p>
<p><a href="https://fred.stlouisfed.org/series/NETEXP" rel="noreferrer">NX = Net Exports of Goods and Services (NETEXP)</a></p>
<p>Once you use correct dataset you get perfect match like a glove (I forgot to add legend in ggplot, red is GDP and blue is C+I+G+NX), you see purple line due to perfect overlap:</p>
<p><a href="https://i.sstatic.net/JlQ9b.png" rel="noreferrer"><img src="https://i.sstatic.net/JlQ9b.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-08-05T20:23:44.350Z
2021-08-05T20:28:47.460Z
2021-08-05T20:28:47.460Z
1muflon1
<p>To visualise the formula:
<span class="math-container">$$Y=C+I+G+NX$$</span></p>
<p>I downloaded the FED data and plotted it, only to discover the two curves progressively diverge (see chart below).</p>
<p><strong>What am I missing?</strong></p>
<p>thank you!</p>
<p><span class="math-container">$Y$</span> = <a href="https://fred.stlouisfed.org/series/GDP" rel="nofollow noreferrer">https://fred.stlouisfed.org/series/GDP</a></p>
<p><span class="math-container">$C$</span> = <a href="https://fred.stlouisfed.org/series/PCE" rel="nofollow noreferrer">https://fred.stlouisfed.org/series/PCE</a></p>
<p><span class="math-container">$I$</span> = <a href="https://fred.stlouisfed.org/series/BOGZ1FA105050005Q" rel="nofollow noreferrer">https://fred.stlouisfed.org/series/BOGZ1FA105050005Q</a></p>
<p><span class="math-container">$G$</span> = <a href="https://fred.stlouisfed.org/series/W068RCQ027SBEA" rel="nofollow noreferrer">https://fred.stlouisfed.org/series/W068RCQ027SBEA</a></p>
<p><span class="math-container">$NX$</span> = <a href="https://fred.stlouisfed.org/series/BOPGSTB" rel="nofollow noreferrer">https://fred.stlouisfed.org/series/BOPGSTB</a></p>
<p><a href="https://i.sstatic.net/poYnY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/poYnY.png" alt="enter image description here" /></a></p>

<macroeconomics><gdp><aggregate-demand>
GDP doesn't add up in FED data - why?
elemolotiv
# GDP doesn't add up in FED data - why?

(Asked by: username_0 on 2021-08-05)

To visualise the formula:
$$Y=C+I+G+NX$$

I downloaded the FED data and plotted it, only to discover the two curves progressively diverge (see chart below).

**What am I missing?**

thank you!

$Y$ = <https://fred.stlouisfed.org/series/GDP>

$C$ = <https://fred.stlouisfed.org/series/PCE>

$I$ = <https://fred.stlouisfed.org/series/BOGZ1FA105050005Q>

$G$ = <https://fred.stlouisfed.org/series/W068RCQ027SBEA>

$NX$ = <https://fred.stlouisfed.org/series/BOPGSTB>

[![enter image description here](https://i.sstatic.net/poYnY.png)](https://i.sstatic.net/poYnY.png)

**Tags:** macroeconomics, gdp, aggregate-demand


---

## 1 answers

### Answer by username_1 on 2021-08-05. Score: 6

It is because you are using wrong data, in fact the two series you plot never overlap save for some crossing points, and given you are using wrong datasets its actually weird why they follow each other so close at the beginning in the first place (although probably it is just optical illusion due to scaling).

If you are using [Gross Domestic Product (GDP)](https://fred.stlouisfed.org/series/GDP) dataset for Y the correct datasets for components of Y are:

[C = Personal Consumption Expenditures (PCEC)](https://fred.stlouisfed.org/series/PCEC)

[I = Gross Private Domestic Investment (GPDI)](https://fred.stlouisfed.org/series/GPDI)

[G = Government Consumption Expenditures and Gross Investment (GCE)](https://fred.stlouisfed.org/series/GCE)

[NX = Net Exports of Goods and Services (NETEXP)](https://fred.stlouisfed.org/series/NETEXP)

Once you use correct dataset you get perfect match like a glove (I forgot to add legend in ggplot, red is GDP and blue is C+I+G+NX), you see purple line due to perfect overlap:

[![enter image description here](https://i.sstatic.net/JlQ9b.png)](https://i.sstatic.net/JlQ9b.png)


---

