##Data ##For Suraj: Please add in data collection background and introduction.

#check countries selected in the data
length(unique(main$Country))
## [1] 20
#combine year month column,modify column names
main$Covid_share_pop_num = with(main,round(main$`Mid Month Covid Cummulative`/main$`Population (2019)`,4))
main$Date = as.yearmon(paste(main$Year,main$Month, sep = "-"))

colnames(main) <- c("Country","Year","Month","PMI","Money_supply","CPI","Share_Price_Index","unemployment_rate","Population","covid_cummulative","Covid_share_pop_PCT","Period","StringencyIndex","GovernmentResponseIndex","EconomicSupportIndex","PMI_PCT","Money_Supply_PCT","CPI_PCT","Share_Price_Index_PCT","unemployment_rate_pct","Covid_share_pop_num","Date")

main <- transform(main, Date = as.Date(Date, frac = 1))

main
##      Country Year Month  PMI Money_supply    CPI Share_Price_Index
##   1: Belgium 2019     9   NA        565.7 108.44             94.96
##   2: Belgium 2019    10   NA        567.4 108.83             94.71
##   3: Belgium 2019    11   NA        570.3 108.90             95.44
##   4: Belgium 2019    12   NA        567.7 109.04             95.74
##   5: Belgium 2020     1   NA        570.6 109.69             96.22
##  ---                                                              
## 174:     USA 2020     5 37.0      17779.1 256.39            105.66
## 175:     USA 2020     6 47.9      18118.9 257.80            113.17
## 176:     USA 2020     7 50.3      18278.8 259.10            115.12
## 177:     USA 2020     8 54.4      18369.1 259.92            120.64
## 178:     USA 2020     9 54.3      18612.9 260.28            119.70
##      unemployment_rate Population covid_cummulative Covid_share_pop_PCT
##   1:               5.3   11480000                NA               0.00%
##   2:               5.2   11480000                NA               0.00%
##   3:               5.1   11480000                NA               0.00%
##   4:               5.2   11480000                NA               0.00%
##   5:               5.2   11480000                NA               0.00%
##  ---                                                                   
## 174:              13.3  328240000           1382362               0.42%
## 175:              11.1  328240000           2057838               0.63%
## 176:              10.2  328240000           3344783               1.02%
## 177:               8.4  328240000           5203206               1.59%
## 178:               7.9  328240000           6462135               1.97%
##          Period StringencyIndex GovernmentResponseIndex EconomicSupportIndex
##   1:  Pre COVID               0                       0                    0
##   2:  Pre COVID               0                       0                    0
##   3:  Pre COVID               0                       0                    0
##   4:  Pre COVID               0                       0                    0
##   5:  Pre COVID               0                       0                    0
##  ---                                                                        
## 174: Post COVID              73                      71                   63
## 175: Post COVID              69                      68                   63
## 176: Post COVID              69                      70                   63
## 177: Post COVID              67                      69                   63
## 178: Post COVID              63                      66                   63
##      PMI_PCT Money_Supply_PCT CPI_PCT Share_Price_Index_PCT
##   1:                    0.46%  -0.46%                 4.10%
##   2:                    0.30%   0.36%                -0.26%
##   3:                    0.51%   0.06%                 0.77%
##   4:                   -0.46%   0.13%                 0.31%
##   5:                    0.51%   0.60%                 0.50%
##  ---                                                       
## 174:  37.04%            3.89%   0.00%                 3.79%
## 175:  29.46%            1.91%   0.55%                 7.11%
## 176:   5.01%            0.88%   0.50%                 1.72%
## 177:   8.15%            0.49%   0.32%                 4.79%
## 178:  -0.18%            1.33%   0.14%                -0.78%
##      unemployment_rate_pct Covid_share_pop_num       Date
##   1:                -0.10%                  NA 2019-09-30
##   2:                -0.10%                  NA 2019-10-31
##   3:                -0.10%                  NA 2019-11-30
##   4:                 0.10%                  NA 2019-12-31
##   5:                 0.00%                  NA 2020-01-31
##  ---                                                     
## 174:                -1.40%              0.0042 2020-05-31
## 175:                -2.20%              0.0063 2020-06-30
## 176:                -0.90%              0.0102 2020-07-31
## 177:                -1.80%              0.0159 2020-08-31
## 178:                -0.50%              0.0197 2020-09-30

