Chapter 18 Data Apps

The Government and the Macroeconomy

Explore the data of Chapter 18 without any code. Every chart below is live: hover over it to read the values, and use its buttons, menus and sliders to change what it shows.

← Back to Chapter 18: The Government and the Macroeconomy

See also: Chapter 18 Model Apps, the chapter’s models without code.

U.S. spending, revenue and debt

Fig. 1: U.S. federal government revenue and spending

Move the slider to choose a period; the title gives the average revenue and spending, and the gap between them is the deficit.

Source. Data: Office of Management and Budget, Historical Tables of the FY2027 Budget, Table 1.2, total receipts and total outlays as percentages of GDP. Prepared file: data/ch18/fig18-1.csv (see the data notes). Chart: inspired by Fig. 18.1 in Jones (2024), Macroeconomics, 6th ed.

Fig. 1, beyond the United States: government budgets in 38 countries

Pick a country from the menu; when spending lies above revenue, the government runs a deficit.

Source. Data: OECD national accounts, general government total revenue (OTR), total expenditure (OTE) and net lending (B9) (Table 12, dataflow DSD_NASEC10@DF_TABLE12), divided by GDP (Table 1, DSD_NAMAIN10@DF_TABLE1_EXPENDITURE); via the OECD Data Explorer. Prepared file: data/ch18/gov_finance.csv (see the data notes). Chart: inspired by Fig. 18.1 in Jones (2024), Macroeconomics, 6th ed.

Fig. 2: Federal debt and deficits in the United States

Hover over the chart to read each fiscal year’s debt and balance; a balance below zero is a deficit, which adds to the debt.

Sources. Data: Office of Management and Budget, Historical Tables of the FY2027 Budget, Table 1.2 (surplus or deficit as a percentage of GDP) and Table 7.1 (federal debt held by the public as a percentage of GDP). Prepared file: data/ch18/fig18-2.csv (see the data notes). Chart: inspired by Fig. 18.2 in Jones (2024), Macroeconomics, 6th ed.

Fig. 2, beyond the United States: two centuries of government debt

Pick a group of countries with the buttons, then click a name in the legend to hide or show it; wars push debt up.

Source. Data: International Monetary Fund, Public Finances in Modern History database, general government gross debt (d), percent of GDP (dataset page). The IMF asks users to cite Mauro, Romeu, Binder and Zaman (2015), “A modern history of fiscal prudence and profligacy”, Journal of Monetary Economics 76: 55–70. Prepared file: data/ch18/gross_debt.csv (see the data notes). Chart: inspired by Fig. 18.2 in Jones (2024), Macroeconomics, 6th ed.

Spending and debt around the world

Fig. 3: Government spending around the world, 2019

Hover over a bar to read a country’s spending as a share of GDP in 2019 and 2024.

Source. Data: OECD, Government at a Glance, general government expenditure as a percentage of GDP (dataflow DSD_GOV@DF_GOV_PF_YU, measure GE), via the OECD Data Explorer. Prepared file: data/ch18/fig18-3.csv (see the data notes). Chart: inspired by Fig. 18.3 in Jones (2024), Macroeconomics, 6th ed.

Fig. 3, all OECD countries: government spending, 2007–2024

Press the play button or move the slider to step through the years; spending jumped everywhere in 2020.

Source. Data: OECD, Government at a Glance, general government expenditure as a percentage of GDP (dataflow DSD_GOV@DF_GOV_PF_YU, measure GE), via the OECD Data Explorer. Prepared file: data/ch18/gov_spending.csv (see the data notes). Chart: inspired by Fig. 18.3 in Jones (2024), Macroeconomics, 6th ed.

Fig. 4: Debt-GDP ratios around the world

Hover over a line to read a country’s net debt; it is debt minus the financial assets the government owns, so it can fall below zero.

Sources. Data: OECD government financial balance sheets, general government net financial worth (BF90, dataflow DSD_NASEC20@DF_T720GOV_A), divided by GDP (OECD Table 1, DSD_NAMAIN10@DF_TABLE1_EXPENDITURE); for Japan in 1995–2005, the OECD Economic Outlook net financial liabilities (GNFLQ); all via the OECD Data Explorer. Prepared file: data/ch18/fig18-4.csv (see the data notes). Chart: inspired by Fig. 18.4 in Jones (2024), Macroeconomics, 6th ed.

Fig. 4, beyond the five countries: net debt in 39 countries

Press the buttons to show a group of countries, or click a name in the legend to add or remove it; Norway’s net debt is negative.

