Objective.

Establish the relationship between Consumer Debt Burden and Economic Growth.

The Data.

Source, Frequency & Range

World Bank.

Yearly.

1980 - 2019

1993 - 2019

Variables

Consumption.

Agriculture.

Net Exports.

Growth.

Consumer Debt Burden

Private Debt / Income.

Private Debt / Income (Stocks).

Model Specification.

Debt Burden & Growth

Yt= α10 + α11Yt-1 +…+ α1pYt-p + β11Xt-1 +…+ β1pXt-p

Xt= α20 + α21Yt-1 +…+ α2pYt-p + β21Xt-1 +…+ β2pXt-p

Y - Debt Burden.

X - Growth.

Debt Burden & Factors Influencing Growth

Yt= α10 + α11Yt-1 +..+ α1pYt-p+ β11Xt-1 +..+ β1pXt-p + δ11Zt-1 +..+ δ1pZt-p + Φ11Vt-1 +..+ Φ1pVt-p

.

.

.

Vt= α40+ α41Yt-1 +..+ α4pYt-p + β41Xt-1+..+ β4pXt-p + δ41Zt-1 +..+ δ4pZt-p + Φ41Vt-1 +..+ Φ4pVt-p

Y - Debt Burden.

X - Consumption.

Z - Agriculture.

V - Net Exports.

Packages Used.

This are the statistical and econometric packages used for this analysis

library(readxl)
## Warning: package 'readxl' was built under R version 3.6.3
library(tidyquant)
## Warning: package 'lubridate' was built under R version 3.6.3
## Warning: package 'PerformanceAnalytics' was built under R version 3.6.3
## Warning: package 'xts' was built under R version 3.6.3
## Warning: package 'zoo' was built under R version 3.6.3
## Warning: package 'quantmod' was built under R version 3.6.3
## Warning: package 'TTR' was built under R version 3.6.3
library(tseries)
## Warning: package 'tseries' was built under R version 3.6.3
library(fBasics)
## Warning: package 'fBasics' was built under R version 3.6.3
## Warning: package 'timeDate' was built under R version 3.6.3
## Warning: package 'timeSeries' was built under R version 3.6.3
library(normtest)
library(forecast)
## Warning: package 'forecast' was built under R version 3.6.3
library(urca)
## Warning: package 'urca' was built under R version 3.6.3
library(vars)
## Warning: package 'vars' was built under R version 3.6.3
## Warning: package 'strucchange' was built under R version 3.6.3
## Warning: package 'sandwich' was built under R version 3.6.3
## Warning: package 'lmtest' was built under R version 3.6.3
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.6.3
library(lmtest)
library(mFilter)
## Warning: package 'mFilter' was built under R version 3.6.3
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 3.6.3
## Warning: package 'ggplot2' was built under R version 3.6.3
## Warning: package 'tibble' was built under R version 3.6.3
## Warning: package 'tidyr' was built under R version 3.6.3
## Warning: package 'readr' was built under R version 3.6.3
## Warning: package 'purrr' was built under R version 3.6.3
## Warning: package 'stringr' was built under R version 3.6.3
## Warning: package 'forcats' was built under R version 3.6.3
library(svars)
## Warning: package 'svars' was built under R version 3.6.3
library(rtf)
## Warning: package 'rtf' was built under R version 3.6.3
library(lmtest)
library(mFilter)
library(tidyverse)
library(svars)
library(rtf)
library(tsDyn)
## Warning: package 'tsDyn' was built under R version 3.6.3
library(aod)
## Warning: package 'aod' was built under R version 3.6.3

Setting working directory and importing data.

Note that working directory should be changed for replication purposes.

setwd("C:/Users/HP/OneDrive/Documents/BBS 4.1/Research/Research Codes")
data<-read_excel("~/Book1.xlsx")
daTA=read_excel("~/Book2.xlsx")
colnames(data)<-c("YEAR","PDEBT","CONS","INC","GROWTH","STOCKS","AGRIC","EXP","DBURDEN")
colnames(daTA)<-c("YEAR2","PDEBT2","CONS2","INC2","GROWTH2","STOCKS2","AGRIC2","EXP2","DBURDEN2")
data<-as.data.frame(data)
daTA=as.data.frame(daTA)

Descriptive Statistics.

This include the mean and variace and the rtffile function helps us export the table to word.

