This project analyzes the impact of Covid measures on the return in stock market using a panel VAR model. The dependent vector includes log return of stock index and interest rate for several countries. The measures of Covid include the number of new daily confirmed case, 7-day moving average of new daily confirmed case and the log growth rate of confirmed case.
We first load data from two excel spreadsheets and select the related variables, log_ret, interest rate, EconomicSupportIndex, StringecyIndex, new confirmed case, total confirmed cases.
Here are the The following steps are implemented to clean up the data.
Remove duplicated records.
Remove records after March 15, 2021 since there are no values.
Create Covid measures.
log of raw daily new confirmed case. It is very volatile and presents weekly seasonality because many countries do not have data during weekend.
log of 7-day moving average. It is smooth without seasonality.
log growth rate of confirmed case.
Merge (inner merge) two data sets by country and date. The records with common country and date are kept.
Remove missing values. The main reason that we do not use values in the previous time to fill the missing values
Here are the summary statistics of the data.
## Country Date log_ret
## Length:5350 Min. :2020-01-22 00:00:00 Min. :-4.602084
## Class :character 1st Qu.:2020-05-06 00:00:00 1st Qu.:-0.007343
## Mode :character Median :2020-08-17 00:00:00 Median : 0.000969
## Mean :2020-08-16 10:09:38 Mean :-0.000626
## 3rd Qu.:2020-11-26 00:00:00 3rd Qu.: 0.009601
## Max. :2021-03-12 00:00:00 Max. : 0.156060
##
## new confirmed Confirmed EconomicSupportIndex StringencyIndex
## Min. :-74347 Min. : 0 Min. : 0.00 Min. : 0.00
## 1st Qu.: 109 1st Qu.: 27962 1st Qu.: 37.50 1st Qu.: 50.93
## Median : 1561 Median : 206018 Median : 62.50 Median : 67.13
## Mean : 10557 Mean : 1272867 Mean : 55.81 Mean : 60.72
## 3rd Qu.: 7933 3rd Qu.: 785187 3rd Qu.: 75.00 3rd Qu.: 75.46
## Max. :823225 Max. :29347338 Max. :100.00 Max. :100.00
## NA's :1 NA's :13 NA's :12
## new_confirmed_7day log_case_growth_rate int_rate
## Min. : -6223.0 Min. :0.0000 Min. :-0.828
## 1st Qu.: 148.6 1st Qu.:1.0000 1st Qu.:-0.100
## Median : 1569.1 Median :1.0000 Median : 0.232
## Mean : 10093.1 Mean :0.9628 Mean : 1.616
## 3rd Qu.: 8068.1 3rd Qu.:1.0000 3rd Qu.: 2.647
## Max. :250743.6 Max. :1.0000 Max. :15.065
## NA's :72
It is import to check whether the dependent vector time series are stable. Here we use plm package to implement. Both series are stable.
##
## Maddala-Wu Unit-Root Test (ex. var.: None)
##
## data: log_ret ~ 0
## chisq = 1909.8, df = 38, p-value < 2.2e-16
## alternative hypothesis: stationarity
##
## Maddala-Wu Unit-Root Test (ex. var.: None)
##
## data: int_rate ~ 0
## chisq = 125.9, df = 38, p-value = 2.398e-11
## alternative hypothesis: stationarity
The general form of panel VAR model is as follow \[y_{i,t} = \sum_{l=1}^{p}A_{l}y_{i,t-l} + Bx_{i,t} + \mu_{i} + \epsilon_{i,t}\] where \(y_{i,t}\) is an \(m\times 1\) vector of endogenous variables for the \(i-\)th cross-sectional unit at time \(t\), \(m\) is equal to the number of variables in the vector, \(x_{i,t}\) is an \(n\times1\) vector of strictly exogenous variables, \(n\) is the number of exogenous variables, \(\mu_{i}\) is the fixed effect specific to the \(i-\)th cross-sectional unit. Here it is assumed that neither \(A\) and \(B\) depends on cross-sectional units. There are two ways to get rid of the fixed effect, first difference and forward orthogonal deviation. This paper discusses two methods using simulation and finds that in most cases forward orthogonal deviation works better. We will be using forward orthogonal deviation for our estimation. The model is estimated using R package panelvar, please refer to this paper for details. Three different models using three different Covid measures are estimated below followed by impulse response charts.
Use log growth rate of confirmed case.
Dynamic Panel VAR estimation, two-step GMM
Transformation: Forward orthogonal deviations
Group variable: Country
Time variable: day
Number of observations = 5279
Number of groups = 19
Obs per group: min = 221
Obs per group: avg = 277.842105263158
Obs per group: max = 290
Number of instruments = 1166
|
 |
log_ret |
int_rate |
|---|---|---|
|
lag1_log_ret |
-0.0448*** |
-0.0115*** |
|
 |