Rank by max cumulative case and then by max Covid_share_pop_num

main[is.na(main)] <- 0
rankbycase = main %>% group_by(Country) %>%
         summarise_at(vars(covid_cummulative),max) %>%
         arrange(desc(covid_cummulative))
rankbycase
## # A tibble: 20 x 2
##    Country        covid_cummulative
##    <chr>                      <dbl>
##  1 USA                      6462135
##  2 India                    4930236
##  3 Brazil                   4330455
##  4 Russia                   1073849
##  5 Colombia                  716319
##  6 Spain                     615384
##  7 South Africa              579140
##  8 Mexico                    505751
##  9 Chile                     436433
## 10 United Kingdom            371129
## 11 France                    366980
## 12 Turkey                    292878
## 13 Italy                     288761
## 14 Philippines               265888
## 15 Germany                   261762
## 16 Belgium                    96934
## 17 Israel                     90314
## 18 Netherlands                83321
## 19 Poland                     74529
## 20 Czech Republic             37222
rankbyshare = main %>% group_by(Country) %>%
         summarise_at(vars(Covid_share_pop_num),max) %>%
         arrange(desc(Covid_share_pop_num))
rankbyshare
## # A tibble: 20 x 2
##    Country        Covid_share_pop_num
##    <chr>                        <dbl>
##  1 Chile                      0.023  
##  2 Brazil                     0.0205 
##  3 USA                        0.0197 
##  4 Colombia                   0.0142 
##  5 Spain                      0.0131 
##  6 Israel                     0.01   
##  7 South Africa               0.0099 
##  8 Belgium                    0.0084 
##  9 Russia                     0.0074 
## 10 United Kingdom             0.0056 
## 11 France                     0.0055 
## 12 Italy                      0.00480
## 13 Netherlands                0.00480
## 14 Mexico                     0.004  
## 15 India                      0.0036 
## 16 Czech Republic             0.0035 
## 17 Turkey                     0.0035 
## 18 Germany                    0.0031 
## 19 Philippines                0.0025 
## 20 Poland                     0.002

##Check the general trend for pre_covid/post_covid start time cross all 20 countries.

## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Blues is 9
## Returning the palette you asked for with that many colors

##Check PMI pre_covid/post_covid across countries

##Check Money Supply pre_covid/post_covid across countries

## Scale for 'y' is already present. Adding another scale for 'y', which will
## replace the existing scale.

##Check CPI pre_covid/post_covid across countries

## Scale for 'y' is already present. Adding another scale for 'y', which will
## replace the existing scale.

##Check Share_Price_Index pre_covid/post_covid across countries

##Check unemployment rate pre_covid/post_covid across countries

##Check striengency index applied pre_covid/post_covid across countries

##Check GovernmentResponseIndex index applied pre_covid/post_covid across countries

##Check EconomicSupportIndex index applied pre_covid/post_covid across countries

#check correlation

main[is.na(main)] <- 0
submain = as.data.frame(c(main[,4:8],main[,13:15]))
corrplot(cor(submain), method="circle")

##US Hotelling T square NOTE: drop Strigency Index, government response index, and economic support index since high correlation.