DATA=subset(data,select = -c(YEAR))
Descriptive_Stats<- basicStats(DATA)
Descriptive_Stats<- t(Descriptive_Stats)
Summary_Stats=subset(Descriptive_Stats,select = c(Minimum,Maximum,Mean,Median,Stdev,Skewness,Kurtosis))
subset(Descriptive_Stats,select = c(Minimum,Maximum,Mean,Median,Stdev,Skewness,Kurtosis))
##           Minimum  Maximum      Mean    Median    Stdev  Skewness  Kurtosis
## PDEBT   -4.132492 5.979962  0.164361 -0.179352 2.050080  0.127684  0.541197
## CONS    -5.909583 7.145463  0.296197  0.021849 2.861785  0.221903  0.750519
## INC     -4.982609 5.783640 -0.019257  0.375599 2.467468 -0.018533 -0.622787
## GROWTH  -0.799494 8.405699  3.970454  4.353389 2.284124 -0.333041 -0.957920
## STOCKS  -1.798716 2.481331  0.018137  0.000000 0.718151  0.644174  3.246805
## AGRIC   -3.716587 3.758899  0.099085  0.074834 1.421605 -0.102167  0.470213
## EXP     -2.687517 3.872383  0.151450  0.241005 1.555311  0.206267 -0.237120
## DBURDEN -6.918950 8.819477 -0.059483 -0.099107 2.421063  0.700942  4.004651
rtffile <- RTF("Descriptive_Stats.doc")
addText(rtffile, "\t\tTable 1: Descriptive statistics \n\n", bold=TRUE, italic=FALSE)
Variable<-rownames(Summary_Stats)
addHeader(rtffile, title="\\i Descriptive stats ")
addTable(rtffile, cbind(Variable, Summary_Stats), font.size=8)
done(rtffile)

Plotting individual variables.

We convert the individual variables into time series data and plot them for visualization.

PDEBT<-ts((data$PDEBT))
CONS<-ts((data$CONS))
INC<-ts((data$INC))
GROWTH<-ts(data$GROWTH)
STOCKS<-ts((data$STOCKS))
AGRIC<-ts((data$AGRIC))
EXP<-ts((data$EXP))
DBURDEN<-ts((data$DBURDEN))


plot(PDEBT)

plot(CONS)

plot(INC)

plot(GROWTH)

plot(STOCKS)

plot(AGRIC)

plot(EXP)

plot(DBURDEN)

Stationarity tests.

I use the augmented Dickey-Fuller test to investigate whether our varaibles are stationary.

adf.test(PDEBT)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  PDEBT
## Dickey-Fuller = -2.1292, Lag order = 3, p-value = 0.5228
## alternative hypothesis: stationary
adf.test(CONS)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  CONS
## Dickey-Fuller = -3.7387, Lag order = 3, p-value = 0.03488
## alternative hypothesis: stationary
adf.test(INC)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  INC
## Dickey-Fuller = -2.8251, Lag order = 3, p-value = 0.2496
## alternative hypothesis: stationary
adf.test(GROWTH)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  GROWTH
## Dickey-Fuller = -3.1206, Lag order = 3, p-value = 0.1337
## alternative hypothesis: stationary
adf.test(AGRIC)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  AGRIC
## Dickey-Fuller = -2.6813, Lag order = 3, p-value = 0.3061
## alternative hypothesis: stationary
adf.test(EXP)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  EXP
## Dickey-Fuller = -2.2976, Lag order = 3, p-value = 0.4567
## alternative hypothesis: stationary
adf.test(DBURDEN)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  DBURDEN
## Dickey-Fuller = -3.5067, Lag order = 3, p-value = 0.05552
## alternative hypothesis: stationary

STATIONARITY TEST RESULT

All variables are non-stationary hence we need to first difference them.

PDEBT_diff<-diff(PDEBT,differences=1)
INC_diff<-diff(INC,differences=1)
GROWTH_diff<-diff(GROWTH,differences=1)
AGRICS_diff<-diff(AGRIC,differences=1)
EXP_diff<-diff(EXP,differences=1)
DBURDEN_diff<-diff(DBURDEN,differences=1)

Stationarity tests on differenced data.

adf.test(PDEBT_diff)
## Warning in adf.test(PDEBT_diff): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  PDEBT_diff
## Dickey-Fuller = -5.018, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary
adf.test(INC_diff)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  INC_diff
## Dickey-Fuller = -4.0007, Lag order = 3, p-value = 0.02003
## alternative hypothesis: stationary
adf.test(GROWTH_diff)
## Warning in adf.test(GROWTH_diff): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  GROWTH_diff
## Dickey-Fuller = -4.8665, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary
adf.test(AGRICS_diff)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  AGRICS_diff
## Dickey-Fuller = -3.8795, Lag order = 3, p-value = 0.02471
## alternative hypothesis: stationary
adf.test(EXP_diff)
## Warning in adf.test(EXP_diff): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  EXP_diff
## Dickey-Fuller = -4.5271, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary
adf.test(DBURDEN_diff)
## Warning in adf.test(DBURDEN_diff): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  DBURDEN_diff
## Dickey-Fuller = -5.5287, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary

Normality tests.

Convert variables into vector format for the skewness and kurtosis test functions to operate on

PDEBT_diff_v<- as.vector(PDEBT_diff)
CONS_diff_v<- as.vector(CONS)
INC_diff_v<- as.vector(INC_diff)
GROWTH_diff_v<- as.vector(GROWTH_diff)
AGRICS_diff_v<- as.vector(AGRICS_diff)
EXP_diff_v<- as.vector(EXP_diff)
DBURDEN_diff_v<- as.vector(DBURDEN_diff)

