install.packages("ggplot2",
repos = c("http://rstudio.org/_packages",
"http://cran.rstudio.com")
)
##
## There is a binary version available but the source version is later:
## binary source needs_compilation
## ggplot2 3.3.3 3.3.5 FALSE
Chapter 1: The Economics of Money, Banking, and Financial Markets
Key Questions:
Textbook Pages: 2-4
Spreads, Levels, and Behavior of Interest Rates
library(plotly) #Note: Install plotly and quantmod locally#
library(rmarkdown)
library(shiny)
BondRates <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/BondRates_Chapter_1.csv')
BondRates_Plot <- plot_ly(BondRates, x = ~Month, y = ~Moodys_Baa, name = 'Baa-Rated Corporate Bonds', type = 'scatter', mode = 'line')
BondRates_Plot <- BondRates_Plot %>% add_trace(y = ~LT_Gov, name = 'US Long-Term Government Bonds')
BondRates_Plot <- BondRates_Plot %>% add_trace(y = ~T_Bill_3, name = '3-Month Treasury Bills')
BondRates_Plot <- BondRates_Plot %>% layout(yaxis = list(title = "Interest Rate (% annual rate)", xaxis = list(title = "Year")))
div(BondRates_Plot, align = "center")
library(plotly)
Returns <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/Securities%20Market%20Returns.csv')
Returns_Plot <- plot_ly(Returns, x = ~Year, y = ~S_P_500, name = 'S&P 500 Index', type = 'scatter', mode = 'line')
Returns_Plot <- Returns_Plot %>% add_trace(y = ~Three_month_T_Bill, name = '3-Month US T-Bill')
Returns_Plot <- Returns_Plot %>% add_trace(y = ~US_T_Bond, name = 'US Treasury Bond (10-Year)')
Returns_Plot <- Returns_Plot %>% add_trace(y = ~Baa_Corporate_Bond, name = 'Baa Rated 10-Year Corporate Bond')
Returns_Plot <- Returns_Plot %>% layout(yaxis = list(title = "Percentage Returns"), xaxis = list(title = "Year"))
Returns_Plot
Textbook Pages: 4-7
library(plotly)
GSIBs <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/GSIBs.csv')
GSIBs_Plot <- plot_ly(GSIBs, x = ~Year, y = ~G_SIBs, name = 'Total SBA 7(A) Loans by G-SIBs', type = 'scatter', mode = 'none', stackgroup = 'one')
GSIBs_Plot <- GSIBs_Plot %>% add_trace(y = ~Other, name = 'Total Non-G-SIB 7(A) Loan Origination')
GSIBs_Plot <- GSIBs_Plot %>% layout(title = 'Comparison of 7(A) Loans Originated by G-SIB and Non-G-SIB Companies', yaxis = list(title = "Loan Amount"), xaxis = list(title = "Year"))
GSIBs_Plot
library(plotly)
sandp <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/sandp_lr.csv')
sandp_Plot <- plot_ly(sandp, x = ~Date, y = ~Price, name = 'S&P 500 Index', type = 'scatter', mode = 'line')
sandp_Plot <- sandp_Plot %>% layout(title = 'S&P 500 Index from 1871 to 2021', yaxis = list(title = "Index Level - Inflation Adjusted"), xaxis = list(title = "Date"))
sandp_Plot
Textbook Pages: 7-11
library(plotly)
library(rmarkdown)
library(shiny)
M1_M2 <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/M1_M2.csv')
M1_M2_Plot1 <- plot_ly(M1_M2, x = ~Date, y = ~M1SL, name = 'M1', type = 'scatter', mode = 'line')
M1_M2_Plot1 <- M1_M2_Plot1 %>% add_trace(y = ~M2SL, name = 'M2')
M1_M2_Plot1 <- M1_M2_Plot1 %>% layout(title = 'M1 and M2 from January 1959 to June 2021', yaxis = list(title = "Money Stock (in Billions of Dollars)", xaxis = list(title = "Date")))
M1_M2_Plot1
library(plotly)
library(rmarkdown)
library(shiny)
M1_M2 <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/M1_M2.csv')
M1_M2_Plot2 <- plot_ly(M1_M2, x = ~Date, y = ~M1SL_Percent, name = 'YOY Percent Change in M1', type = 'scatter', mode = 'line')
M1_M2_Plot2 <- M1_M2_Plot2 %>% add_trace(y = ~M2SL_Percent, name = 'YOY Percent Change in M2')
M1_M2_Plot2 <- M1_M2_Plot2 %>% layout(title = 'YOY (Year-Over-Year) % Change in M1 and M2 from January 1959 to June 2021', yaxis = list(title = "YOY Percent Change", xaxis = list(title = "Date")))
M1_M2_Plot2
library(plotly)
library(rmarkdown)
library(shiny)
Growth_FedFunds <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/Growth%20and%20Fed%20Funds%202.csv')
Growth_FedFunds_Plot <- plot_ly(Growth_FedFunds, x = ~Year, y = ~Fed_Funds, name = 'Fed Funds Rate', type = 'scatter', mode = 'line')
Growth_FedFunds_Plot <- Growth_FedFunds_Plot %>% add_trace(y = ~Growth_RGDP, name = 'Growth in Real GDP')
Growth_FedFunds_Plot <- Growth_FedFunds_Plot %>% add_trace(y = ~L_Growth_RGDP, name = 'Lagged Growth in Real GDP')
Growth_FedFunds_Plot <- Growth_FedFunds_Plot %>% layout(yaxis = list(title = "Percentage"), xaxis = list(title = "Year"))
Growth_FedFunds_Plot
library(plotly)
library(rmarkdown)
library(shiny)
GDPDEF <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/GDPDEF.csv')
GDPDEF_Plot <- plot_ly(GDPDEF, x = ~Date, y = ~GDPDEF, name = 'GDP Price Deflator', type = 'scatter', mode = 'line')
GDPDEF_Plot <- GDPDEF_Plot %>% layout(title = 'GDP Price Deflator from January 1959 to April 2021', yaxis = list(title = "GDP Price Deflator"), xaxis = list(title = "Date"))
GDPDEF_Plot
library(plotly)
library(rmarkdown)
library(shiny)
Budget <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/Budget%20Deficits.csv')
Budget_Plot <- plot_ly(Budget, x = ~DATE, y = ~Percent_GDP, name = 'Budget Surplus or Deficit', type = 'scatter', mode = 'line')
Budget_Plot <- Budget_Plot %>% layout(title = 'US Budget Surplus or Deficit from 1929 to 2020', yaxis = list(title = "Percent of GDP"), xaxis = list(title = "Year"))
Budget_Plot
Textbook Pages: 12-14
library(plotly)
library(rmarkdown)
library(shiny)
Exchange <- read.csv('https://raw.githubusercontent.com/Prof-Smith/Money-and-Banking/main/Trade%20Weighted%20US%20Dollar.csv')
Exchange_Plot <- plot_ly(Exchange, x = ~DATE, y = ~Dollar, name = 'Trade Weighted U.S. Dollar Index', type = 'scatter', mode = 'line')
Exchange_Plot <- Exchange_Plot %>% layout(title = 'Trade Weighted U.S. Dollar Index from 2016 to 2021', yaxis = list(title = "Value of Index"), xaxis = list(title = "Date"))
Exchange_Plot
The interactions between banks and financial intermediaries, the central bank, and consumers in terms of the creation of money/credit are fascinating. For this module’s reflection paper, consider whose role it is to ‘create’ money/credit.
Werner (2016) indicates that over the last century, there have been three dominant theories about banking’s role in the economy. The first is that they act as intermediaries and collect deposits, then lend them out to consumers. The second is that banks on their own are not able to create money, but do so collectively through the fractional reserve system and the multiplier effect. The third suggests that banks do not act collectively, but each individual bank creates credit and money when they make loans. Based on an empirical test and case studies, Werner (2016) indicates that the first two theories are rejected and found empirical evidence supporting the third (similar to Werner 2014). Mumtaz et al., 2020, p. 331