## ── Attaching packages ───────────────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ tibble 2.1.3 ✔ purrr 0.3.3
## ✔ tidyr 1.0.0 ✔ dplyr 0.8.3
## ✔ readr 1.3.1 ✔ stringr 1.4.0
## ✔ tibble 2.1.3 ✔ forcats 0.4.0
## ── Conflicts ──────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
The economics dataset is a dataset with 6 variables and 478 observations. It contains information on population, unemployment, and personal consumption with respect to the year and month. This dataset was produced from US economic time series data available from the Federal Reserve Bank of St. Louis. The data has already been pre-processed.
Summary table template:
| Variable | Description |
|---|---|
| date | month of data collection |
| pce | personal consumption expenditures, in billions of dollars |
| pop | total population, in thousands |
| psavert | personal savings rate |
| uempmed | median duration of unemployment, in weeks |
| unemploy | number of unemployed in thousands |
write_csv(economics, path = file.path('data', 'economics.csv'))
economics_df <- read_csv(file.path('data', 'economics.csv'))
ggplot(data = economics_df, aes(x = date, y = unemploy)) +
geom_point(aes(color =uempmed)) +
labs(x = "Date",
y = "Unemployment",
title = "Number of Unemployed Over Time") +
theme_bw()
The first plot is the number of unemployed people, in thousands over time. The lighter dots represent a longer period of unemployment. The unit for median duration of unemployment is in weeks. This plot is a good representation of how many people are unemployed at a certain time. When there is a peak in the graph, it could signal a recesion. Moreover, lighter colors of blue tend to be near the peak meaning the unemployment duration is longer during recessions. The stock market crash of 2007-2008 is a good example of a recession that caused the graph’s behavior to spike near 2010.
ggplot(data = economics_df) +
geom_bar(aes(x = date, y = psavert, fill = pop), stat = 'identity') +
labs(x = "Date",
y = "Personal Savings Rate",
fill = 'population',
title = "How much an individual is Saving Per Year") +
theme_bw()
The second plot is the personal saving rate per year.The savings rate is a measurement of the amount of money an individual saves per year, expressed as a percentage or ratio. The graph also show that the rising population over time does not seem to affect the personal savings rate. The primary trend is unclear in this graph but the main point is that an increase in population does not effect the personal savings rate.