NORMALITY TEST

t.test(PDEBT_diff_v)
## 
##  One Sample t-test
## 
## data:  PDEBT_diff_v
## t = -0.064831, df = 38, p-value = 0.9486
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -1.0658881  0.9997364
## sample estimates:
##   mean of x 
## -0.03307584
t.test(CONS_diff_v)
## 
##  One Sample t-test
## 
## data:  CONS_diff_v
## t = 0.6546, df = 39, p-value = 0.5166
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -0.6190462  1.2114402
## sample estimates:
## mean of x 
##  0.296197
t.test(INC_diff_v)
## 
##  One Sample t-test
## 
## data:  INC_diff_v
## t = -0.01401, df = 38, p-value = 0.9889
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -1.115116  1.099788
## sample estimates:
##    mean of x 
## -0.007664003
t.test(GROWTH_diff_v)
## 
##  One Sample t-test
## 
## data:  GROWTH_diff_v
## t = -0.015762, df = 38, p-value = 0.9875
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -0.7507999  0.7391985
## sample estimates:
##    mean of x 
## -0.005800699
t.test(AGRICS_diff_v)
## 
##  One Sample t-test
## 
## data:  AGRICS_diff_v
## t = 0.22418, df = 38, p-value = 0.8238
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -0.5037638  0.6292279
## sample estimates:
##  mean of x 
## 0.06273204
t.test(EXP_diff_v)
## 
##  One Sample t-test
## 
## data:  EXP_diff_v
## t = -0.32399, df = 38, p-value = 0.7477
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -0.7695859  0.5572389
## sample estimates:
##  mean of x 
## -0.1061735
t.test(DBURDEN_diff_v)
## 
##  One Sample t-test
## 
## data:  DBURDEN_diff_v
## t = 0.015532, df = 38, p-value = 0.9877
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -1.067867  1.084380
## sample estimates:
##  mean of x 
## 0.00825669

NORMALITY TEST RESULTS All variables are normally distributed.

Cointegration Test.

I used a Johansen cointegration test for this. Since all my variables were non stationary, I will test them as a whole set.

dset=cbind(GROWTH,DBURDEN)
VARselect(dset,lag.max = 10,type = "const")
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##     10      1      1      1 
## 
## $criteria
##                1         2         3         4         5         6         7
## AIC(n)  3.647539  3.836779  3.993302  4.183261  4.303555  3.994634  3.800391
## HQ(n)   3.737190  3.986198  4.202487  4.452214  4.632275  4.383122  4.248646
## SC(n)   3.927778  4.303845  4.647194  5.023979  5.331100  5.209005  5.201589
## FPE(n) 38.431597 46.667919 55.191867 68.124650 79.452103 61.391692 54.468130
##                8         9        10
## AIC(n)  3.765603  3.857608  3.280853
## HQ(n)   4.273626  4.425397  3.908410
## SC(n)   5.353627  5.632458  5.242529
## FPE(n) 58.517917 74.598801 51.938211
cointest<-ca.jo(dset,K=2,type = "trace", ecdet = "const", spec = "transitory")
cointest
## 
## ##################################################### 
## # Johansen-Procedure Unit Root / Cointegration Test # 
## ##################################################### 
## 
## The value of the test statistic is: 9.3655 21.8973
print('H0 r=0')
## [1] "H0 r=0"
cointest@teststat[2]
## [1] 21.89727
print('H0 r=1')
## [1] "H0 r=1"
cointest@teststat[1]
## [1] 9.365487
cointest@cval
##          10pct  5pct  1pct
## r <= 1 |  7.52  9.24 12.97
## r = 0  | 17.85 19.96 24.60
datset=cbind(CONS,AGRIC,EXP,DBURDEN)
VARselect(datset,lag.max = 10,type = "const")
## Warning in log(sigma.det): NaNs produced

## Warning in log(sigma.det): NaNs produced

## Warning in log(sigma.det): NaNs produced
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##      8      8      8      7 
## 
## $criteria
##                 1          2          3          4           5          6
## AIC(n)   6.132211   6.318066   5.721176   5.942213    5.700565  0.8761625
## HQ(n)    6.431048   6.855973   6.498151   6.958257    6.955679  2.3703461
## SC(n)    7.066343   7.999503   8.149918   9.118260    9.623918  5.5468205
## FPE(n) 466.270853 598.378347 390.120655 699.015006 1140.211813 44.7493508
##                    7    8    9   10
## AIC(n)           NaN -Inf -Inf -Inf
## HQ(n)            NaN -Inf -Inf -Inf
## SC(n)            NaN -Inf -Inf -Inf
## FPE(n) -5.296205e-47    0    0    0
cotest<-ca.jo(datset,K=7,type = "trace", ecdet = "const", spec = "transitory")
cotest
## 
## ##################################################### 
## # Johansen-Procedure Unit Root / Cointegration Test # 
## ##################################################### 
## 
## The value of the test statistic is: 2.7385 6.7538 50.7411 260.3002
print('H0 r=0')
## [1] "H0 r=0"
cotest@teststat[2]
## [1] 6.753805
print('H0 r=1')
## [1] "H0 r=1"
cotest@teststat[1]
## [1] 2.73853
cotest@cval
##          10pct  5pct  1pct
## r <= 3 |  7.52  9.24 12.97
## r <= 2 | 17.85 19.96 24.60
## r <= 1 | 32.00 34.91 41.07
## r = 0  | 49.65 53.12 60.16

