Table 1.13. National Income by Sector, Legal Form of Organization, and Type of Income (A) (Q) - T11300

Data - BEA

Layout

  • NIPA Website. html

1938, 1958, 1978, 1998, 2018 Table (%)

Code
T11300_A |>
  year_to_date() |>
  mutate(year = year(date)) |>
  filter(year %in% c(1929, 1949, 1969, 1989, 2009, 2019)) |>
  group_by(year) |>
  mutate(value = round(100*DataValue/DataValue[1], 1)) |>
  ungroup() |>
  select(LineNumber, LineDescription, year, value) |>
  spread(year, value) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Ex 2: National Income by Sector

Code
ni_total <- T11300_A |> filter(LineNumber == 1) |> select(TimePeriod, total = DataValue)

T11300_A |>
  filter(LineNumber %in% c(3, 19, 28, 41, 56)) |>
  left_join(ni_total, by = "TimePeriod") |>
  mutate(share = DataValue/total) |>
  year_to_date() |>
  ggplot() + theme_minimal() +
  geom_line(aes(x = date, y = share, color = LineDescription)) +
  geom_rect(data = nber_recessions |>
              filter(Peak > as.Date("1929-01-01")),
            aes(xmin = Peak, xmax = Trough, ymin = -Inf, ymax = +Inf),
            fill = 'grey', alpha = 0.5) +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
  scale_color_manual(values = viridis(5)) +
  theme(legend.title = element_blank(),
        legend.position = "bottom") +
  ylab("% of national income") + xlab("")

Ex 3: Labor vs Capital Share of Corporate Income

Code
corp_total <- T11300_A |> filter(LineNumber == 3) |> select(TimePeriod, total = DataValue)

T11300_A |>
  filter(LineNumber %in% c(4, 7)) |>
  left_join(corp_total, by = "TimePeriod") |>
  mutate(share = DataValue/total,
         LineDescription = ifelse(LineNumber == 4, "Compensation of employees (labor)",
                                   "Corporate profits (capital)")) |>
  year_to_date() |>
  ggplot() + theme_minimal() +
  geom_line(aes(x = date, y = share, color = LineDescription)) +
  geom_rect(data = nber_recessions |>
              filter(Peak > as.Date("1929-01-01")),
            aes(xmin = Peak, xmax = Trough, ymin = -Inf, ymax = +Inf),
            fill = 'grey', alpha = 0.5) +
  scale_x_date(breaks = seq(1920, 2100, 10) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
  scale_color_manual(values = viridis(2)) +
  theme(legend.title = element_blank(),
        legend.position = "bottom") +
  ylab("% of corporate business income") + xlab("")