(0.0093) |
(0.0028) |
|
lag1_int_rate |
0.1503*** |
0.4002*** |
|
 |
(0.0330) |
(0.0116) |
|
lag2_log_ret |
0.0134*** |
-0.0134 |
|
 |
(0.0012) |
(0.0074) |
|
lag2_int_rate |
0.1428*** |
0.4340*** |
|
 |
(0.0308) |
(0.0257) |
|
EconomicSupportIndex |
0.0013*** |
-0.0006*** |
|
 |
(0.0002) |
(0.0001) |
|
StringencyIndex |
0.0020*** |
-0.0014*** |
|
 |
(0.0002) |
(0.0002) |
|
log_case_growth_rate |
-0.0275 |
0.0515** |
|
 |
(0.0187) |
(0.0174) |
|
p < 0.001; p < 0.01; p < 0.05 |
||
Instruments for equation
Standard
EconomicSupportIndex, StringencyIndex, log_case_growth_rate
GMM-type
Dependent vars: L(2,2))
Collapse = FALSE
Hansen test of overid. restrictions: chi2(1152) = 134.44 Prob > chi2 = 1
(Robust, but weakened by many instruments.)
use log of 7-day moving average of new confirmed case. The reason to use log version of 7-day moving average is because it reports singular matrix error when using 7-day moving average.
Dynamic Panel VAR estimation, two-step GMM
Transformation: Forward orthogonal deviations
Group variable: Country
Time variable: day
Number of observations = 5197
Number of groups = 19
Obs per group: min = 218
Obs per group: avg = 273.526315789474
Obs per group: max = 284
Number of instruments = 1150
|
 |
log_ret |
int_rate |
|---|---|---|
|
lag1_log_ret |
-0.0628*** |
0.0169* |
|
 |
(0.0115) |
(0.0081) |
|
lag1_int_rate |
0.1199** |
0.2495*** |
|
 |
(0.0376) |
(0.0221) |
|
lag2_log_ret |
0.0077** |
-0.0275*** |
|
 |
(0.0029) |
(0.0047) |
|
lag2_int_rate |
0.1319*** |
0.3784*** |
|
 |
(0.0269) |
(0.0553) |
|
EconomicSupportIndex |
0.0010*** |
-0.0012*** |
|
 |
(0.0001) |
(0.0001) |
|
StringencyIndex |
0.0007** |
-0.0008* |
|
 |
(0.0003) |
(0.0003) |
|
log_new_confirmed_7day |
0.0073 |
-0.0119 |
|
 |
 |
 |
|
p < 0.001; p < 0.01; p < 0.05 |
||
Instruments for equation
Standard
EconomicSupportIndex, StringencyIndex, log_new_confirmed_7day
GMM-type
Dependent vars: L(2,2))
Collapse = FALSE
Hansen test of overid. restrictions: chi2(1136) = 86.33 Prob > chi2 = 1
(Robust, but weakened by many instruments.)
use log of new confirmed case.
Dynamic Panel VAR estimation, two-step GMM
Transformation: Forward orthogonal deviations
Group variable: Country
Time variable: day
Number of observations = 5255
Number of groups = 19
Obs per group: min = 219
Obs per group: avg = 276.578947368421
Obs per group: max = 287
Number of instruments = 1166
|
 |
log_ret |
int_rate |
|---|---|---|
|
lag1_log_ret |
0.0034 |
-0.0256*** |
|
 |
(0.0030) |
(0.0010) |
|
lag1_int_rate |
0.0853*** |
0.5303*** |
|
 |
(0.0213) |
(0.0147) |
|
lag2_log_ret |
0.0107*** |
0.0077*** |
|
 |
(0.0015) |
(0.0020) |
|
lag2_int_rate |
0.0409* |
0.4943*** |
|
 |
(0.0194) |
(0.0156) |
|
EconomicSupportIndex |
0.0005*** |
0.0001 |
|
 |
(0.0001) |
(0.0001) |
|
StringencyIndex |
0.0005*** |
-0.0002 |
|
 |
(0.0001) |
(0.0001) |
|
log_new.confirmed |
0.0026* |
0.0017 |
|
 |
