Data Assignment 2
First and Last Name (93#)
First and Last Name (93#)
First and Last Name (93#)
for Intermediate Macro
W&M ECON 304
Directions¶
Complete instructions here: Data Assignment Instructions
Export to PDF and upload to Gradescope by Tuesday, Oct 7, 9am
Gradescope Reminders
Only submit one assignment per group (of 3 members or less).
Add all group members to the one submission.
Select all the pages where your solutions appear to each question (i.e., not just the first page for each question).
1)¶
You may use GenAI to help with debugging your code for 1a. Do not use GenAI on question 1b.
a.¶
Get quarterly data on GDP and its components from 1960Q1-2025Q2:
Gross Domestic Product (FRED: GDP)
Personal consumption expenditures (FRED: PCEC)
Gross private domestic investment (FRED: GPDI)
Net exports of goods and services (FRED: NETEXP)
Government consumption expenditures and gross investment (FRED: GCE)
For every quarter and each component (e.g., consumption, investment, etc...), calculate its percentage share of GDP, , where is real GDP.
Plot the shares of GDP for consumption, investment, government spending, and net exports (hint: it’s probably easiest to read four separate figures, or subplots, one for each component).
b.¶
What long-run trends do you notice for each component’s share of GDP? Briefly, what do you think are some reasons for those trends?
2)¶
Feel free to use GenAI to help with question 2a. Do not use GenAI on question 2b.
Each news release, the BEA reports the contributions to the real GDP growth rate (e.g., see BEA News Release, Table 2). For any quarter , a formula for decomposing the contributions to the real GDP growth rate is given by:
where is an annualized quarterly growth rate of some GDP component, , and is ’s share of GDP at time .
a.¶
For 2015Q2 to 2025Q2, plot the contributions, , of consumption, private investment, government spending, and net exports to real GDP growth. Be sure to include a legend.
b.¶
Which component(s) are keeping recent (since 2020) GDP growth rates positive? Is that result surprising to you? Why or why not?