As recounted in an article in "The Hill", President Trump stated the following on August 30, 2017 in a speech on tax reform in Springfield, Missouri:
We just announced that we hit 3 percent in [gross domestic product]. It just came out. And on a yearly basis, as you know, the last administration during an eight-year period never hit 3 percent, so we're really on our way.
The Hill article goes on to explain that, under Obama, the economy hit or surpassed 3 percent growth during numerous quarters, but never sustained that level of growth for a full year. The following Python code looks at available GDP data to see to what degree the original claim is true.
The following code reads both the annual and quarterly GDP figures from the Bureau of Economic Analysis website and calculates the percent change between successive periods.
import pandas as pd
xx = pd.read_excel('https://www.bea.gov/national/xls/gdplev.xlsx', skiprows=7)
aa = xx.iloc[0:89, 0:3]
aa.columns = ['Year','Current $bil','Chained 2009 $bil']
qq = xx.iloc[0:286, 4:7] #UPDATE final row
qq.columns = ['Quarter','Current $bil','Chained 2009 $bil']
aa['Pct_Change'] = aa.loc[:,'Chained 2009 $bil'].pct_change()*100
qq['Pct_Change'] = qq.loc[:,'Chained 2009 $bil'].pct_change()*100
print(aa.head())
print(aa.tail(18))
The above output shows that GDP growth did not reach or exceed 3 percent during any of Obama's eight calendar years from 2009 through 2016. The closest that it came was 2.86 percent in 2015. However, it likewise did not reach 3 percent in Trump's first year, reaching just 2.27 percent in 2017. In fact, the last time that GDP growth surpassed 3 percent was in 2005 when it reached 3.35 percent. The following code generates a plot of GDP growth since 1929, the start of the annual GDP data:
import matplotlib.pyplot as plt
%matplotlib inline
aa.plot.line(x='Year',y='Pct_Change',figsize=(10,8),grid=True,title='GDP Growth')
The following code prints the quarterly GDP data and the percent change in real quarterly GDP.
print(qq.head())
print(qq.tail(10))
As can be seen, the percent change in real quarterly GDP has not surpassed one percent in the last 10 quarters. This is not that surprising, however, because this is the change for 1 quarter and is not annualized. For this reason, this percent change is not especially useful in this form.
To remedy this, the following code annualizes the quarterly percent change and also calculates the percent change over every consecutive four quarters, as well as each calendar year.
qq['iYear'] = qq['Quarter'].str[0:4]
qq['iQtr'] = qq['Quarter'].str[5:6]
qq['Year'] = pd.to_numeric(qq['iYear']) + (pd.to_numeric(qq['iQtr'])-1) * 0.25
qq['Change1q'] = (((1 + qq.loc[:,'Chained 2009 $bil'].pct_change())**4)-1)*100
qq['Change4q'] = (qq.loc[:,'Chained 2009 $bil'].pct_change(periods=4))*100
for index,row in aa.iterrows():
qq.loc[qq['Year']==row['Year'],'Change1y'] = row['Pct_Change']
qq.loc[qq['Year']==(row['Year']+0.25),'Change1y'] = row['Pct_Change']
qq.loc[qq['Year']==(row['Year']+0.50),'Change1y'] = row['Pct_Change']
qq.loc[qq['Year']==(row['Year']+0.75),'Change1y'] = row['Pct_Change']
gg = qq.loc[:, ['Quarter','Year','Change1q','Change4q','Change1y']]
print(gg.tail(n=40))
As can be seen from the above output, annualized quarterly GDP growth did surpass 3 percent under Obama in the following quarters:
Quarter Year Change1q Change4q Change1y 251 2009Q4 2009.75 3.928122 -0.240790 -2.776055 253 2010Q2 2010.25 3.920848 2.718800 2.532128 259 2011Q4 2011.75 4.582364 1.682174 1.601753 266 2013Q3 2013.50 3.120601 1.693670 1.677673 267 2013Q4 2013.75 3.959972 2.662455 1.677673 269 2014Q2 2014.25 4.600845 2.668539 2.569145 270 2014Q3 2014.50 5.211890 3.185157 2.569145 272 2015Q1 2015.00 3.239575 3.759456 2.861371
In addition, it surpassed 3 percent under Trump in the following 2 of his 4 quarters:
Quarter Year Change1q Change4q Change1y 281 2017Q2 2017.25 3.061172 2.206019 2.273244 282 2017Q3 2017.50 3.155671 2.299426 2.273244
Over all spans of 4 quarters, real GDP growth surpassed 3 percent under Obama in spans starting in the following quarters:
Quarter Year Change1q Change4q Change1y 254 2010Q3 2010.50 2.729265 3.075855 2.532128 270 2014Q3 2014.50 5.211890 3.185157 2.569145 272 2015Q1 2015.00 3.239575 3.759456 2.861371 273 2015Q2 2015.25 2.740879 3.295097 2.861371
There has only been only one span of 4 quarters under Trump and GDP growth did not surpass 3 percent during it.
Finally, as previously mentioned, GDP growth did not surpass 3 percent growth during a calendar year under either Obama or Trump. The following code generates a plot that shows all of the abovementioned percent changes.
import matplotlib.pyplot as plt
%matplotlib inline
#rr = qq[pd.to_numeric(qq['iYear']) >= 2008]
#rr.plot.line(x='Year',y=['Change4q','Change1y','Change1q'],figsize=(10,8),grid=True,title='GDP Growth',yticks=range(-9,6),ylim=(-5,6))
fig = plt.figure(figsize=(10,8))
ax = fig.add_subplot(1, 1, 1)
ax.grid()
ax.set_title('U.S. GDP Growth')
ax.set_xlabel('Source: see http://econdataus.com/gdp_growth_18q2.html')
ax.set_ylabel('Percent Growth')
ax.set_xlim([2008,2018.5]) # #UPDATE x-axis
ax.set_ylim([-5,6])
ax.set_yticks(range(-5,6))
ax.plot(qq.Year,qq.Change4q,'b-')
ax.plot(qq.Year,qq.Change1y,'r-')
ax.plot(qq.Year,qq.Change1q,'g-')
ax.axhline(y=3, color='k', linestyle='--')
ax.legend()
fig.savefig('gdp08_18q2.png')
Hence, saying that "the last administration during an eight-year period never hit 3 percent" and that "we hit 3 percent" is comparing annual calendar figures with quarterly figures. This is arguably equivalent to comparing apples and oranges. At the very least, it would seem that the current administration has no real grounds to claim that they have improved economic growth at this point. Only if they can consistently surpass 3 percent real GDP growth over several year and/or measurably increase the average GDP growth, would it seem valid to make that claim.
Note: The Jupyter Notebook from which this post is generated can be found at http://econdataus.com/gdp_growth_18q2.ipynb. It is identical to the one at http://econdataus.com/gdp_growth.ipynb except that it has been updated to include Q2 of 2018. Links to additional Jupyter Notebooks can be found at http://econdataus.com/jupyter.html.