Scatter plot of consumer debt burden and gdp growth.

This is for visual representation of the relationship between the two variables.

ggplot(data=data)+geom_point(mapping=aes(x=GROWTH,y=DBURDEN))

ggplot(data=data)+geom_point(mapping=aes(x=CONS,y=DBURDEN))

ggplot(data=data)+geom_point(mapping=aes(x=AGRIC,y=DBURDEN))

Determining how well the variable lags explain themselves.

acf(GROWTH,main="ACF for Growth")

pacf(GROWTH,main="PACF for Growth")

acf(CONS,main="ACF for Consumption")

pacf(CONS,main="PACF for Consumption")

acf(AGRIC,main="ACF for Agriculture")

pacf(AGRIC,main="PACF for Agriculture")

The VECM model.

MODEL1=VECM(dset,2,r=1,estim=("2OLS"))
summary(MODEL1)
## #############
## ###Model VECM 
## #############
## Full sample size: 40     End sample size: 37
## Number of variables: 2   Number of estimated slope parameters 12
## AIC 140.283  BIC 161.2249    SSR 410.0671
## Cointegrating vector (estimated by 2OLS):
##    GROWTH   DBURDEN
## r1      1 0.3995348
## 
## 
##                  ECT                 Intercept           GROWTH -1         
## Equation GROWTH  -0.5805(0.2244)*    2.3443(0.9303)*     0.1617(0.2069)    
## Equation DBURDEN -0.0121(0.3207)     -0.0083(1.3292)     0.0891(0.2957)    
##                  DBURDEN -1         GROWTH -2           DBURDEN -2         
## Equation GROWTH  0.1824(0.1451)     -0.0243(0.1835)     0.1985(0.1382)     
## Equation DBURDEN -0.6347(0.2074)**  -0.0246(0.2622)     -0.1623(0.1975)
MODEL2=VECM(datset,6,r=1,estim=("2OLS") )
summary(MODEL2) 
## #############
## ###Model VECM 
## #############
## Full sample size: 40     End sample size: 33
## Number of variables: 4   Number of estimated slope parameters 104
## AIC 135.9485     BIC 296.0748    SSR 130.1146
## Cointegrating vector (estimated by 2OLS):
##    CONS      AGRIC        EXP   DBURDEN
## r1    1 -0.2658077 0.02023288 0.1515156
## 
## 
##                  ECT                 Intercept          CONS -1           
## Equation CONS    -1.2922(1.0624)     0.6365(0.7923)     0.6154(0.8941)    
## Equation AGRIC   -0.6263(0.4753)     0.4663(0.3545)     0.5077(0.4000)    
## Equation EXP     -0.7518(0.4358)     0.5164(0.3250)     0.4184(0.3668)    
## Equation DBURDEN -0.1915(0.7258)     0.2203(0.5413)     0.1237(0.6108)    
##                  AGRIC -1            EXP -1             DBURDEN -1         
## Equation CONS    -1.3359(0.7890)     0.3125(0.5081)     0.3558(0.6732)     
## Equation AGRIC   -0.7471(0.3530).    -0.6728(0.2273)*   0.1386(0.3012)     
## Equation EXP     -0.3362(0.3237)     -0.4485(0.2084).   -0.0551(0.2762)    
## Equation DBURDEN -0.5133(0.5390)     -0.8053(0.3471).   -0.5879(0.4599)    
##                  CONS -2            AGRIC -2            EXP -2             
## Equation CONS    0.3647(0.8291)     -0.1020(0.8677)     -0.4958(0.8316)    
## Equation AGRIC   0.2768(0.3710)     -0.5546(0.3882)     -0.3689(0.3721)    
## Equation EXP     0.5058(0.3401)     -0.8832(0.3559)*    -0.3761(0.3411)    
## Equation DBURDEN 0.0253(0.5664)     -0.9010(0.5927)     -0.6755(0.5681)    
##                  DBURDEN -2          CONS -3            AGRIC -3           
## Equation CONS    0.3428(0.7544)      0.4771(0.7541)     0.5400(0.9161)     
## Equation AGRIC   0.3588(0.3375)      0.3358(0.3374)     -0.7571(0.4099)    
## Equation EXP     0.3557(0.3095)      0.4826(0.3093)     -0.0223(0.3758)    
## Equation DBURDEN -0.3676(0.5154)     0.4850(0.5152)     -1.2506(0.6258).   
##                  EXP -3              DBURDEN -3          CONS -4           
## Equation CONS    0.2161(1.0382)      0.1812(0.7462)      0.0518(0.7496)    
## Equation AGRIC   0.6097(0.4645)      0.3674(0.3339)      0.3661(0.3354)    
## Equation EXP     -0.3703(0.4259)     0.5652(0.3061)      0.5853(0.3075).   
## Equation DBURDEN -0.8524(0.7093)     -0.0276(0.5098)     0.4410(0.5121)    
##                  AGRIC -4            EXP -4              DBURDEN -4         
## Equation CONS    -0.0390(1.1591)     0.3564(1.0440)      0.2312(0.5811)     
## Equation AGRIC   0.4089(0.5186)      0.2996(0.4671)      0.3046(0.2600)     
## Equation EXP     -0.0783(0.4755)     0.1717(0.4283)      0.3542(0.2384)     
## Equation DBURDEN -0.8661(0.7919)     -0.4677(0.7132)     -0.1409(0.3970)    
##                  CONS -5            AGRIC -5            EXP -5             
## Equation CONS    0.1324(0.5543)     0.3454(1.0183)      0.3301(0.8123)     
## Equation AGRIC   0.1785(0.2480)     0.3829(0.4556)      0.5891(0.3635)     
## Equation EXP     0.2297(0.2274)     0.0573(0.4177)      0.1643(0.3332)     
## Equation DBURDEN 0.3915(0.3787)     -0.4801(0.6956)     -0.5237(0.5549)    
##                  DBURDEN -5         CONS -6             AGRIC -6           
## Equation CONS    0.4150(0.5110)     0.0053(0.4248)      0.0783(0.6117)     
## Equation AGRIC   0.3349(0.2287)     -0.0848(0.1901)     0.0050(0.2737)     
## Equation EXP     0.3694(0.2096)     0.1588(0.1743)      -0.5453(0.2509).   
## Equation DBURDEN 0.2391(0.3491)     -0.1198(0.2902)     -0.3577(0.4179)    
##                  EXP -6              DBURDEN -6         
## Equation CONS    0.3658(0.6930)      0.3957(0.4035)     
## Equation AGRIC   0.5812(0.3101)      0.1491(0.1805)     
## Equation EXP     0.0129(0.2843)      0.5409(0.1655)*    
## Equation DBURDEN -0.3649(0.4734)     -0.0916(0.2757)

