Included:

  • Retail vs benchmark rates for Ireland and selected Eurozone countries. An update on this series can be provided each month.
  • Arrears and Non-performing loans. The data displayed here is the first stage of an analysis into mortgage arrears and restructurings. I am trying to understand the trends now in order to give context to the figures in a rate hiking cycle. This analysis will be included as and when its available.

Next week:

I anticipate that next week there will be data for the following.

  • Flash Estimate for the Harmonised Index of Consumer Prices (30th September)
  • Construction Enterprises, Labour Costs and Turnover in the Retail Sector
  • Capital Goods Price Index
  • Gas Consumption by house type and energy rating

I’ve begun work on the latter 3 which were released last week (ending Sunday 25th September). I’ll see what I can do regarding the budget, I suspect we will not be short on commentary but grasping the magnitude of the changes will take longer.


Interest Rates

The bold value in the figure below is the latest retail rate in for a given country from the ECBs statistical warehouse. The ECBs deposit facility, a rate which the ECB manipulates as part of their monetary policy “toolkit” (as is often described in the media, and by the ECB) is included in each plot.

Note the sensitivity of the retail rates to the last ECB hiking cycle. - Raising its policy rate as of December 2005 eventually by a total of 200 basis points to the end of June 2007

Facet1 <- IE.BIR_H %>%
  ggplot(aes(x=obstime,y=obsvalue,group=ref_area))+
  geom_line(colour="darkgreen")+geom_step(data=MRO.DF_03,aes(x=obstime,y=obsvalue),linetype="dotted",alpha=0.7)+
  geom_hline(yintercept = 0, colour = "red",alpha=0.3)+
  geom_text_repel(aes(label=obsvalue),size=2.5,colour="#666666")+
  geom_text_repel(aes(label=lab),data=IE.BIR_H_end,size=2.75,colour="black",fontface='bold')+
  geom_text_repel(aes(label=lab),data=MRO.DF_03_end,size=2.75,colour="black",fontface='bold')+
  theme_bw()+
  theme(legend.position = "bottom")+
  ylab("%")+
  xlab(NULL)+
  ggtitle("Bank Interest Rates: Loans to households for house purchase")+
  labs(subtitle = "Ireland")

Facet2 <- DE.BIR_H %>%
  ggplot(aes(x=obstime,y=obsvalue,group=ref_area))+
  geom_line(colour="#FFCE00")+geom_step(data=MRO.DF_03,aes(x=obstime,y=obsvalue),linetype="dotted",alpha=0.7)+geom_hline(yintercept = 0, colour = "red",alpha=0.3)+
  geom_text_repel(aes(label=obsvalue),size=2.5,colour="#666666")+
  geom_text_repel(aes(label=obsvalue),data=DE.BIR_H_end,size=2.75,colour="black",fontface='bold')+
  theme_bw()+
  theme(legend.position = "bottom")+
  ylab(NULL)+
  xlab(NULL)+
  labs(subtitle = "Germany")

Facet3 <- FR.BIR_H %>%
  ggplot(aes(x=obstime,y=obsvalue,group=ref_area))+
  geom_line(colour="#0055A4")+geom_step(data=MRO.DF_03,aes(x=obstime,y=obsvalue),linetype="dotted",alpha=0.7)+geom_hline(yintercept = 0, colour = "red",alpha=0.3)+
  geom_text_repel(aes(label=obsvalue),size=2.5,colour="#666666")+
  geom_text_repel(aes(label=obsvalue),data=FR.BIR_H_end,size=2.75,colour="black",fontface='bold')+
  theme_bw()+
  theme(legend.position = "bottom")+
  ylab("%")+
  xlab(NULL)+
  labs(subtitle = "France")

Facet4 <- IT.BIR_H %>%
  ggplot(aes(x=obstime,y=obsvalue,group=ref_area))+
  geom_line(colour="#008C45")+geom_step(data=MRO.DF_03,aes(x=obstime,y=obsvalue),linetype="dotted",alpha=0.7)+geom_hline(yintercept = 0, colour = "red",alpha=0.3)+
  geom_text_repel(aes(label=obsvalue),size=2.5,colour="#666666")+
  geom_text_repel(aes(label=obsvalue),data=IT.BIR_H_end,size=2.75,colour="black",fontface='bold')+
  theme_bw()+
  theme(legend.position = "bottom")+
  ylab(NULL)+
  xlab(NULL)+
  labs(subtitle = "Italy",caption="ECB Deposit Facility = dotted line")

Facet1 + Facet2 + Facet3 + Facet4 + plot_layout(ncol=2)

Arrears / Non Performing Loans

Central Bank of Ireland

Data on long-term mortgage arrears reveals a significant number are more than ten years in arrears, with such cases dating back to the last financial crisis.

Data from the Residential Mortgage Arrears and Repossessions Statistics includes:

  1. Arrears
  2. Restructurings
  3. Repossessions

Below is the first pass at analysing arrears, the aim is to look at restructurings next.

The up to 90 day trend will be informative as it is naturally the most responsive, the accounts in long term arrears is informative of the structural issues remaining from the GFC on Irish banks.

# Step 1. Load Bank of Ireland Mortgage Arrears: https://www.centralbank.ie/statistics/data-and-analysis/credit-and-banking-statistics/mortgage-arrears
MOA <- readxl::read_xlsx(path="C:\\Users\\charten\\OneDrive - Glenveagh Properties\\Research & Development\\1. Analysis\\Banking\\moa-data-tables-new.sep.xlsx",sheet = 1)

### dates
MOA$date <- as.Date(MOA$Reporting.Date)