main_test = main %>% filter(Period != "COVID Month")
US = subset(main_test, Country %in% "USA")
US 
##     Country Year Month  PMI Money_supply    CPI Share_Price_Index
## 148     USA 2019    11 52.0      15270.4 257.21            125.89
## 149     USA 2019    12 52.7      15422.8 256.97            128.52
## 150     USA 2020     1 53.3      15405.2 257.97            130.91
## 151     USA 2020     2 49.6      15392.7 258.68            128.69
## 152     USA 2020     3 40.9      16066.5 258.12            100.46
## 153     USA 2020     5 37.0      17779.1 256.39            105.66
## 154     USA 2020     6 47.9      18118.9 257.80            113.17
## 155     USA 2020     7 50.3      18278.8 259.10            115.12
## 156     USA 2020     8 54.4      18369.1 259.92            120.64
## 157     USA 2020     9 54.3      18612.9 260.28            119.70
##     unemployment_rate Population covid_cummulative Covid_share_pop_PCT
## 148               3.5  328240000                 0               0.00%
## 149               3.5  328240000                 0               0.00%
## 150               3.6  328240000                 0               0.00%
## 151               3.5  328240000                19               0.00%
## 152               4.4  328240000              1718               0.00%
## 153              13.3  328240000           1382362               0.42%
## 154              11.1  328240000           2057838               0.63%
## 155              10.2  328240000           3344783               1.02%
## 156               8.4  328240000           5203206               1.59%
## 157               7.9  328240000           6462135               1.97%
##         Period StringencyIndex GovernmentResponseIndex EconomicSupportIndex
## 148  Pre COVID               0                       0                    0
## 149  Pre COVID               0                       0                    0
## 150  Pre COVID               0                       0                    0
## 151  Pre COVID               6                       7                    0
## 152  Pre COVID              41                      37                    0
## 153 Post COVID              73                      71                   63
## 154 Post COVID              69                      68                   63
## 155 Post COVID              69                      70                   63
## 156 Post COVID              67                      69                   63
## 157 Post COVID              63                      66                   63
##     PMI_PCT Money_Supply_PCT CPI_PCT Share_Price_Index_PCT
## 148   2.16%            0.97%  -0.05%                 3.74%
## 149   1.35%            1.00%  -0.09%                 2.09%
## 150   1.14%           -0.11%   0.39%                 1.86%
## 151  -6.94%           -0.08%   0.28%                -1.70%
## 152 -17.54%            4.38%  -0.22%               -21.94%
## 153  37.04%            3.89%   0.00%                 3.79%
## 154  29.46%            1.91%   0.55%                 7.11%
## 155   5.01%            0.88%   0.50%                 1.72%
## 156   8.15%            0.49%   0.32%                 4.79%
## 157  -0.18%            1.33%   0.14%                -0.78%
##     unemployment_rate_pct Covid_share_pop_num       Date
## 148                -0.10%              0.0000 2019-11-30
## 149                 0.00%              0.0000 2019-12-31
## 150                 0.10%              0.0000 2020-01-31
## 151                -0.10%              0.0000 2020-02-29
## 152                 0.90%              0.0000 2020-03-31
## 153                -1.40%              0.0042 2020-05-31
## 154                -2.20%              0.0063 2020-06-30
## 155                -0.90%              0.0102 2020-07-31
## 156                -1.80%              0.0159 2020-08-31
## 157                -0.50%              0.0197 2020-09-30
m1 = with(US, HotellingsT2(cbind(  PMI,Money_supply,CPI,Share_Price_Index,unemployment_rate) ~ Period))
m1
## 
##  Hotelling's two sample T2-test
## 
## data:  cbind(PMI, Money_supply, CPI, Share_Price_Index, unemployment_rate) by Period
## T.2 = 475.47, df1 = 5, df2 = 4, p-value = 1.232e-05
## alternative hypothesis: true location difference is not equal to c(0,0,0,0,0)

##Mancova

mancova(data = US,
    deps = vars(PMI,Money_supply,CPI,Share_Price_Index,unemployment_rate), factors = Period)
## Warning in log(unlist(lapply(mats, det))): NaNs produced
## 
##  MANCOVA
## 
##  Multivariate Tests                                                                     
##  -------------------------------------------------------------------------------------- 
##                                    value          F           df1    df2    p           
##  -------------------------------------------------------------------------------------- 
##    Period    Pillai's Trace          0.9983203    475.4729      5      4    0.0000123   
##              Wilks' Lambda         0.001679709    475.4729      5      4    0.0000123   
##              Hotelling's Trace        594.3411    475.4729      5      4    0.0000123   
##              Roy's Largest Root       594.3411    475.4729      5      4    0.0000123   
##  -------------------------------------------------------------------------------------- 
## 
## 
##  Univariate Tests                                                                                         
##  -------------------------------------------------------------------------------------------------------- 
##                 Dependent Variable    Sum of Squares    df    Mean Square     F               p           
##  -------------------------------------------------------------------------------------------------------- 
##    Period       PMI                         2.116000     1        2.116000      0.05485276    0.8207071   
##                 Money_supply             1.849926e+7     1     1.849926e+7    188.90866614    0.0000008   
##                 CPI                         2.061160     1        2.061160      1.34792546    0.2791100   
##                 Share_Price_Index         161.443240     1      161.443240      1.64285419    0.2358315   
##                 unemployment_rate         104.976000     1      104.976000     42.91741619    0.0001783   
##    Residuals    PMI                       308.608000     8       38.576000                                
##                 Money_supply           783416.220000     8    97927.027500                                
##                 CPI                        12.233080     8        1.529135                                
##                 Share_Price_Index         786.159800     8       98.269975                                
##                 unemployment_rate          19.568000     8        2.446000                                
##  --------------------------------------------------------------------------------------------------------