Converting the VECM to a VAR for diagnostic trsts

MODEL1=vec2var(cointest,r=1)
MODEL2=vec2var(cotest,r=3)

Diagnosing our VAR model.

Test for serial correlation

Serial1=serial.test(MODEL1,lags.pt = 12,type = "PT.asymptotic")
Serial2=serial.test(MODEL2,lags.pt = 12,type = "PT.asymptotic")
Serial1
## 
##  Portmanteau Test (asymptotic)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 46.439, df = 42, p-value = 0.2945
Serial2
## 
##  Portmanteau Test (asymptotic)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 328.09, df = 84, p-value < 2.2e-16

Heteroskedasticity test

ARCH1=arch.test(MODEL1,lags.multi = 12,multivariate.only = TRUE)
ARCH2=arch.test(MODEL2,lags.multi = 12,multivariate.only = TRUE)
ARCH1
## 
##  ARCH (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 78, df = 108, p-value = 0.9869
ARCH2
## 
##  ARCH (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 210, df = 1200, p-value = 1

Normal distribution of the residuals

NORM1=normality.test(MODEL1,multivariate.only = TRUE)
NORM2=normality.test(MODEL2,multivariate.only = TRUE)
NORM1
## $JB
## 
##  JB-Test (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 3.0861, df = 4, p-value = 0.5435
## 
## 
## $Skewness
## 
##  Skewness only (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 1.1355, df = 2, p-value = 0.5668
## 
## 
## $Kurtosis
## 
##  Kurtosis only (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 1.9506, df = 2, p-value = 0.3771
NORM2
## $JB
## 
##  JB-Test (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 2.7984, df = 8, p-value = 0.9464
## 
## 
## $Skewness
## 
##  Skewness only (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 0.87322, df = 4, p-value = 0.9284
## 
## 
## $Kurtosis
## 
##  Kurtosis only (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 1.9252, df = 4, p-value = 0.7495

Impulse response functions.