### Subsets
MOA.PDH <- MOA %>%
  filter(Format=="PDH")
MOA.PDH.N <- MOA.PDH %>%
  filter(Unit =="Number")
MOA.PDH.B <- MOA.PDH %>%
  filter(Unit =="Balance € (000)")
MOA.PDH.A <- MOA.PDH %>%
  filter(Unit =="Arrears € (000)")

MOA.BTL <- MOA %>%
  filter(Format=="BTL")
MOA.BTL.N <- MOA.BTL %>%
  filter(Unit =="Number")
MOA.BTL.B <- MOA.BTL %>%
  filter(Unit =="Balance € (000)")
MOA.BTL.A <- MOA.BTL %>%
  filter(Unit =="Arrears € (000)")

# Step 2. Filter Categories & Subcategories
## A: Arrears (1) Number 
MOA.PDH.N.AR <- MOA.PDH.N %>%
  filter(Category == "Arrears")
MOA.BTL.N.AR <- MOA.BTL.N %>%
  filter(Category == "Arrears")

### PDH
#### Total
MOA.PDH.N.AR_T <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears")
MOA.PDH.N.AR_T$lag <- lag(MOA.PDH.N.AR_T$value)
MOA.PDH.N.AR_T$diff <- MOA.PDH.N.AR_T$value - MOA.PDH.N.AR_T$lag 
MOA.PDH.N.AR_T$diffpc <- round((MOA.PDH.N.AR_T$diff/MOA.PDH.N.AR_T$lag),digits=4)*100
MOA.PDH.N.AR_T$lag[MOA.PDH.N.AR_T$date=="2009-09-30"] <- NA
MOA.PDH.N.AR_T$diff[MOA.PDH.N.AR_T$date=="2009-09-30"] <- NA
MOA.PDH.N.AR_T$diffpc[MOA.PDH.N.AR_T$date=="2009-09-30"] <- NA

#### up to 90 days
MOA.PDH.N.AR_90 <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - up to 90 days")
MOA.PDH.N.AR_90$lag <- lag(MOA.PDH.N.AR_90$value)
MOA.PDH.N.AR_90$diff <- MOA.PDH.N.AR_90$value - MOA.PDH.N.AR_90$lag 
MOA.PDH.N.AR_90$diffpc <- round((MOA.PDH.N.AR_90$diff/MOA.PDH.N.AR_90$lag),digits=4)*100
MOA.PDH.N.AR_90$lag[MOA.PDH.N.AR_90$date=="2009-09-30"] <- NA
MOA.PDH.N.AR_90$diff[MOA.PDH.N.AR_90$date=="2009-09-30"] <- NA
MOA.PDH.N.AR_90$diffpc[MOA.PDH.N.AR_90$date=="2009-09-30"] <- NA

#### 91 to 180 days
MOA.PDH.N.AR_180 <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 91 to 180 days")
MOA.PDH.N.AR_180$lag <- lag(MOA.PDH.N.AR_180$value)
MOA.PDH.N.AR_180$diff <- MOA.PDH.N.AR_180$value - MOA.PDH.N.AR_180$lag 
MOA.PDH.N.AR_180$diffpc <- round((MOA.PDH.N.AR_180$diff/MOA.PDH.N.AR_180$lag),digits=4)*100
MOA.PDH.N.AR_180$lag[MOA.PDH.N.AR_180$date=="2009-09-30"] <- NA
MOA.PDH.N.AR_180$diff[MOA.PDH.N.AR_180$date=="2009-09-30"] <- NA
MOA.PDH.N.AR_180$diffpc[MOA.PDH.N.AR_180$date=="2009-09-30"] <- NA

#### 181 to 365 days
MOA.PDH.N.AR_365 <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 181 to 365 days")
MOA.PDH.N.AR_365$lag <- lag(MOA.PDH.N.AR_365$value)
MOA.PDH.N.AR_365$diff <- MOA.PDH.N.AR_365$value - MOA.PDH.N.AR_365$lag 
MOA.PDH.N.AR_365$diffpc <- round((MOA.PDH.N.AR_365$diff/MOA.PDH.N.AR_365$lag),digits=4)*100
MOA.PDH.N.AR_365$lag[MOA.PDH.N.AR_365$date=="2012-09-28"] <- NA
MOA.PDH.N.AR_365$diff[MOA.PDH.N.AR_365$date=="2012-09-28"] <- NA
MOA.PDH.N.AR_365$diffpc[MOA.PDH.N.AR_365$date=="2012-09-28"] <- NA

#### 365 to 730 days (2YR)
MOA.PDH.N.AR_2YR <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 365 to 730 days (1 to 2 YRS)")
MOA.PDH.N.AR_2YR$lag <- lag(MOA.PDH.N.AR_2YR$value)
MOA.PDH.N.AR_2YR$diff <- MOA.PDH.N.AR_2YR$value - MOA.PDH.N.AR_2YR$lag 
MOA.PDH.N.AR_2YR$diffpc <- round((MOA.PDH.N.AR_2YR$diff/MOA.PDH.N.AR_2YR$lag),digits=4)*100
MOA.PDH.N.AR_2YR$lag[MOA.PDH.N.AR_2YR$date=="2012-09-28"] <- NA
MOA.PDH.N.AR_2YR$diff[MOA.PDH.N.AR_2YR$date=="2012-09-28"] <- NA
MOA.PDH.N.AR_2YR$diffpc[MOA.PDH.N.AR_2YR$date=="2012-09-28"] <- NA