Brazil

main_test = main %>% filter(Period != "COVID Month")
BR = subset(main_test, Country %in% "Brazil")
BR 
##    Country Year Month  PMI Money_supply     CPI Share_Price_Index
## 13  Brazil 2020     1 52.2       3032.1 5331.42            234.74
## 14  Brazil 2020     2 50.9       3043.0 5344.75            227.52
## 15  Brazil 2020     3 37.6       3209.5 5348.49            163.77
## 16  Brazil 2020     4 26.5       3392.9 5331.91            156.00
## 17  Brazil 2020     6 40.5       3633.6 5325.46            189.76
## 18  Brazil 2020     7 47.3       3708.1 5344.63            203.61
## 19  Brazil 2020     8 53.9       3745.7 5357.46            204.33
## 20  Brazil 2020     9 53.6       3818.6 5391.75            198.18
##    unemployment_rate Population covid_cummulative Covid_share_pop_PCT
## 13              11.2  211050000                 0               0.00%
## 14              11.6  211050000                 0               0.00%
## 15              12.2  211050000               125               0.00%
## 16              12.6  211050000             23430               0.01%
## 17              13.3  211050000            850514               0.40%
## 18              13.8  211050000           1884967               0.89%
## 19               0.0  211050000           3224876               1.53%
## 20               0.0  211050000           4330455               2.05%
##        Period StringencyIndex GovernmentResponseIndex EconomicSupportIndex
## 13  Pre COVID               0                       0                    0
## 14  Pre COVID               6                       6                    0
## 15  Pre COVID              42                      30                    0
## 16  Pre COVID              75                      71                   50
## 17 Post COVID              77                      75                   50
## 18 Post COVID              81                      77                   50
## 19 Post COVID              70                      70                   50
## 20 Post COVID              70                      71                   50
##    PMI_PCT Money_Supply_PCT CPI_PCT Share_Price_Index_PCT unemployment_rate_pct
## 13   2.55%           -2.17%   0.21%                 3.28%                 0.20%
## 14  -2.49%            0.36%   0.25%                -3.08%                 0.40%
## 15 -26.13%            5.47%   0.07%               -28.02%                 0.60%
## 16 -29.52%            5.71%  -0.31%                -4.74%                 0.40%
## 17  44.13%            2.68%   0.26%                16.04%                 0.40%
## 18  16.79%            2.05%   0.36%                 7.30%                 0.50%
## 19  13.95%            1.01%   0.24%                 0.35%                      
## 20  -0.56%            1.95%   0.64%                -3.01%                      
##    Covid_share_pop_num       Date
## 13              0.0000 2020-01-31
## 14              0.0000 2020-02-29
## 15              0.0000 2020-03-31
## 16              0.0001 2020-04-30
## 17              0.0040 2020-06-30
## 18              0.0089 2020-07-31
## 19              0.0153 2020-08-31
## 20              0.0205 2020-09-30
m1 = with(BR, HotellingsT2(cbind(  PMI,Money_supply,CPI,Share_Price_Index,unemployment_rate) ~ Period))
m1
## 
##  Hotelling's two sample T2-test
## 
## data:  cbind(PMI, Money_supply, CPI, Share_Price_Index, unemployment_rate) by Period
## T.2 = 26.213, df1 = 5, df2 = 2, p-value = 0.03715
## alternative hypothesis: true location difference is not equal to c(0,0,0,0,0)

##Mancova

mancova(data = BR,
    deps = vars(PMI,Money_supply,CPI,Share_Price_Index,unemployment_rate), factors = Period)