(0.0012) |
(0.0009) |
|
p < 0.001; p < 0.01; p < 0.05 |
||
Instruments for equation
Standard
EconomicSupportIndex, StringencyIndex, log_new.confirmed
GMM-type
Dependent vars: L(2,2))
Collapse = FALSE
Hansen test of overid. restrictions: chi2(1152) = 74.65 Prob > chi2 = 1
(Robust, but weakened by many instruments.)
In this section we estimated the models using first difference for comparison.
Dynamic Panel VAR estimation, two-step GMM
Transformation: First-differences
Group variable: Country
Time variable: day
Number of observations = 5279
Number of groups = 19
Obs per group: min = 221
Obs per group: avg = 277.842105263158
Obs per group: max = 290
Number of instruments = 1166
| Â | log_ret | int_rate |
|---|---|---|
| lag1_log_ret | -0.4721 | 0.2391 |
| Â | (0.4529) | (0.3283) |
| lag1_int_rate | 0.1491 | 0.8071*** |
| Â | (0.1992) | (0.1666) |
| lag2_log_ret | -0.5388 | 0.2906 |
| Â | (0.5433) | (0.4896) |
| lag2_int_rate | 0.0034 | -0.0017 |
| Â | (0.4761) | (0.2094) |
| EconomicSupportIndex | -0.0001 | 0.0002 |
| Â | (0.0003) | (0.0004) |
| StringencyIndex | -0.0000 | -0.0016 |
| Â | (0.0006) | (0.0009) |
| log_case_growth_rate | -0.2265 | 0.4217 |
| Â | (0.4099) | (0.3962) |
| p < 0.001; p < 0.01; p < 0.05 | ||
Instruments for equation
Standard
EconomicSupportIndex, StringencyIndex, log_case_growth_rate
GMM-type
Dependent vars: L(2,2))
Collapse = FALSE
Hansen test of overid. restrictions: chi2(1152) = 6.09 Prob > chi2 = 1
(Robust, but weakened by many instruments.)
use log of 7-day moving average of new confirmed case. The reason to use log version of 7-day moving average is because it reports singular matrix error when using 7-day moving average.
Dynamic Panel VAR estimation, two-step GMM
Transformation: First-differences
Group variable: Country
Time variable: day
Number of observations = 5197
Number of groups = 19
Obs per group: min = 218
Obs per group: avg = 273.526315789474
Obs per group: max = 284
Number of instruments = 1150
|
 |
log_ret |
int_rate |
|---|---|---|
|
lag1_log_ret |
0.0864 |
-0.0616 |
|
 |
(0.0632) |
(0.4051) |
|
lag1_int_rate |
-0.0635 |
0.7650*** |
|
 |
(0.2247) |
(0.2279) |
|
lag2_log_ret |
-0.2258 |
0.0085 |
|
 |
(0.2108) |
(0.2455) |
|
lag2_int_rate |
-0.0545 |
0.1107 |
|
 |
(0.2407) |
(0.1876) |
|
EconomicSupportIndex |
-0.0003 |
0.0002 |
|
 |
(0.0003) |
(0.0002) |
|
StringencyIndex |
-0.0001 |
-0.0010 |
|
 |
(0.0007) |
(0.0008) |
|
log_new_confirmed_7day |
-0.0005 |
-0.0007 |
|
 |
(0.0031) |
(0.0033) |
|
p < 0.001; p < 0.01; p < 0.05 |
||
Instruments for equation
Standard
EconomicSupportIndex, StringencyIndex, log_new_confirmed_7day
GMM-type
Dependent vars: L(2,2))
Collapse = FALSE
Hansen test of overid. restrictions: chi2(1136) = 8.79 Prob > chi2 = 1
(Robust, but weakened by many instruments.)
use log of new confirmed case.
Dynamic Panel VAR estimation, two-step GMM
Transformation: First-differences
Group variable: Country
Time variable: day
Number of observations = 5255
Number of groups = 19
Obs per group: min = 219
Obs per group: avg = 276.578947368421
Obs per group: max = 287
Number of instruments = 1166
|
 |
log_ret |
int_rate |
|---|---|---|
|
lag1_log_ret |
0.1357 |
-0.3835 |
|
 |
(0.3388) |
(0.7054) |
|
lag1_int_rate |
-0.1227 |
1.0592* |
|
 |
(0.4873) |
(0.4197) |
|
lag2_log_ret |
-0.3433 |
0.2250 |
|
 |
(0.4694) |
(0.5624) |
|
lag2_int_rate |
0.1378 |
-0.0559 |
|
 |
(0.6062) |
(0.5008) |
|
EconomicSupportIndex |
-0.0003 |
0.0006 |
|
 |
(0.0003) |
(0.0007) |
|
StringencyIndex |
-0.0005 |
-0.0015* |
|
 |
(0.0006) |
(0.0007) |
|
log_new.confirmed |
-0.0003 |
-0.0007 |
|
 |
(0.0011) |
(0.0005) |
|
p < 0.001; p < 0.01; p < 0.05 |
||
Instruments for equation
Standard
EconomicSupportIndex, StringencyIndex, log_new.confirmed
GMM-type
Dependent vars: L(2,2))
Collapse = FALSE
Hansen test of overid. restrictions: chi2(1152) = 6.72 Prob > chi2 = 1
(Robust, but weakened by many instruments.)