GROWTHirf=irf(MODEL1,impulse = "DBURDEN",response = "GROWTH",n.ahead = 20,boot = TRUE)
DBURDENirf=irf(MODEL1,impulse = "GROWTH",response = "DBURDEN",n.ahead = 20,boot = TRUE)
AGRICSirf=irf(MODEL2,impulse = "DBURDEN",response = "AGRIC",n.ahead = 20,boot = TRUE)
DBURDENirf2=irf(MODEL2,impulse = "AGRIC",response = "DBURDEN",n.ahead = 20,boot = TRUE)
CONSirf=irf(MODEL2,impulse = "DBURDEN",response = "CONS",n.ahead = 20,boot = TRUE)
DBURDENirf3=irf(MODEL2,impulse = "CONS",response = "DBURDEN",n.ahead = 20,boot = TRUE)
plot(CONSirf,ylab="CONS",main="Shock from DBURDEN")

plot(DBURDENirf3,ylab="DBURDEN",main="Shock from CONS")

plot(AGRICSirf,ylab="AGRICS",main="Shock from DBURDEN")

plot(DBURDENirf2,ylab="DBURDEN",main="Shock from AGRICS")

plot(GROWTHirf,ylab="GROWTH",main="Shock from DBURDEN")

plot(DBURDENirf,ylab="DBURDEN",main="Shock from GROWTH")

Variance decomposition.

FEVD1=fevd(MODEL1,n.ahead = 15)
FEVD2=fevd(MODEL2,n.ahead = 5)
plot(FEVD1)

VAR Forecasting.

Forecast1=predict(MODEL1,n.ahead = 10,ci=0.95)
Forecast2=predict(MODEL2,n.ahead = 10,ci=0.95)
fanchart(Forecast1,names = "GROWTH")

fanchart(Forecast2,names = "DBURDEN")

fanchart(Forecast2,names = "AGRIC")

fanchart(Forecast2,names = "CONS")

Using The Stock Consumer Debt Burden.

PDEBT2<-ts((daTA$PDEBT2))
CONS2<-ts((daTA$CONS2))
INC2<-ts((daTA$INC2))
GROWTH2<-ts(daTA$GROWTH2)
STOCKS2<-ts((daTA$STOCKS2))
AGRIC2<-ts((daTA$AGRIC2))
EXP2<-ts((daTA$EXP2))
DBURDEN2<-ts((daTA$DBURDEN2))

Cointegration Test.

Dataset=cbind(daTA$GROWTH2,DBURDEN2)
VARselect(dset,lag.max = 10,type = "const")
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##     10      1      1      1 
## 
## $criteria
##                1         2         3         4         5         6         7
## AIC(n)  3.647539  3.836779  3.993302  4.183261  4.303555  3.994634  3.800391
## HQ(n)   3.737190  3.986198  4.202487  4.452214  4.632275  4.383122  4.248646
## SC(n)   3.927778  4.303845  4.647194  5.023979  5.331100  5.209005  5.201589
## FPE(n) 38.431597 46.667919 55.191867 68.124650 79.452103 61.391692 54.468130
##                8         9        10
## AIC(n)  3.765603  3.857608  3.280853
## HQ(n)   4.273626  4.425397  3.908410
## SC(n)   5.353627  5.632458  5.242529
## FPE(n) 58.517917 74.598801 51.938211
cointest<-ca.jo(dset,K=2,type = "trace", ecdet = "const", spec = "transitory")
cointest
## 
## ##################################################### 
## # Johansen-Procedure Unit Root / Cointegration Test # 
## ##################################################### 
## 
## The value of the test statistic is: 9.3655 21.8973
print('H0 r=0')
## [1] "H0 r=0"
cointest@teststat[2]
## [1] 21.89727
print('H0 r=1')
## [1] "H0 r=1"
cointest@teststat[1]
## [1] 9.365487
cointest@cval
##          10pct  5pct  1pct
## r <= 1 |  7.52  9.24 12.97
## r = 0  | 17.85 19.96 24.60
datset=cbind(CONS2,AGRIC2,EXP2,DBURDEN2)
VARselect(datset,lag.max = 10,type = "const")
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##      4      4      4      5 
## 
## $criteria
##                  1           2           3    4    5    6    7    8    9   10
## AIC(n)    7.389921    7.210479    5.146322 -Inf -Inf -Inf -Inf -Inf -Inf -Inf
## HQ(n)     7.487360    7.385869    5.399663 -Inf -Inf -Inf -Inf -Inf -Inf -Inf
## SC(n)     8.370172    8.974931    7.694975 -Inf -Inf -Inf -Inf -Inf -Inf -Inf
## FPE(n) 1739.795443 2185.948467 1197.854586  NaN    0    0    0    0    0    0
cotest<-ca.jo(datset,K=4,type = "trace", ecdet = "const", spec = "transitory")
cotest
## 
## ##################################################### 
## # Johansen-Procedure Unit Root / Cointegration Test # 
## ##################################################### 
## 
## The value of the test statistic is: 2.4124 7.4536 14.5244 53.6833
print('H0 r=0')
## [1] "H0 r=0"
cotest@teststat[2]
## [1] 7.453554
print('H0 r=1')
## [1] "H0 r=1"
cotest@teststat[1]
## [1] 2.412394
cotest@cval
##          10pct  5pct  1pct
## r <= 3 |  7.52  9.24 12.97
## r <= 2 | 17.85 19.96 24.60
## r <= 1 | 32.00 34.91 41.07
## r = 0  | 49.65 53.12 60.16