## Warning in log(unlist(lapply(mats, det))): NaNs produced
## 
##  MANCOVA
## 
##  Multivariate Tests                                                                    
##  ------------------------------------------------------------------------------------- 
##                                    value         F           df1    df2    p           
##  ------------------------------------------------------------------------------------- 
##    Period    Pillai's Trace         0.9849695    26.21253      5      2    0.0371538   
##              Wilks' Lambda         0.01503051    26.21253      5      2    0.0371538   
##              Hotelling's Trace       65.53132    26.21253      5      2    0.0371538   
##              Roy's Largest Root      65.53132    26.21253      5      2    0.0371538   
##  ------------------------------------------------------------------------------------- 
## 
## 
##  Univariate Tests                                                                                        
##  ------------------------------------------------------------------------------------------------------- 
##                 Dependent Variable    Sum of Squares    df    Mean Square     F              p           
##  ------------------------------------------------------------------------------------------------------- 
##    Period       PMI                         98.70125     1        98.70125     1.05208856    0.3445892   
##                 Money_supply            620776.53125     1    620776.53125    35.74236463    0.0009829   
##                 CPI                        491.88161     1       491.88161     1.14952201    0.3248678   
##                 Share_Price_Index           23.97781     1        23.97781     0.02731058    0.8741675   
##                 unemployment_rate           52.53125     1        52.53125     1.70475289    0.2394929   
##    Residuals    PMI                        562.88750     6        93.81458                               
##                 Money_supply            104208.52750     6     17368.08792                               
##                 CPI                       2567.40597     6       427.90100                               
##                 Share_Price_Index         5267.80807     6       877.96801                               
##                 unemployment_rate          184.88750     6        30.81458                               
##  -------------------------------------------------------------------------------------------------------

Colombia

main_test = main %>% filter(Period != "COVID Month")
CL = subset(main_test, Country %in% "Colombia")
CL 
##     Country Year Month PMI Money_supply    CPI Share_Price_Index
## 29 Colombia 2020     3   0     527111.5 105.53             93.55
## 30 Colombia 2020     4   0     539776.4 105.70             89.57
## 31 Colombia 2020     5   0     543768.8 105.36             84.09
## 32 Colombia 2020     7   0     553114.8 104.97             89.39
## 33 Colombia 2020     8   0     551098.7 104.96             91.07
## 34 Colombia 2020     9   0     549796.4 105.29             93.88
##    unemployment_rate Population covid_cummulative Covid_share_pop_PCT
## 29              12.6   50340000                28               0.00%
## 30              19.8   50340000              2852               0.01%
## 31              21.4   50340000             12930               0.03%
## 32              20.2   50340000            154277               0.31%
## 33              16.8   50340000            433805               0.86%
## 34               0.0   50340000            716319               1.42%
##        Period StringencyIndex GovernmentResponseIndex EconomicSupportIndex
## 29  Pre COVID              34                      27                    0
## 30  Pre COVID              84                      84                   75
## 31  Pre COVID              87                      86                   75
## 32 Post COVID              87                      86                   75
## 33 Post COVID              87                      86                   75
## 34 Post COVID              71                      61                   63
##    PMI_PCT Money_Supply_PCT CPI_PCT Share_Price_Index_PCT unemployment_rate_pct
## 29                    5.85%   0.56%               -26.48%                 0.47%
## 30                    2.40%   0.16%                -4.25%                 7.18%
## 31                    0.74%  -0.32%                -6.12%                 1.57%
## 32                    0.44%   0.00%                 0.04%                 0.41%
## 33                   -0.36%  -0.01%                 1.88%                -3.46%
## 34                   -0.24%   0.31%                 3.09%                      
##    Covid_share_pop_num       Date
## 29              0.0000 2020-03-31
## 30              0.0001 2020-04-30
## 31              0.0003 2020-05-31
## 32              0.0031 2020-07-31
## 33              0.0086 2020-08-31
## 34              0.0142 2020-09-30
m1 = with(CL, HotellingsT2(cbind(  Money_supply,CPI,Share_Price_Index,unemployment_rate) ~ Period))
m1
## 
##  Hotelling's two sample T2-test
## 
## data:  cbind(Money_supply, CPI, Share_Price_Index, unemployment_rate) by Period
## T.2 = 171.3, df1 = 4, df2 = 1, p-value = 0.05723
## alternative hypothesis: true location difference is not equal to c(0,0,0,0)

##Mancova

mancova(data = CL,
    deps = vars(Money_supply,CPI,Share_Price_Index,unemployment_rate), factors = Period)