#### 2 to 5 YR
MOA.PDH.N.AR_5YR <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 2 to 5 yrs")
MOA.PDH.N.AR_5YR$lag <- lag(MOA.PDH.N.AR_5YR$value)
MOA.PDH.N.AR_5YR$diff <- MOA.PDH.N.AR_5YR$value - MOA.PDH.N.AR_5YR$lag 
MOA.PDH.N.AR_5YR$diffpc <- round((MOA.PDH.N.AR_5YR$diff/MOA.PDH.N.AR_5YR$lag),digits=4)*100
MOA.PDH.N.AR_5YR$lag[MOA.PDH.N.AR_5YR$date=="2019-09-30"] <- NA
MOA.PDH.N.AR_5YR$diff[MOA.PDH.N.AR_5YR$date=="2019-09-30"] <- NA
MOA.PDH.N.AR_5YR$diffpc[MOA.PDH.N.AR_5YR$date=="2019-09-30"] <- NA

#### 5 to 10 YR
MOA.PDH.N.AR_10YR <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 5 to 10 yrs")
MOA.PDH.N.AR_10YR$lag <- lag(MOA.PDH.N.AR_10YR$value)
MOA.PDH.N.AR_10YR$diff <- MOA.PDH.N.AR_10YR$value - MOA.PDH.N.AR_10YR$lag 
MOA.PDH.N.AR_10YR$diffpc <- round((MOA.PDH.N.AR_10YR$diff/MOA.PDH.N.AR_10YR$lag),digits=4)*100
MOA.PDH.N.AR_10YR$lag[MOA.PDH.N.AR_10YR$date=="2019-09-30"] <- NA
MOA.PDH.N.AR_10YR$diff[MOA.PDH.N.AR_10YR$date=="2019-09-30"] <- NA
MOA.PDH.N.AR_10YR$diffpc[MOA.PDH.N.AR_10YR$date=="2019-09-30"] <- NA