Scatter Plot.

ggplot(data=daTA)+geom_point(mapping=aes(x=GROWTH2,y=DBURDEN2))

ggplot(data=daTA)+geom_point(mapping=aes(x=CONS2,y=DBURDEN2))

ggplot(data=daTA)+geom_point(mapping=aes(x=AGRIC2,y=DBURDEN2))

VECM Model

MODEL1=VECM(Dataset,2,r=1,estim=("2OLS") )
summary(MODEL1)
## #############
## ###Model VECM 
## #############
## Full sample size: 27     End sample size: 24
## Number of variables: 2   Number of estimated slope parameters 12
## AIC 210.2013     BIC 225.516     SSR 13656.29
## Cointegrating vector (estimated by 2OLS):
##    daTA$GROWTH2   DBURDEN2
## r1            1 0.02113294
## 
## 
##                       ECT                 Intercept          
## Equation daTA$GROWTH2 -0.3228(0.2466)     1.4265(1.0646)     
## Equation DBURDEN2     -4.2088(2.9947)     23.1273(12.9267).  
##                       daTA$GROWTH2 -1     DBURDEN2 -1       
## Equation daTA$GROWTH2 -0.2513(0.2527)     0.0102(0.0117)    
## Equation DBURDEN2     2.7479(3.0685)      -0.2601(0.1420).  
##                       daTA$GROWTH2 -2     DBURDEN2 -2       
## Equation daTA$GROWTH2 -0.3376(0.2169)     0.0066(0.0105)    
## Equation DBURDEN2     3.3361(2.6336)      -0.5643(0.1281)***
MODEL2=VECM(datset,4,r=3,estim=("ML") )
summary(MODEL2)
## Warning in log(det(crossprod(residuals(object))/t)): NaNs produced

## Warning in log(det(crossprod(residuals(object))/t)): NaNs produced
## #############
## ###Model VECM 
## #############
## Full sample size: 27     End sample size: 22
## Number of variables: 4   Number of estimated slope parameters 80
## AIC NaN  BIC NaN     SSR 66.59273
## Cointegrating vector (estimated by ML):
##            CONS2        AGRIC2         EXP2   DBURDEN2
## r1  1.000000e+00  0.000000e+00 0.000000e+00 -0.2500760
## r2 -1.387779e-17  1.000000e+00 2.775558e-17 -0.2598083
## r3 -2.775558e-17 -1.387779e-17 1.000000e+00  0.1911052
## 
## 
##                   ECT1                ECT2                ECT3               
## Equation CONS2    -2.3684(1.3370)     0.8816(1.6694)      -1.8637(1.2677)    
## Equation AGRIC2   -1.7633(0.0280)***  -0.3935(0.0350)**   -2.4851(0.0266)*** 
## Equation EXP2     0.4099(1.3135)      -2.4106(1.6401)     -2.1695(1.2454)    
## Equation DBURDEN2 -41.5119(4.7324)*   32.9893(5.9089)*    -19.4616(4.4871)*  
##                   Intercept          CONS2 -1            AGRIC2 -1          
## Equation CONS2    1.3234(1.2823)     0.7401(1.0379)      0.4391(1.4767)     
## Equation AGRIC2   2.4799(0.0269)***  0.6163(0.0217)**    0.9652(0.0309)**   
## Equation EXP2     1.8939(1.2598)     -1.1783(1.0197)     2.4538(1.4508)     
## Equation DBURDEN2 5.0623(4.5388)     16.9624(3.6738)*    -4.3850(5.2269)    
##                   EXP2 -1            DBURDEN2 -1         CONS2 -2           
## Equation CONS2    2.7704(1.5332)     -0.0929(0.0646)     0.4577(0.6514)     
## Equation AGRIC2   2.8444(0.0321)***  -0.1413(0.0014)***  0.5663(0.0136)***  
## Equation EXP2     1.5574(1.5063)     -0.0634(0.0635)     -0.1955(0.6400)    
## Equation DBURDEN2 31.1070(5.4269)*   -0.0090(0.2288)     15.6711(2.3057)*   
##                   AGRIC2 -2           EXP2 -2            DBURDEN2 -2        
## Equation CONS2    0.6411(1.0349)      2.5554(1.4607)     -0.0067(0.0583)    
## Equation AGRIC2   0.8129(0.0217)***   2.7857(0.0306)***  -0.0480(0.0012)*** 
## Equation EXP2     0.9845(1.0167)      1.7589(1.4351)     -0.0811(0.0572)    
## Equation DBURDEN2 -0.5778(3.6631)     37.1997(5.1704)*   0.3896(0.2062)     
##                   CONS2 -3            AGRIC2 -3          EXP2 -3           
## Equation CONS2    1.1617(0.6908)      0.9788(0.9287)     1.9312(1.0372)    
## Equation AGRIC2   1.2506(0.0145)***   0.8326(0.0195)***  2.2208(0.0217)*** 
## Equation EXP2     -0.7401(0.6787)     2.3158(0.9123)     0.5047(1.0190)    
## Equation DBURDEN2 16.4962(2.4453)*    9.7556(3.2870).    30.5958(3.6712)*  
##                   DBURDEN2 -3         CONS2 -4           AGRIC2 -4          
## Equation CONS2    0.0349(0.0408)      1.9628(1.0580)     -0.9986(0.8312)    
## Equation AGRIC2   0.0305(0.0009)***   2.4490(0.0222)***  -1.1151(0.0174)*** 
## Equation EXP2     -0.0575(0.0401)     0.5921(1.0394)     0.8949(0.8166)     
## Equation DBURDEN2 1.0267(0.1443)*     27.9795(3.7448)*   -9.9176(2.9421).   
##                   EXP2 -4            DBURDEN2 -4        
## Equation CONS2    1.1514(0.8504)     0.1033(0.0513)     
## Equation AGRIC2   1.3828(0.0178)***  0.0920(0.0011)***  
## Equation EXP2     0.5635(0.8354)     -0.0074(0.0504)    
## Equation DBURDEN2 22.0978(3.0099)*   1.1819(0.1814)*