## Warning in log(unlist(lapply(mats, det))): NaNs produced
## 
##  MANCOVA
## 
##  Multivariate Tests                                                                     
##  -------------------------------------------------------------------------------------- 
##                                    value          F           df1    df2    p           
##  -------------------------------------------------------------------------------------- 
##    Period    Pillai's Trace          0.9985427    171.2981      4      1    0.0572344   
##              Wilks' Lambda         0.001457317    171.2981      4      1    0.0572344   
##              Hotelling's Trace        685.1925    171.2981      4      1    0.0572344   
##              Roy's Largest Root       685.1925    171.2981      4      1    0.0572344   
##  -------------------------------------------------------------------------------------- 
## 
## 
##  Univariate Tests                                                                                     
##  ---------------------------------------------------------------------------------------------------- 
##                 Dependent Variable    Sum of Squares    df    Mean Square    F            p           
##  ---------------------------------------------------------------------------------------------------- 
##    Period       Money_supply             3.132500e+8     1    3.132500e+8    7.9880652    0.0475223   
##                 CPI                        0.3128167     1     0.31281667    9.7551975    0.0354125   
##                 Share_Price_Index          8.4728167     1     8.47281667    0.6116048    0.4778873   
##                 unemployment_rate         47.0400000     1    47.04000000    0.6770943    0.4568148   
##    Residuals    Money_supply             1.568590e+8     4    3.921475e+7                             
##                 CPI                        0.1282667     4     0.03206667                             
##                 Share_Price_Index         55.4136667     4    13.85341667                             
##                 unemployment_rate        277.8933333     4    69.47333333                             
##  ----------------------------------------------------------------------------------------------------

Spain

main_test = main %>% filter(Period != "COVID Month")
SP = subset(main_test, Country %in% "Spain")
SP 
##     Country Year Month  PMI Money_supply    CPI Share_Price_Index
## 117   Spain 2019     9 51.7       1241.0 104.12             83.81
## 118   Spain 2019    10 51.2       1231.2 105.13             85.28
## 119   Spain 2019    11 51.9       1253.6 105.30             86.11
## 120   Spain 2019    12 52.7       1247.9 105.23             87.61
## 121   Spain 2020     1 51.5       1229.5 104.20             88.08
## 122   Spain 2020     2 51.8       1238.7 104.08             89.07
## 123   Spain 2020     5 29.2       1311.2 103.99             62.02
## 124   Spain 2020     6 49.7       1337.8 104.47             67.94
## 125   Spain 2020     7 52.8       1335.9 103.53             67.17
## 126   Spain 2020     8 48.4       1339.5 103.58             64.57
## 127   Spain 2020     9 44.3       1344.2 103.73             62.74
##     unemployment_rate Population covid_cummulative Covid_share_pop_PCT
## 117              13.9   47080000                 0               0.00%
## 118               0.0   47080000                 0               0.00%
## 119               0.0   47080000                 0               0.00%
## 120              13.8   47080000                 0               0.00%
## 121               0.0   47080000                 0               0.00%
## 122               0.0   47080000                 2               0.00%
## 123               0.0   47080000            230487               0.49%
## 124              15.3   47080000            244862               0.52%
## 125               0.0   47080000            257116               0.55%
## 126               0.0   47080000            351054               0.75%
## 127              16.3   47080000            615384               1.31%
##         Period StringencyIndex GovernmentResponseIndex EconomicSupportIndex
## 117  Pre COVID               0                       0                    0
## 118  Pre COVID               0                       0                    0
## 119  Pre COVID               0                       0                    0
## 120  Pre COVID               0                       0                    0
## 121  Pre COVID               0                       0                    0
## 122  Pre COVID              11                      17                    0
## 123 Post COVID              83                      78                   88
## 124 Post COVID              57                      63                   88
## 125 Post COVID              64                      68                   88
## 126 Post COVID              63                      66                   88
## 127 Post COVID              61                      65                   88
##     PMI_PCT Money_Supply_PCT CPI_PCT Share_Price_Index_PCT
## 117  -1.71%            0.44%   0.00%                 3.43%
## 118  -0.97%           -0.79%   0.97%                 1.75%
## 119   1.37%            1.82%   0.16%                 0.97%
## 120   1.54%           -0.45%  -0.07%                 1.74%
## 121  -2.28%           -1.47%  -0.98%                 0.54%
## 122   0.58%            0.74%  -0.12%                 1.12%
## 123 217.39%            1.35%   0.00%                -0.64%
## 124  70.21%            2.03%   0.46%                 9.55%
## 125   6.24%           -0.15%  -0.90%                -1.13%
## 126  -8.33%            0.27%   0.05%                -3.87%
## 127  -8.47%            0.35%   0.14%                -2.83%
##     unemployment_rate_pct Covid_share_pop_num       Date
## 117                -0.10%              0.0000 2019-09-30
## 118                                    0.0000 2019-10-31
## 119                                    0.0000 2019-11-30
## 120                -0.14%              0.0000 2019-12-31
## 121                                    0.0000 2020-01-31
## 122                                    0.0000 2020-02-29
## 123                                    0.0049 2020-05-31
## 124                 0.92%              0.0052 2020-06-30
## 125                                    0.0055 2020-07-31
## 126                                    0.0075 2020-08-31
## 127                 0.93%              0.0131 2020-09-30
m1 = with(SP, HotellingsT2(cbind( PMI, Money_supply,CPI,Share_Price_Index,unemployment_rate) ~ Period))
m1
## 
##  Hotelling's two sample T2-test
## 
## data:  cbind(PMI, Money_supply, CPI, Share_Price_Index, unemployment_rate) by Period
## T.2 = 82.524, df1 = 5, df2 = 5, p-value = 8.411e-05
## alternative hypothesis: true location difference is not equal to c(0,0,0,0,0)