#### 10 YR Plus
MOA.PDH.N.AR_10PLUS <- MOA.PDH.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - over 10 yrs")
MOA.PDH.N.AR_10PLUS$lag <- lag(MOA.PDH.N.AR_10PLUS$value)
MOA.PDH.N.AR_10PLUS$diff <- MOA.PDH.N.AR_10PLUS$value - MOA.PDH.N.AR_10PLUS$lag 
MOA.PDH.N.AR_10PLUS$diffpc <- round((MOA.PDH.N.AR_10PLUS$diff/MOA.PDH.N.AR_10PLUS$lag),digits=4)*100
MOA.PDH.N.AR_10PLUS$lag[MOA.PDH.N.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.PDH.N.AR_10PLUS$diff[MOA.PDH.N.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.PDH.N.AR_10PLUS$diffpc[MOA.PDH.N.AR_10PLUS$date=="2019-09-30"] <- NA

### BTL
#### Total
MOA.BTL.N.AR_T <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears")
MOA.BTL.N.AR_T$lag <- lag(MOA.BTL.N.AR_T$value)
MOA.BTL.N.AR_T$diff <- MOA.BTL.N.AR_T$value - MOA.BTL.N.AR_T$lag 
MOA.BTL.N.AR_T$diffpc <- round((MOA.BTL.N.AR_T$diff/MOA.BTL.N.AR_T$lag),digits=4)*100
MOA.BTL.N.AR_T$lag[MOA.BTL.N.AR_T$date=="2012-06-29"] <- NA
MOA.BTL.N.AR_T$diff[MOA.BTL.N.AR_T$date=="2012-06-29"] <- NA
MOA.BTL.N.AR_T$diffpc[MOA.BTL.N.AR_T$date=="2012-06-29"] <- NA

#### up to 90 days
MOA.BTL.N.AR_90 <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - up to 90 days")
MOA.BTL.N.AR_90$lag <- lag(MOA.BTL.N.AR_90$value)
MOA.BTL.N.AR_90$diff <- MOA.BTL.N.AR_90$value - MOA.BTL.N.AR_90$lag 
MOA.BTL.N.AR_90$diffpc <- round((MOA.BTL.N.AR_90$diff/MOA.BTL.N.AR_90$lag),digits=4)*100
MOA.BTL.N.AR_90$lag[MOA.BTL.N.AR_90$date=="2012-06-29"] <- NA
MOA.BTL.N.AR_90$diff[MOA.BTL.N.AR_90$date=="2012-06-29"] <- NA
MOA.BTL.N.AR_90$diffpc[MOA.BTL.N.AR_90$date=="2012-06-29"] <- NA

#### 91 to 180 days
MOA.BTL.N.AR_180 <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 91 to 180 days")
MOA.BTL.N.AR_180$lag <- lag(MOA.BTL.N.AR_180$value)
MOA.BTL.N.AR_180$diff <- MOA.BTL.N.AR_180$value - MOA.BTL.N.AR_180$lag 
MOA.BTL.N.AR_180$diffpc <- round((MOA.BTL.N.AR_180$diff/MOA.BTL.N.AR_180$lag),digits=4)*100
MOA.BTL.N.AR_180$lag[MOA.BTL.N.AR_180$date=="2012-06-29"] <- NA
MOA.BTL.N.AR_180$diff[MOA.BTL.N.AR_180$date=="2012-06-29"] <- NA
MOA.BTL.N.AR_180$diffpc[MOA.BTL.N.AR_180$date=="2012-06-29"] <- NA

#### 181 to 365 days
MOA.BTL.N.AR_365 <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 181 to 365 days")
MOA.BTL.N.AR_365$lag <- lag(MOA.BTL.N.AR_365$value)
MOA.BTL.N.AR_365$diff <- MOA.BTL.N.AR_365$value - MOA.BTL.N.AR_365$lag 
MOA.BTL.N.AR_365$diffpc <- round((MOA.BTL.N.AR_365$diff/MOA.BTL.N.AR_365$lag),digits=4)*100
MOA.BTL.N.AR_365$lag[MOA.BTL.N.AR_365$date=="2012-09-28"] <- NA
MOA.BTL.N.AR_365$diff[MOA.BTL.N.AR_365$date=="2012-09-28"] <- NA
MOA.BTL.N.AR_365$diffpc[MOA.BTL.N.AR_365$date=="2012-09-28"] <- NA

#### 365 to 730 days (2YR)
MOA.BTL.N.AR_2YR <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 365 to 730 days (1 to 2 YRS)")
MOA.BTL.N.AR_2YR$lag <- lag(MOA.BTL.N.AR_2YR$value)
MOA.BTL.N.AR_2YR$diff <- MOA.BTL.N.AR_2YR$value - MOA.BTL.N.AR_2YR$lag 
MOA.BTL.N.AR_2YR$diffpc <- round((MOA.BTL.N.AR_2YR$diff/MOA.BTL.N.AR_2YR$lag),digits=4)*100
MOA.BTL.N.AR_2YR$lag[MOA.BTL.N.AR_2YR$date=="2012-09-28"] <- NA
MOA.BTL.N.AR_2YR$diff[MOA.BTL.N.AR_2YR$date=="2012-09-28"] <- NA
MOA.BTL.N.AR_2YR$diffpc[MOA.BTL.N.AR_2YR$date=="2012-09-28"] <- NA

#### 2 to 5 YR
MOA.BTL.N.AR_5YR <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 2 to 5 yrs")
MOA.BTL.N.AR_5YR$lag <- lag(MOA.BTL.N.AR_5YR$value)
MOA.BTL.N.AR_5YR$diff <- MOA.BTL.N.AR_5YR$value - MOA.BTL.N.AR_5YR$lag 
MOA.BTL.N.AR_5YR$diffpc <- round((MOA.BTL.N.AR_5YR$diff/MOA.BTL.N.AR_5YR$lag),digits=4)*100
MOA.BTL.N.AR_5YR$lag[MOA.BTL.N.AR_5YR$date=="2019-09-30"] <- NA
MOA.BTL.N.AR_5YR$diff[MOA.BTL.N.AR_5YR$date=="2019-09-30"] <- NA
MOA.BTL.N.AR_5YR$diffpc[MOA.BTL.N.AR_5YR$date=="2019-09-30"] <- NA

#### 5 to 10 YR
MOA.BTL.N.AR_10YR <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 5 to 10 yrs")
MOA.BTL.N.AR_10YR$lag <- lag(MOA.BTL.N.AR_10YR$value)
MOA.BTL.N.AR_10YR$diff <- MOA.BTL.N.AR_10YR$value - MOA.BTL.N.AR_10YR$lag 
MOA.BTL.N.AR_10YR$diffpc <- round((MOA.BTL.N.AR_10YR$diff/MOA.BTL.N.AR_10YR$lag),digits=4)*100
MOA.BTL.N.AR_10YR$lag[MOA.BTL.N.AR_10YR$date=="2019-09-30"] <- NA
MOA.BTL.N.AR_10YR$diff[MOA.BTL.N.AR_10YR$date=="2019-09-30"] <- NA
MOA.BTL.N.AR_10YR$diffpc[MOA.BTL.N.AR_10YR$date=="2019-09-30"] <- NA

#### 10 YR Plus
MOA.BTL.N.AR_10PLUS <- MOA.BTL.N.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - over 10 yrs")
MOA.BTL.N.AR_10PLUS$lag <- lag(MOA.BTL.N.AR_10PLUS$value)
MOA.BTL.N.AR_10PLUS$diff <- MOA.BTL.N.AR_10PLUS$value - MOA.BTL.N.AR_10PLUS$lag 
MOA.BTL.N.AR_10PLUS$diffpc <- round((MOA.BTL.N.AR_10PLUS$diff/MOA.BTL.N.AR_10PLUS$lag),digits=4)*100
MOA.BTL.N.AR_10PLUS$lag[MOA.BTL.N.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.BTL.N.AR_10PLUS$diff[MOA.BTL.N.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.BTL.N.AR_10PLUS$diffpc[MOA.BTL.N.AR_10PLUS$date=="2019-09-30"] <- NA


## B: Arrears (2) Balance € (000)
MOA.PDH.B.AR <- MOA.PDH.B %>%
  filter(Category == "Arrears")
MOA.BTL.B.AR <- MOA.BTL.B %>%
  filter(Category == "Arrears")

### PDH
#### Total
MOA.PDH.B.AR_T <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears")
MOA.PDH.B.AR_T$lag <- lag(MOA.PDH.B.AR_T$value)
MOA.PDH.B.AR_T$diff <- MOA.PDH.B.AR_T$value - MOA.PDH.B.AR_T$lag 
MOA.PDH.B.AR_T$diffpc <- round((MOA.PDH.B.AR_T$diff/MOA.PDH.B.AR_T$lag),digits=4)*100
MOA.PDH.B.AR_T$lag[MOA.PDH.B.AR_T$date=="2009-09-30"] <- NA
MOA.PDH.B.AR_T$diff[MOA.PDH.B.AR_T$date=="2009-09-30"] <- NA
MOA.PDH.B.AR_T$diffpc[MOA.PDH.B.AR_T$date=="2009-09-30"] <- NA

#### up to 90 days
MOA.PDH.B.AR_90 <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - up to 90 days")
MOA.PDH.B.AR_90$lag <- lag(MOA.PDH.B.AR_90$value)
MOA.PDH.B.AR_90$diff <- MOA.PDH.B.AR_90$value - MOA.PDH.B.AR_90$lag 
MOA.PDH.B.AR_90$diffpc <- round((MOA.PDH.B.AR_90$diff/MOA.PDH.B.AR_90$lag),digits=4)*100
MOA.PDH.B.AR_90$lag[MOA.PDH.B.AR_90$date=="2009-09-30"] <- NA
MOA.PDH.B.AR_90$diff[MOA.PDH.B.AR_90$date=="2009-09-30"] <- NA
MOA.PDH.B.AR_90$diffpc[MOA.PDH.B.AR_90$date=="2009-09-30"] <- NA

#### 91 to 180 days
MOA.PDH.B.AR_180 <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 91 to 180 days")
MOA.PDH.B.AR_180$lag <- lag(MOA.PDH.B.AR_180$value)
MOA.PDH.B.AR_180$diff <- MOA.PDH.B.AR_180$value - MOA.PDH.B.AR_180$lag 
MOA.PDH.B.AR_180$diffpc <- round((MOA.PDH.B.AR_180$diff/MOA.PDH.B.AR_180$lag),digits=4)*100
MOA.PDH.B.AR_180$lag[MOA.PDH.B.AR_180$date=="2009-09-30"] <- NA
MOA.PDH.B.AR_180$diff[MOA.PDH.B.AR_180$date=="2009-09-30"] <- NA
MOA.PDH.B.AR_180$diffpc[MOA.PDH.B.AR_180$date=="2009-09-30"] <- NA

#### 181 to 365 days
MOA.PDH.B.AR_365 <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 181 to 365 days")
MOA.PDH.B.AR_365$lag <- lag(MOA.PDH.B.AR_365$value)
MOA.PDH.B.AR_365$diff <- MOA.PDH.B.AR_365$value - MOA.PDH.B.AR_365$lag 
MOA.PDH.B.AR_365$diffpc <- round((MOA.PDH.B.AR_365$diff/MOA.PDH.B.AR_365$lag),digits=4)*100
MOA.PDH.B.AR_365$lag[MOA.PDH.B.AR_365$date=="2012-09-28"] <- NA
MOA.PDH.B.AR_365$diff[MOA.PDH.B.AR_365$date=="2012-09-28"] <- NA
MOA.PDH.B.AR_365$diffpc[MOA.PDH.B.AR_365$date=="2012-09-28"] <- NA

#### 365 to 730 days (2YR)
MOA.PDH.B.AR_2YR <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 365 to 730 days (1 to 2 YRS)")
MOA.PDH.B.AR_2YR$lag <- lag(MOA.PDH.B.AR_2YR$value)
MOA.PDH.B.AR_2YR$diff <- MOA.PDH.B.AR_2YR$value - MOA.PDH.B.AR_2YR$lag 
MOA.PDH.B.AR_2YR$diffpc <- round((MOA.PDH.B.AR_2YR$diff/MOA.PDH.B.AR_2YR$lag),digits=4)*100
MOA.PDH.B.AR_2YR$lag[MOA.PDH.B.AR_2YR$date=="2012-09-28"] <- NA
MOA.PDH.B.AR_2YR$diff[MOA.PDH.B.AR_2YR$date=="2012-09-28"] <- NA
MOA.PDH.B.AR_2YR$diffpc[MOA.PDH.B.AR_2YR$date=="2012-09-28"] <- NA

#### 2 to 5 YR
MOA.PDH.B.AR_5YR <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 2 to 5 yrs")
MOA.PDH.B.AR_5YR$lag <- lag(MOA.PDH.B.AR_5YR$value)
MOA.PDH.B.AR_5YR$diff <- MOA.PDH.B.AR_5YR$value - MOA.PDH.B.AR_5YR$lag 
MOA.PDH.B.AR_5YR$diffpc <- round((MOA.PDH.B.AR_5YR$diff/MOA.PDH.B.AR_5YR$lag),digits=4)*100
MOA.PDH.B.AR_5YR$lag[MOA.PDH.B.AR_5YR$date=="2019-09-30"] <- NA
MOA.PDH.B.AR_5YR$diff[MOA.PDH.B.AR_5YR$date=="2019-09-30"] <- NA
MOA.PDH.B.AR_5YR$diffpc[MOA.PDH.B.AR_5YR$date=="2019-09-30"] <- NA

#### 5 to 10 YR
MOA.PDH.B.AR_10YR <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 5 to 10 yrs")
MOA.PDH.B.AR_10YR$lag <- lag(MOA.PDH.B.AR_10YR$value)
MOA.PDH.B.AR_10YR$diff <- MOA.PDH.B.AR_10YR$value - MOA.PDH.B.AR_10YR$lag 
MOA.PDH.B.AR_10YR$diffpc <- round((MOA.PDH.B.AR_10YR$diff/MOA.PDH.B.AR_10YR$lag),digits=4)*100
MOA.PDH.B.AR_10YR$lag[MOA.PDH.B.AR_10YR$date=="2019-09-30"] <- NA
MOA.PDH.B.AR_10YR$diff[MOA.PDH.B.AR_10YR$date=="2019-09-30"] <- NA
MOA.PDH.B.AR_10YR$diffpc[MOA.PDH.B.AR_10YR$date=="2019-09-30"] <- NA

#### 10 YR Plus
MOA.PDH.B.AR_10PLUS <- MOA.PDH.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - over 10 yrs")
MOA.PDH.B.AR_10PLUS$lag <- lag(MOA.PDH.B.AR_10PLUS$value)
MOA.PDH.B.AR_10PLUS$diff <- MOA.PDH.B.AR_10PLUS$value - MOA.PDH.B.AR_10PLUS$lag 
MOA.PDH.B.AR_10PLUS$diffpc <- round((MOA.PDH.B.AR_10PLUS$diff/MOA.PDH.B.AR_10PLUS$lag),digits=4)*100
MOA.PDH.B.AR_10PLUS$lag[MOA.PDH.B.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.PDH.B.AR_10PLUS$diff[MOA.PDH.B.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.PDH.B.AR_10PLUS$diffpc[MOA.PDH.B.AR_10PLUS$date=="2019-09-30"] <- NA

### BTL
#### Total
MOA.BTL.B.AR_T <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears")
MOA.BTL.B.AR_T$lag <- lag(MOA.BTL.B.AR_T$value)
MOA.BTL.B.AR_T$diff <- MOA.BTL.B.AR_T$value - MOA.BTL.B.AR_T$lag 
MOA.BTL.B.AR_T$diffpc <- round((MOA.BTL.B.AR_T$diff/MOA.BTL.B.AR_T$lag),digits=4)*100
MOA.BTL.B.AR_T$lag[MOA.BTL.B.AR_T$date=="2012-06-29"] <- NA
MOA.BTL.B.AR_T$diff[MOA.BTL.B.AR_T$date=="2012-06-29"] <- NA
MOA.BTL.B.AR_T$diffpc[MOA.BTL.B.AR_T$date=="2012-06-29"] <- NA

#### up to 90 days
MOA.BTL.B.AR_90 <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - up to 90 days")
MOA.BTL.B.AR_90$lag <- lag(MOA.BTL.B.AR_90$value)
MOA.BTL.B.AR_90$diff <- MOA.BTL.B.AR_90$value - MOA.BTL.B.AR_90$lag 
MOA.BTL.B.AR_90$diffpc <- round((MOA.BTL.B.AR_90$diff/MOA.BTL.B.AR_90$lag),digits=4)*100
MOA.BTL.B.AR_90$lag[MOA.BTL.B.AR_90$date=="2012-06-29"] <- NA
MOA.BTL.B.AR_90$diff[MOA.BTL.B.AR_90$date=="2012-06-29"] <- NA
MOA.BTL.B.AR_90$diffpc[MOA.BTL.B.AR_90$date=="2012-06-29"] <- NA

#### 91 to 180 days
MOA.BTL.B.AR_180 <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 91 to 180 days")
MOA.BTL.B.AR_180$lag <- lag(MOA.BTL.B.AR_180$value)
MOA.BTL.B.AR_180$diff <- MOA.BTL.B.AR_180$value - MOA.BTL.B.AR_180$lag 
MOA.BTL.B.AR_180$diffpc <- round((MOA.BTL.B.AR_180$diff/MOA.BTL.B.AR_180$lag),digits=4)*100
MOA.BTL.B.AR_180$lag[MOA.BTL.B.AR_180$date=="2012-06-29"] <- NA
MOA.BTL.B.AR_180$diff[MOA.BTL.B.AR_180$date=="2012-06-29"] <- NA
MOA.BTL.B.AR_180$diffpc[MOA.BTL.B.AR_180$date=="2012-06-29"] <- NA

#### 181 to 365 days
MOA.BTL.B.AR_365 <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 181 to 365 days")
MOA.BTL.B.AR_365$lag <- lag(MOA.BTL.B.AR_365$value)
MOA.BTL.B.AR_365$diff <- MOA.BTL.B.AR_365$value - MOA.BTL.B.AR_365$lag 
MOA.BTL.B.AR_365$diffpc <- round((MOA.BTL.B.AR_365$diff/MOA.BTL.B.AR_365$lag),digits=4)*100
MOA.BTL.B.AR_365$lag[MOA.BTL.B.AR_365$date=="2012-09-28"] <- NA
MOA.BTL.B.AR_365$diff[MOA.BTL.B.AR_365$date=="2012-09-28"] <- NA
MOA.BTL.B.AR_365$diffpc[MOA.BTL.B.AR_365$date=="2012-09-28"] <- NA

#### 365 to 730 days (2YR)
MOA.BTL.B.AR_2YR <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 365 to 730 days (1 to 2 YRS)")
MOA.BTL.B.AR_2YR$lag <- lag(MOA.BTL.B.AR_2YR$value)
MOA.BTL.B.AR_2YR$diff <- MOA.BTL.B.AR_2YR$value - MOA.BTL.B.AR_2YR$lag 
MOA.BTL.B.AR_2YR$diffpc <- round((MOA.BTL.B.AR_2YR$diff/MOA.BTL.B.AR_2YR$lag),digits=4)*100
MOA.BTL.B.AR_2YR$lag[MOA.BTL.B.AR_2YR$date=="2012-09-28"] <- NA
MOA.BTL.B.AR_2YR$diff[MOA.BTL.B.AR_2YR$date=="2012-09-28"] <- NA
MOA.BTL.B.AR_2YR$diffpc[MOA.BTL.B.AR_2YR$date=="2012-09-28"] <- NA

#### 2 to 5 YR
MOA.BTL.B.AR_5YR <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 2 to 5 yrs")
MOA.BTL.B.AR_5YR$lag <- lag(MOA.BTL.B.AR_5YR$value)
MOA.BTL.B.AR_5YR$diff <- MOA.BTL.B.AR_5YR$value - MOA.BTL.B.AR_5YR$lag 
MOA.BTL.B.AR_5YR$diffpc <- round((MOA.BTL.B.AR_5YR$diff/MOA.BTL.B.AR_5YR$lag),digits=4)*100
MOA.BTL.B.AR_5YR$lag[MOA.BTL.B.AR_5YR$date=="2019-09-30"] <- NA
MOA.BTL.B.AR_5YR$diff[MOA.BTL.B.AR_5YR$date=="2019-09-30"] <- NA
MOA.BTL.B.AR_5YR$diffpc[MOA.BTL.B.AR_5YR$date=="2019-09-30"] <- NA

#### 5 to 10 YR
MOA.BTL.B.AR_10YR <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - 5 to 10 yrs")
MOA.BTL.B.AR_10YR$lag <- lag(MOA.BTL.B.AR_10YR$value)
MOA.BTL.B.AR_10YR$diff <- MOA.BTL.B.AR_10YR$value - MOA.BTL.B.AR_10YR$lag 
MOA.BTL.B.AR_10YR$diffpc <- round((MOA.BTL.B.AR_10YR$diff/MOA.BTL.B.AR_10YR$lag),digits=4)*100
MOA.BTL.B.AR_10YR$lag[MOA.BTL.B.AR_10YR$date=="2019-09-30"] <- NA
MOA.BTL.B.AR_10YR$diff[MOA.BTL.B.AR_10YR$date=="2019-09-30"] <- NA
MOA.BTL.B.AR_10YR$diffpc[MOA.BTL.B.AR_10YR$date=="2019-09-30"] <- NA

#### 10 YR Plus
MOA.BTL.B.AR_10PLUS <- MOA.BTL.B.AR %>%
  filter(Sub.Category == "Arrears: Total mortgage accounts in arrears - over 10 yrs")
MOA.BTL.B.AR_10PLUS$lag <- lag(MOA.BTL.B.AR_10PLUS$value)
MOA.BTL.B.AR_10PLUS$diff <- MOA.BTL.B.AR_10PLUS$value - MOA.BTL.B.AR_10PLUS$lag 
MOA.BTL.B.AR_10PLUS$diffpc <- round((MOA.BTL.B.AR_10PLUS$diff/MOA.BTL.B.AR_10PLUS$lag),digits=4)*100
MOA.BTL.B.AR_10PLUS$lag[MOA.BTL.B.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.BTL.B.AR_10PLUS$diff[MOA.BTL.B.AR_10PLUS$date=="2019-09-30"] <- NA
MOA.BTL.B.AR_10PLUS$diffpc[MOA.BTL.B.AR_10PLUS$date=="2019-09-30"] <- NA

## B: Repossessions
## C: Restructures



# Step 3. Total Bank & Non-bank to group by subcategory then facet by "Format" [BTL / PDH] 
MOA.SUM.B.AR <- MOA %>%
  filter(Unit =="Balance € (000)") %>%
  filter(Category == "Arrears") %>% 
  filter(Sub.Category != "Arrears: Total mortgage accounts in arrears") 

MOA.SUM.B.AR <- MOA.SUM.B.AR %>%
  group_by(Format,date,Sub.Category,Unit)%>%
  summarise(total=sum(value))
#########################################
options(scipen = 999)
######## Number
############ PDH
################ Figure 1                   # KEEP
Fig1A <- ggplot(MOA.PDH.N.AR_T,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Total mortgage accounts in arrears")

Fig1B <- ggplot(MOA.PDH.N.AR_T,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig1 <- Fig1A + Fig1B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 2                   # KEEP
Fig2A <- ggplot(MOA.PDH.N.AR_90,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: up to 90 days")

Fig2B <- ggplot(MOA.PDH.N.AR_90,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig2 <- Fig2A + Fig2B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 3
Fig3A <- ggplot(MOA.PDH.N.AR_180,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 91 to 180 days")

Fig3B <- ggplot(MOA.PDH.N.AR_180,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig3 <- Fig3A + Fig3B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 4                   # KEEP
Fig4A <- ggplot(MOA.PDH.N.AR_365,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 180  to 365 days")

Fig4B <- ggplot(MOA.PDH.N.AR_365,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig4 <- Fig4A + Fig4B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 5
Fig5A <- ggplot(MOA.PDH.N.AR_2YR,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 365 to 730 days (1 to 2 years)")

Fig5B <- ggplot(MOA.PDH.N.AR_2YR,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig5 <- Fig5A + Fig5B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 6                   # KEEP
Fig6A <- ggplot(MOA.PDH.N.AR_5YR,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 2 to 5 years")

Fig6B <- ggplot(MOA.PDH.N.AR_5YR,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig6 <- Fig6A + Fig6B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 7
Fig7A <- ggplot(MOA.PDH.N.AR_10YR,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 5 to 10 years")

Fig7B <- ggplot(MOA.PDH.N.AR_10YR,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig7 <- Fig7A + Fig7B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 8
Fig8A <- ggplot(MOA.PDH.N.AR_10PLUS,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Principal Residences (PDH)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: over 10 years")

Fig8B <- ggplot(MOA.PDH.N.AR_10PLUS,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig8 <- Fig8A + Fig8B + plot_layout(nrow=2,heights=c(2,1))
############ BTL
################ Figure 9                   # KEEP
Fig9A <- ggplot(MOA.BTL.N.AR_T,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Total mortgage accounts in arrears")

Fig9B <- ggplot(MOA.BTL.N.AR_T,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig9 <- Fig9A + Fig9B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 10                   # KEEP
Fig10A <- ggplot(MOA.BTL.N.AR_90,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: up to 90 days")

Fig10B <- ggplot(MOA.BTL.N.AR_90,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig10 <- Fig10A + Fig10B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 11
Fig11A <- ggplot(MOA.BTL.N.AR_180,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 91 to 180 days")

Fig11B <- ggplot(MOA.BTL.N.AR_180,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig11 <- Fig11A + Fig11B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 12                   # KEEP
Fig12A <- ggplot(MOA.BTL.N.AR_365,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 180  to 365 days")

Fig12B <- ggplot(MOA.BTL.N.AR_365,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig12 <- Fig12A + Fig12B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 13
Fig13A <- ggplot(MOA.BTL.N.AR_2YR,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 365 to 730 days (1 to 2 years)")

Fig13B <- ggplot(MOA.BTL.N.AR_2YR,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig13 <- Fig13A + Fig13B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 14                   # KEEP
Fig14A <- ggplot(MOA.BTL.N.AR_5YR,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 2 to 5 years")

Fig14B <- ggplot(MOA.BTL.N.AR_5YR,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig14 <- Fig14A + Fig14B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 15
Fig15A <- ggplot(MOA.BTL.N.AR_10YR,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: 5 to 10 years")

Fig15B <- ggplot(MOA.BTL.N.AR_10YR,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig15 <- Fig15A + Fig15B + plot_layout(nrow=2,heights=c(2,1))

################ Figure 16
Fig16A <- ggplot(MOA.BTL.N.AR_10PLUS,aes(x=date,y=value,group=Entity.Group,colour=Entity.Group))+
  geom_line(alpha=0.6,size=1.25)+
  geom_text_repel(aes(label=value),size=2.75)+
  theme_bw()+
  theme(legend.position = "none") +
  ggtitle("Mortgage Arrears - Buy to Let (BTL)")+
  ylab("Number of accounts")+
  xlab(NULL)+
  labs(subtitle = "Accounts in arrears: over 10 years")

Fig16B <- ggplot(MOA.BTL.N.AR_10PLUS,aes(x=date,y=diffpc,group=Entity.Group,colour=Entity.Group,fill=Entity.Group))+
  geom_col(alpha=0.2)+
  geom_text_repel(aes(label=diffpc),size=2.75)+
  theme_bw()+
  theme(legend.position = "bottom") +
  ylab("Percentage")+
  labs(caption = "Source: Central Bank of Ireland")

Fig16 <- Fig16A + Fig16B + plot_layout(nrow=2,heights=c(2,1))

######################## Create Panels
Fig.Tot <- Fig1A + Fig9A + Fig1B + Fig9B + plot_layout(heights = c(2,1)) # keep

Fig.90 <- Fig2A + Fig10A + Fig2B + Fig10B + plot_layout(heights = c(2,1)) # keep

Fig.180 <- Fig3A + Fig11A + Fig3B + Fig11B + plot_layout(heights = c(2,1))

Fig.365 <- Fig4A + Fig12A + Fig4B + Fig12B + plot_layout(heights = c(2,1))

Fig.2YR <- Fig5A + Fig13A + Fig5B + Fig13B + plot_layout(heights = c(2,1)) # keep

Fig.5YR <- Fig6A + Fig14A + Fig6B + Fig14B + plot_layout(heights = c(2,1))

Fig.10YR <- Fig7A + Fig15A + Fig7B + Fig15B + plot_layout(heights = c(2,1))

Fig.10PLUS <- Fig8A + Fig15A + Fig8B + Fig15B + plot_layout(heights = c(2,1))

Fig.Tot

Fig.90

Fig.2YR

FED data

Without stating the obvious given the volatile nature of the data for Non Performing Loans (NPL) in Ireland, the international trends will likely be informative.

# Load data from FRED https://fred.stlouisfed.org/series/DDSI02IEA156NWDB
## API KEY
fredr_set_key("8ad77f66768f9eb1e07da54d943df8f0")

## Bank Non-Performing Loans to Gross Loans
###for Ireland
NPL.IE<-fredr(series_id = "DDSI02IEA156NWDB",
  observation_start = as.Date("1998-01-01"),
  observation_end = as.Date("2019-01-01"))

###for Germany
NPL.DE<-fredr(series_id = "DDSI02DEA156NWDB",
               observation_start = as.Date("1998-01-01"),
               observation_end = as.Date("2019-01-01"))

###for USA
NPL.US<-fredr(series_id = "DDSI02USA156NWDB",
              observation_start = as.Date("1998-01-01"),
              observation_end = as.Date("2019-01-01"))

###for Italy
NPL.IT<-fredr(series_id = "DDSI02ITA156NWDB",
              observation_start = as.Date("1998-01-01"),
              observation_end = as.Date("2019-01-01"))

###for UK
NPL.UK<-fredr(series_id = "DDSI02GBA156NWDB",
              observation_start = as.Date("1998-01-01"),
              observation_end = as.Date("2019-01-01"))

###for France
NPL.FR<-fredr(series_id = "DDSI02FRA156NWDB",
              observation_start = as.Date("1998-01-01"),
              observation_end = as.Date("2019-01-01"))


### Bind NPL
NPL.IE$country <- "IE"
NPL.DE$country <- "DE"
NPL.FR$country <- "FR"
NPL.IT$country <- "IT"
NPL.UK$country <- "UK"
NPL.US$country <- "US"

NPL.1 <- rbind(NPL.IE,NPL.DE,NPL.FR,NPL.IT,NPL.UK,NPL.US)

ggplot(NPL.1,aes(x=date,y=value,group=country,colour=country))+
  geom_line()+
  theme_bw()+
  geom_text_repel(aes(label=round(value,2)),size=2.75,colour="#666666")+
  theme(legend.position="none")+
  ggtitle("Bank Non-Performing Loans to Gross Loans")+
  ylab("percent")+
  xlab("year")+facet_wrap(~country,ncol=2)+
  labs(caption = "Source: FRED")