#Convert to a VAR*

MODEL1=vec2var(cointest,r=1)
MODEL2=vec2var(cotest,r=3)

test for serial correlation

Serial1=serial.test(MODEL1,lags.pt = 12,type = "PT.asymptotic")
Serial2=serial.test(MODEL2,lags.pt = 12,type = "PT.asymptotic")
Serial1
## 
##  Portmanteau Test (asymptotic)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 46.439, df = 42, p-value = 0.2945
Serial2
## 
##  Portmanteau Test (asymptotic)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 136.97, df = 132, p-value = 0.3659

Heteroskedasticity

ARCH1=arch.test(MODEL1,lags.multi = 12,multivariate.only = TRUE)
ARCH2=arch.test(MODEL2,lags.multi = 12,multivariate.only = TRUE)
ARCH1
## 
##  ARCH (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 78, df = 108, p-value = 0.9869
ARCH2
## 
##  ARCH (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 110, df = 1200, p-value = 1

Normality of error term

NORM1=normality.test(MODEL1,multivariate.only = TRUE)
NORM2=normality.test(MODEL2,multivariate.only = TRUE)
NORM1
## $JB
## 
##  JB-Test (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 3.0861, df = 4, p-value = 0.5435
## 
## 
## $Skewness
## 
##  Skewness only (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 1.1355, df = 2, p-value = 0.5668
## 
## 
## $Kurtosis
## 
##  Kurtosis only (multivariate)
## 
## data:  Residuals of VAR object MODEL1
## Chi-squared = 1.9506, df = 2, p-value = 0.3771
NORM2
## $JB
## 
##  JB-Test (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 3.4863, df = 8, p-value = 0.9003
## 
## 
## $Skewness
## 
##  Skewness only (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 1.6768, df = 4, p-value = 0.7949
## 
## 
## $Kurtosis
## 
##  Kurtosis only (multivariate)
## 
## data:  Residuals of VAR object MODEL2
## Chi-squared = 1.8095, df = 4, p-value = 0.7707

Impulse response

GROWTHirf=irf(MODEL1,impulse = "DBURDEN",response = "GROWTH",n.ahead = 20,boot = TRUE)
DBURDENirf=irf(MODEL1,impulse = "GROWTH",response = "DBURDEN",n.ahead = 20,boot = TRUE)
AGRICSirf=irf(MODEL2,impulse = "DBURDEN2",response = "AGRIC2",n.ahead = 20,boot = TRUE)
DBURDENirf2=irf(MODEL2,impulse = "AGRIC2",response = "DBURDEN2",n.ahead = 20,boot = TRUE)
CONSirf=irf(MODEL2,impulse = "DBURDEN2",response = "CONS2",n.ahead = 20,boot = TRUE)
DBURDENirf3=irf(MODEL2,impulse = "CONS2",response = "DBURDEN2",n.ahead = 20,boot = TRUE)


plot(CONSirf,ylab="CONS",main="Shock from DBURDEN")

plot(DBURDENirf3,ylab="DBURDEN",main="Shock from CONS")

plot(AGRICSirf,ylab="AGRICS",main="Shock from DBURDEN")

plot(DBURDENirf2,ylab="DBURDEN",main="Shock from AGRICS")

plot(GROWTHirf,ylab="GROWTH",main="Shock from DBURDEN")

plot(DBURDENirf,ylab="DBURDEN",main="Shock from GROWTH")

Variance decomposition

FEVD1=fevd(MODEL1,n.ahead = 15)
FEVD2=fevd(MODEL2,n.ahead = 5)
plot(FEVD1)