##Mancova

mancova(data = SP,
    deps = vars(PMI,Money_supply,CPI,Share_Price_Index,unemployment_rate), factors = Period)
## 
##  MANCOVA
## 
##  Multivariate Tests                                                                    
##  ------------------------------------------------------------------------------------- 
##                                    value         F           df1    df2    p           
##  ------------------------------------------------------------------------------------- 
##    Period    Pillai's Trace         0.9880275    82.52440      5      5    0.0000841   
##              Wilks' Lambda         0.01197255    82.52440      5      5    0.0000841   
##              Hotelling's Trace       82.52440    82.52440      5      5    0.0000841   
##              Roy's Largest Root      82.52440    82.52440      5      5    0.0000841   
##  ------------------------------------------------------------------------------------- 
## 
## 
##  Univariate Tests                                                                                          
##  --------------------------------------------------------------------------------------------------------- 
##                 Dependent Variable    Sum of Squares    df    Mean Square      F              p            
##  --------------------------------------------------------------------------------------------------------- 
##    Period       PMI                       130.599273     1      130.5992727      3.3987805     0.0983505   
##                 Money_supply            23793.225485     1    23793.2254848    193.1030871     0.0000002   
##                 CPI                         1.818939     1        1.8189394      6.8595122     0.0278535   
##                 Share_Price_Index        1292.781775     1     1292.7817745    250.1132002    < .0000001   
##                 unemployment_rate           7.912758     1        7.9127576      0.1281219     0.7286385   
##    Residuals    PMI                       345.828000     9       38.4253333                                
##                 Money_supply             1108.936333     9      123.2151481                                
##                 CPI                         2.386533     9        0.2651704                                
##                 Share_Price_Index          46.519080     9        5.1687867                                
##                 unemployment_rate         555.836333     9       61.7595926                                
##  ---------------------------------------------------------------------------------------------------------

Russia