Sources. Data: OECD government financial balance sheets, general government net financial worth (BF90, dataflow DSD_NASEC20@DF_T720GOV_A), divided by GDP (OECD Table 1, DSD_NAMAIN10@DF_TABLE1_EXPENDITURE); via the OECD Data Explorer. Prepared file: data/ch18/net_debt.csv (see the data notes). Chart: inspired by Fig. 18.4 in Jones (2024), Macroeconomics, 6th ed.

Deficits and private investment

Fig. 5: U.S. private investment and the budget deficit

Move the slider to switch between the averages of 1960–1979 and 1980–2025; the gap between the two lines is private plus foreign saving.

Sources. Data: U.S. Bureau of Economic Analysis, national accounts, via FRED: gross private domestic investment (GPDI), net federal government saving (FGDEF) and GDP (GDP). Prepared file: data/ch18/fig18-5.csv (see the data notes). Chart: inspired by Fig. 18.5 in Jones (2024), Macroeconomics, 6th ed.

Fig. 5, beyond the United States: investment and budget balances

Pick a country from the menu; the title gives the correlation of the yearly changes, which is positive in every country.

Sources. Data: OECD national accounts, general government net lending (B9, Table 12, dataflow DSD_NASEC10@DF_TABLE12); OECD National Accounts at a Glance, Chapter 3, investment and the government’s share of it (DSD_NAAG@DF_NAAG_III); GDP and changes in inventories (Table 1, DSD_NAMAIN10@DF_TABLE1_EXPENDITURE); all via the OECD Data Explorer. Prepared file: data/ch18/gov_finance.csv (see the data notes). Chart: inspired by Fig. 18.5 in Jones (2024), Macroeconomics, 6th ed.

The fiscal problem of the twenty-first century

Fig. 6: U.S. federal spending and revenues, 1950–2056

Hover over a line to read its share of GDP; dashed lines are CBO projections, and the markers are the textbook’s 2002 projection.

Sources. Data: Office of Management and Budget, Historical Tables of the FY2027 Budget, Tables 1.2 (revenue and GDP), 3.1 (outlays and net interest) and 8.5 (mandatory programs); Congressional Budget Office, The Long-Term Budget Outlook: 2026 to 2056, February 2026 for the projections. Prepared file: data/ch18/fig18-6.csv (see the data notes). The CBO 2002 markers are read from the textbook’s figure (CBO, A 125-Year Picture of the Federal Government’s Share of the Economy, 1950 to 2075, 2002). Chart: inspired by Fig. 18.6 in Jones (2024), Macroeconomics, 6th ed.

Fig. 6, the debt projection: the debt-GDP ratio to 2056

Move the slider to cut the primary deficit every year from 2026; with interest equal to growth, a cut of about 2 points holds the ratio steady.

Sources. Data: Office of Management and Budget, Historical Tables, Table 7.1 (debt held by the public); Congressional Budget Office, The Long-Term Budget Outlook: 2026 to 2056 (primary deficits, revenue minus spending excluding interest). Prepared files: data/ch18/fig18-2.csv, data/ch18/fig18-6.csv (see the data notes). Chart: inspired by the discussion of Fig. 18.6 in Jones (2024), Macroeconomics, 6th ed.

Fig. 7: Components of federal spending, 1950–2056

Hover over a line to read its share of GDP; dashed lines are projections, and Medicare and Medicaid are the part that keeps growing.

Sources. Data: Office of Management and Budget, Historical Tables of the FY2027 Budget, Tables 1.2 (revenue and GDP), 3.1 (outlays and net interest) and 8.5 (mandatory programs); Congressional Budget Office, The Long-Term Budget Outlook: 2026 to 2056, February 2026 for the projections. Prepared file: data/ch18/fig18-7.csv (see the data notes). Chart: inspired by Fig. 18.7 in Jones (2024), Macroeconomics, 6th ed.

Fig. 8: Health spending as a share of GDP in five countries

Hover over a line to read a country’s health spending; the United States spends far more than the others.

Source. Data: OECD Health Statistics, System of Health Accounts, current health expenditure as a percentage of GDP (dataflow DSD_SHA@DF_SHA), via the OECD Data Explorer. Prepared file: data/ch18/fig18-8.csv (see the data notes). Chart: inspired by Fig. 18.8 in Jones (2024), Macroeconomics, 6th ed.

Fig. 8, beyond the five countries: health spending in 45 countries

Pick a group of countries with the buttons, then click a name in the legend to hide or show it.

Source. Data: OECD Health Statistics, System of Health Accounts, current health expenditure as a percentage of GDP (dataflow DSD_SHA@DF_SHA), via the OECD Data Explorer. Prepared file: data/ch18/health_spending.csv (see the data notes). Chart: inspired by Fig. 18.8 in Jones (2024), Macroeconomics, 6th ed.