main_test = main %>% filter(Period != "COVID Month")
RU = subset(main_test, Country %in% "Russia")
RU 
##     Country Year Month  PMI Money_supply    CPI Share_Price_Index
## 105  Russia 2020     1 52.6      50622.9 182.99            185.47
## 106  Russia 2020     2 50.9      51314.2 183.72            182.01
## 107  Russia 2020     3 39.5      52327.0 184.82            146.90
## 108  Russia 2020     4 13.9      52951.7 186.30            153.70
## 109  Russia 2020     6 48.9      54392.6 187.23            164.28
## 110  Russia 2020     7 56.8      54687.4 187.98            167.35
## 111  Russia 2020     8 57.3      55294.2 187.98            178.70
## 112  Russia 2020     9 53.7      56023.9 188.55            173.58
##     unemployment_rate Population covid_cummulative Covid_share_pop_PCT
## 105               4.7  144370000                 0               0.00%
## 106               4.6  144370000                 2               0.00%
## 107               4.7  144370000                34               0.00%
## 108               5.8  144370000             24490               0.02%
## 109               6.2  144370000            537210               0.37%
## 110               6.3  144370000            746369               0.52%
## 111               6.4  144370000            917884               0.64%
## 112               0.0  144370000           1073849               0.74%
##         Period StringencyIndex GovernmentResponseIndex EconomicSupportIndex
## 105  Pre COVID               0                       0                    0
## 106  Pre COVID               8                       8                    0
## 107  Pre COVID              36                      32                    0
## 108  Pre COVID              85                      76                   50
## 109 Post COVID              75                      76                   63
## 110 Post COVID              68                      70                   63
## 111 Post COVID              68                      70                   63
## 112 Post COVID              39                      47                   38
##     PMI_PCT Money_Supply_PCT CPI_PCT Share_Price_Index_PCT
## 105   1.54%           -2.01%   0.40%                 4.63%
## 106  -3.23%            1.37%   0.40%                -1.87%
## 107 -22.40%            1.97%   0.60%               -19.29%
## 108 -64.81%            1.19%   0.80%                 4.63%
## 109  39.71%            2.50%   0.20%                 3.24%
## 110  16.16%            0.54%   0.40%                 1.87%
## 111   0.88%            1.11%   0.00%                 6.78%
## 112  -6.28%            1.32%   0.30%                -2.87%
##     unemployment_rate_pct Covid_share_pop_num       Date
## 105                 0.10%              0.0000 2020-01-31
## 106                -0.10%              0.0000 2020-02-29
## 107                 0.10%              0.0000 2020-03-31
## 108                 1.10%              0.0002 2020-04-30
## 109                 0.10%              0.0037 2020-06-30
## 110                 0.10%              0.0052 2020-07-31
## 111                 0.10%              0.0064 2020-08-31
## 112                                    0.0074 2020-09-30
m1 = with(RU, HotellingsT2(cbind( Money_supply,CPI,Share_Price_Index,unemployment_rate) ~ Period))
m1
## 
##  Hotelling's two sample T2-test
## 
## data:  cbind(Money_supply, CPI, Share_Price_Index, unemployment_rate) by Period
## T.2 = 8.5504, df1 = 4, df2 = 3, p-value = 0.05448
## alternative hypothesis: true location difference is not equal to c(0,0,0,0)

##Mancova

mancova(data = RU,
    deps = vars(PMI,Money_supply,CPI,Share_Price_Index,unemployment_rate), factors = Period)
## Warning in log(unlist(lapply(mats, det))): NaNs produced
## 
##  MANCOVA
## 
##  Multivariate Tests                                                                    
##  ------------------------------------------------------------------------------------- 
##                                    value         F           df1    df2    p           
##  ------------------------------------------------------------------------------------- 
##    Period    Pillai's Trace         0.9635481    10.57336      5      2    0.0886536   
##              Wilks' Lambda         0.03645191    10.57336      5      2    0.0886536   
##              Hotelling's Trace       26.43340    10.57336      5      2    0.0886536   
##              Roy's Largest Root      26.43340    10.57336      5      2    0.0886536   
##  ------------------------------------------------------------------------------------- 
## 
## 
##  Univariate Tests                                                                                           
##  ---------------------------------------------------------------------------------------------------------- 
##                 Dependent Variable    Sum of Squares     df    Mean Square       F              p           
##  ---------------------------------------------------------------------------------------------------------- 
##    Period       PMI                       447.0050000     1       447.0050000     2.67845426    0.1528298   
##                 Money_supply              2.172163e+7     1       2.172163e+7    27.22234384    0.0019810   
##                 CPI                        24.1860125     1        24.1860125    20.43032321    0.0040176   
##                 Share_Price_Index          31.3236125     1        31.3236125     0.14778023    0.7139215   
##                 unemployment_rate           0.1012500     1         0.1012500     0.01975128    0.8928334   
##    Residuals    PMI                      1001.3350000     6       166.8891667                               
##                 Money_supply          4787602.9975000     6    797933.8329167                               
##                 CPI                         7.1029750     6         1.1838292                               
##                 Share_Price_Index        1271.7646750     6       211.9607792                               
##                 unemployment_rate          30.7575000     6         5.1262500                               
##  ----------------------------------------------------------------------------------------------------------