First Method: Baseline Models

=========================

=========================

1) Packages

=========================

library(readxl)
## Warning: package 'readxl' was built under R version 4.4.3
library(plm)
## Warning: package 'plm' was built under R version 4.4.3
library(lmtest)
## Warning: package 'lmtest' was built under R version 4.4.3
## Loading required package: zoo
## Warning: package 'zoo' was built under R version 4.4.3
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
library(sandwich)
## Warning: package 'sandwich' was built under R version 4.4.3
library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.3. https://CRAN.R-project.org/package=stargazer

=========================

2) Read Excel File

=========================

df <- read_excel("Panel data 1.xlsx", skip = 1)

=========================

3) Rename Variables

=========================

names(df) <- c(
  "country", "id", "year", "emerging",
  "innovation", "people", "planet", "prosperity",
  "partnership", "peace",
  "inflation", "pop_growth", "urban_growth"
)

=========================

4) Clean Data

=========================

df$country <- as.factor(df$country)
df$year <- as.numeric(df$year)
df$emerging <- as.numeric(df$emerging)

df$innovation <- as.numeric(df$innovation)
## Warning: NAs introduced by coercion
df$people <- as.numeric(df$people)
## Warning: NAs introduced by coercion
df$planet <- as.numeric(df$planet)
df$prosperity <- as.numeric(df$prosperity)
df$partnership <- as.numeric(df$partnership)
df$peace <- as.numeric(df$peace)

df$inflation <- as.numeric(df$inflation)
df$pop_growth <- as.numeric(df$pop_growth)
df$urban_growth <- as.numeric(df$urban_growth)


df$id <- NULL
#Addressing missing data

install.packages("plm")  
## Warning: package 'plm' is in use and will not be installed
library(plm)
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.4.3
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:plm':
## 
##     between, lag, lead
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(zoo)
library(plm)
library(lmtest)
library(sandwich)

df <- df %>%
  group_by(country) %>%
  arrange(year) %>%
  
  mutate(across(where(is.numeric),
                ~ na.approx(., na.rm = FALSE))) %>%
  
  mutate(across(where(is.numeric),
                ~ na.locf(., na.rm = FALSE))) %>%
  
  mutate(across(where(is.numeric),
                ~ na.locf(., fromLast = TRUE))) %>%
  
  ungroup()

colSums(is.na(df))
##      country         year     emerging   innovation       people       planet 
##            0            0            0            0            0            0 
##   prosperity  partnership        peace    inflation   pop_growth urban_growth 
##            0            0            0            0            0            0

=========================

5) Convert to Panel Data

=========================

library(plm)
pdata <- pdata.frame(df, index = c("country", "year"))

pdim(pdata)
## Balanced Panel: n = 20, T = 11, N = 220
is.pbalanced(pdata)
## [1] TRUE

=========================

6) Prosperity Model

=========================

library(lmtest)
pool_prosperity <- plm(
  prosperity ~ innovation + emerging + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "pooling"
)

fe_prosperity <- plm(
  prosperity ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within"
)

re_prosperity <- plm(
  prosperity ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "random"
)


summary(pool_prosperity)
## Pooling Model
## 
## Call:
## plm(formula = prosperity ~ innovation + emerging + inflation + 
##     pop_growth + urban_growth, data = pdata, model = "pooling")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -11.00476  -1.09187   0.18052   1.36776   9.01890 
## 
## Coefficients:
##               Estimate Std. Error t-value  Pr(>|t|)    
## (Intercept)   2.865378   1.184145  2.4198 0.0163649 *  
## innovation   -0.018003   0.012864 -1.3995 0.1631138    
## emerging      0.338770   0.549209  0.6168 0.5380016    
## inflation     0.058192   0.022035  2.6409 0.0088790 ** 
## pop_growth   -1.483123   0.429944 -3.4496 0.0006762 ***
## urban_growth  0.758059   0.369263  2.0529 0.0412990 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    2192.4
## Residual Sum of Squares: 1910.5
## R-Squared:      0.12862
## Adj. R-Squared: 0.10826
## F-statistic: 6.3174 on 5 and 214 DF, p-value: 1.7157e-05
summary(fe_prosperity)
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = prosperity ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -11.84744  -0.61685   0.24422   0.93532   9.19719 
## 
## Coefficients:
##                Estimate Std. Error t-value Pr(>|t|)  
## innovation   -0.0030262  0.0199332 -0.1518  0.87949  
## inflation     0.0391551  0.0298872  1.3101  0.19170  
## pop_growth   -1.3271898  0.5148673 -2.5777  0.01068 *
## urban_growth  0.2690993  0.4515799  0.5959  0.55193  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1799.1
## Residual Sum of Squares: 1633.1
## R-Squared:      0.092268
## Adj. R-Squared: -0.014251
## F-statistic: 4.9807 on 4 and 196 DF, p-value: 0.00076151
summary(re_prosperity)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = prosperity ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                  var std.dev share
## idiosyncratic 8.3319  2.8865 0.954
## individual    0.4018  0.6339 0.046
## theta: 0.1917
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -10.62105  -0.89597   0.11962   1.30525   9.23615 
## 
## Coefficients:
##               Estimate Std. Error z-value Pr(>|z|)   
## (Intercept)   3.243741   1.115885  2.9069 0.003651 **
## innovation   -0.020404   0.012533 -1.6279 0.103539   
## inflation     0.062781   0.021965  2.8582 0.004261 **
## pop_growth   -1.438461   0.444733 -3.2344 0.001219 **
## urban_growth  0.688174   0.380116  1.8104 0.070229 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    2056.1
## Residual Sum of Squares: 1827.5
## R-Squared:      0.11118
## Adj. R-Squared: 0.094641
## Chisq: 26.8929 on 4 DF, p-value: 2.0895e-05
phtest(fe_prosperity, re_prosperity)
## 
##  Hausman Test
## 
## data:  prosperity ~ innovation + inflation + pop_growth + urban_growth
## chisq = 8.9501, df = 4, p-value = 0.06236
## alternative hypothesis: one model is inconsistent
coeftest(fe_prosperity, vcov = vcovHC(fe_prosperity, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                Estimate Std. Error t value  Pr(>|t|)    
## innovation   -0.0030262  0.0112007 -0.2702    0.7873    
## inflation     0.0391551  0.0317812  1.2320    0.2194    
## pop_growth   -1.3271898  0.1803145 -7.3604 4.931e-12 ***
## urban_growth  0.2690993  0.2397956  1.1222    0.2631    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

=========================

Prosperity Model by Country Group

=========================

developing <- subset(pdata, emerging == 1)
developed  <- subset(pdata, emerging == 0)

fe_dev <- plm(
  prosperity ~ innovation + inflation + pop_growth + urban_growth,
  data = developing,
  model = "within"
)

coeftest(fe_dev, vcov = vcovHC(fe_dev, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation   -0.004334   0.011129 -0.3894    0.6978    
## inflation     0.032225   0.030222  1.0663    0.2890    
## pop_growth   -1.350754   0.159333 -8.4776 2.745e-13 ***
## urban_growth  0.215746   0.237646  0.9078    0.3662    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
fe_adv <- plm(
  prosperity ~ innovation + inflation + pop_growth + urban_growth,
  data = developed,
  model = "within"
)

coeftest(fe_adv, vcov = vcovHC(fe_adv, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value Pr(>|t|)  
## innovation   -0.017616   0.048416 -0.3639  0.71676  
## inflation     0.183542   0.144525  1.2700  0.20717  
## pop_growth   -1.055745   0.518871 -2.0347  0.04464 *
## urban_growth  0.369052   0.428977  0.8603  0.39176  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

=========================

7) People Model

=========================

# 1) Fixed Effect - Full Sample
fe_people <- plm(
  people ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within"
)

summary(fe_people)
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = people ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##       Min.    1st Qu.     Median    3rd Qu.       Max. 
## -12.549251  -1.357753   0.016685   1.281127  16.504849 
## 
## Coefficients:
##               Estimate Std. Error t-value Pr(>|t|)    
## innovation    0.104403   0.030130  3.4651 0.000651 ***
## inflation     0.060890   0.045176  1.3478 0.179264    
## pop_growth    1.799063   0.778242  2.3117 0.021834 *  
## urban_growth -1.038783   0.682581 -1.5218 0.129659    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    4197.9
## Residual Sum of Squares: 3731.1
## R-Squared:      0.11119
## Adj. R-Squared: 0.0068909
## F-statistic: 6.12989 on 4 and 196 DF, p-value: 0.00011447
coeftest(
  fe_people,
  vcov = vcovHC(fe_people, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value Pr(>|t|)  
## innovation    0.104403   0.047138  2.2148  0.02792 *
## inflation     0.060890   0.038917  1.5646  0.11929  
## pop_growth    1.799063   0.836237  2.1514  0.03267 *
## urban_growth -1.038783   0.699747 -1.4845  0.13928  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# 2) Random Effect - Full Sample
re_people <- plm(
  people ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "random"
)

summary(re_people)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = people ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                   var std.dev share
## idiosyncratic  19.036   4.363 0.078
## individual    224.999  15.000 0.922
## theta: 0.9126
## 
## Residuals:
##    Min. 1st Qu.  Median 3rd Qu.    Max. 
## -9.8254 -1.7693 -0.2196  1.2168 19.8364 
## 
## Coefficients:
##               Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)  94.494951   4.184372 22.5828 < 2.2e-16 ***
## innovation    0.114224   0.029977  3.8104 0.0001387 ***
## inflation     0.057395   0.045103  1.2725 0.2031908    
## pop_growth    1.794495   0.780490  2.2992 0.0214942 *  
## urban_growth -1.024291   0.683904 -1.4977 0.1342082    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    4654.7
## Residual Sum of Squares: 4136.7
## R-Squared:      0.11129
## Adj. R-Squared: 0.094758
## Chisq: 26.9243 on 4 DF, p-value: 2.0592e-05
# 3) Hausman Test
phtest(fe_people, re_people)
## 
##  Hausman Test
## 
## data:  people ~ innovation + inflation + pop_growth + urban_growth
## chisq = 43.525, df = 4, p-value = 8.052e-09
## alternative hypothesis: one model is inconsistent

=========================

People Model by Country Group

=========================

# Developing Countries
fe_dev_people <- plm(
  people ~ innovation + inflation + pop_growth + urban_growth,
  data = developing,
  model = "within"
)

coeftest(
  fe_dev_people,
  vcov = vcovHC(fe_dev_people, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.151260   0.038452  3.9338 0.0001581 ***
## inflation     0.080353   0.047655  1.6861 0.0950146 .  
## pop_growth    1.188882   0.267422  4.4457 2.353e-05 ***
## urban_growth -0.154674   0.411145 -0.3762 0.7075965    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Developed Countries
fe_adv_people <- plm(
  people ~ innovation + inflation + pop_growth + urban_growth,
  data = developed,
  model = "within"
)

coeftest(
  fe_adv_people,
  vcov = vcovHC(fe_adv_people, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##              Estimate Std. Error t value Pr(>|t|)  
## innovation   -0.24028    0.19910 -1.2068  0.23046  
## inflation     0.21589    0.67644  0.3192  0.75030  
## pop_growth    9.21804    5.20935  1.7695  0.07998 .
## urban_growth -9.02480    4.10484 -2.1986  0.03031 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

=========================

8) Planet Model

=========================

# 1) Fixed Effect - Full Sample
fe_planet <- plm(
  planet ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within"
)

summary(fe_planet)
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = planet ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -2.049145 -0.370654  0.016869  0.343846  1.389278 
## 
## Coefficients:
##                Estimate Std. Error t-value Pr(>|t|)   
## innovation   -0.0144209  0.0044286 -3.2563  0.00133 **
## inflation    -0.0055770  0.0066401 -0.8399  0.40199   
## pop_growth    0.0964916  0.1143885  0.8435  0.39995   
## urban_growth -0.1569759  0.1003278 -1.5646  0.11928   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    85.944
## Residual Sum of Squares: 80.607
## R-Squared:      0.062098
## Adj. R-Squared: -0.047962
## F-statistic: 3.24428 on 4 and 196 DF, p-value: 0.013237
coeftest(
  fe_planet,
  vcov = vcovHC(fe_planet, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##                Estimate Std. Error t value Pr(>|t|)  
## innovation   -0.0144209  0.0085399 -1.6887  0.09287 .
## inflation    -0.0055770  0.0080708 -0.6910  0.49038  
## pop_growth    0.0964916  0.0884479  1.0909  0.27664  
## urban_growth -0.1569759  0.0642528 -2.4431  0.01545 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# 2) Random Effect - Full Sample
re_planet <- plm(
  planet ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "random"
)

summary(re_planet)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = planet ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                   var std.dev share
## idiosyncratic  0.4113  0.6413 0.029
## individual    13.8895  3.7269 0.971
## theta: 0.9482
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -1.99817 -0.41227 -0.12958  0.34439  1.77749 
## 
## Coefficients:
##                Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)   8.9176432  0.9502875  9.3842 < 2.2e-16 ***
## innovation   -0.0127731  0.0046103 -2.7706  0.005596 ** 
## inflation    -0.0067265  0.0069210 -0.9719  0.331102    
## pop_growth    0.1115638  0.1194187  0.9342  0.350188    
## urban_growth -0.1661947  0.1047044 -1.5873  0.112450    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    101.15
## Residual Sum of Squares: 96.536
## R-Squared:      0.04561
## Adj. R-Squared: 0.027854
## Chisq: 10.2748 on 4 DF, p-value: 0.036045
# 3) Hausman Test
phtest(fe_planet, re_planet)
## 
##  Hausman Test
## 
## data:  planet ~ innovation + inflation + pop_growth + urban_growth
## chisq = 2.0548, df = 4, p-value = 0.7257
## alternative hypothesis: one model is inconsistent

=========================

Planet Model by Country Group

=========================

# Developing Countries
fe_dev_planet <- plm(
  planet ~ innovation + inflation + pop_growth + urban_growth,
  data = developing,
  model = "within"
)

coeftest(
  fe_dev_planet,
  vcov = vcovHC(fe_dev_planet, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##                 Estimate  Std. Error t value  Pr(>|t|)    
## innovation   -0.00649978  0.00759801 -0.8555    0.3944    
## inflation     0.00081167  0.00232508  0.3491    0.7278    
## pop_growth    0.12922965  0.02231541  5.7910 8.820e-08 ***
## urban_growth -0.14002755  0.03004837 -4.6601 1.018e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Developed Countries
fe_adv_planet <- plm(
  planet ~ innovation + inflation + pop_growth + urban_growth,
  data = developed,
  model = "within"
)

coeftest(
  fe_adv_planet,
  vcov = vcovHC(fe_adv_planet, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation   -0.043566   0.032931 -1.3229 0.1889983    
## inflation    -0.197682   0.052792 -3.7445 0.0003081 ***
## pop_growth   -0.519287   0.463423 -1.1205 0.2652767    
## urban_growth  0.363490   0.333668  1.0894 0.2787153    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

=========================

9) Partnership Model

=========================

# 1) Fixed Effect - Full Sample
fe_partnership <- plm(
  partnership ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within"
)

summary(fe_partnership)
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = partnership ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -14.58662  -3.24186  -0.26078   2.29493  22.67526 
## 
## Coefficients:
##               Estimate Std. Error t-value  Pr(>|t|)    
## innovation    0.043004   0.040450  1.0632 0.2890209    
## inflation     0.240690   0.060649  3.9686 0.0001014 ***
## pop_growth    0.619910   1.044795  0.5933 0.5536429    
## urban_growth -0.173052   0.916368 -0.1888 0.8504096    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    7517.4
## Residual Sum of Squares: 6724.7
## R-Squared:      0.10545
## Adj. R-Squared: 0.00047321
## F-statistic: 5.77592 on 4 and 196 DF, p-value: 0.00020502
coeftest(
  fe_partnership,
  vcov = vcovHC(fe_partnership, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.043004   0.061586  0.6983 0.4858334    
## inflation     0.240690   0.061285  3.9274 0.0001189 ***
## pop_growth    0.619910   0.744969  0.8321 0.4063489    
## urban_growth -0.173052   0.647657 -0.2672 0.7895987    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# 2) Random Effect - Full Sample
re_partnership <- plm(
  partnership ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "random"
)

summary(re_partnership)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = partnership ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                   var std.dev share
## idiosyncratic  34.310   5.857  0.04
## individual    819.810  28.632  0.96
## theta: 0.9384
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -14.02895  -3.59439  -0.89547   2.30030  28.55701 
## 
## Coefficients:
##               Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)  59.734781   7.313974  8.1672 3.156e-16 ***
## innovation    0.051604   0.040801  1.2648 0.2059540    
## inflation     0.235800   0.061283  3.8477 0.0001192 ***
## pop_growth    0.579548   1.058095  0.5477 0.5838788    
## urban_growth -0.127987   0.927593 -0.1380 0.8902584    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    8377.2
## Residual Sum of Squares: 7584
## R-Squared:      0.094686
## Adj. R-Squared: 0.077843
## Chisq: 22.4867 on 4 DF, p-value: 0.00016031
# 3) Hausman Test
phtest(fe_partnership, re_partnership)
## 
##  Hausman Test
## 
## data:  partnership ~ innovation + inflation + pop_growth + urban_growth
## chisq = 2.951, df = 4, p-value = 0.5661
## alternative hypothesis: one model is inconsistent

=========================

Partnership Model by Country Group

=========================

# Developing Countries
fe_dev_partnership <- plm(
  partnership ~ innovation + inflation + pop_growth + urban_growth,
  data = developing,
  model = "within"
)

coeftest(
  fe_dev_partnership,
  vcov = vcovHC(fe_dev_partnership, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.024269   0.064874  0.3741    0.7092    
## inflation     0.206543   0.042567  4.8522 4.717e-06 ***
## pop_growth    0.793073   0.732546  1.0826    0.2817    
## urban_growth -0.375639   0.648665 -0.5791    0.5639    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Developed Countries
fe_adv_partnership <- plm(
  partnership ~ innovation + inflation + pop_growth + urban_growth,
  data = developed,
  model = "within"
)

coeftest(
  fe_adv_partnership,
  vcov = vcovHC(fe_adv_partnership, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value Pr(>|t|)  
## innovation    0.030311   0.168087  0.1803  0.85727  
## inflation     1.352131   0.529864  2.5518  0.01229 *
## pop_growth    0.423550   2.259457  0.1875  0.85170  
## urban_growth -0.745084   2.017032 -0.3694  0.71265  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

=========================

10) Peace Model

=========================

# 1) Fixed Effect - Full Sample
fe_peace <- plm(
  peace ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within"
)

summary(fe_peace)
## Oneway (individual) effect Within Model
## 
## Call:
## plm(formula = peace ~ innovation + inflation + pop_growth + urban_growth, 
##     data = pdata, model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -6.70257 -1.60393  0.19976  1.62031  7.75459 
## 
## Coefficients:
##               Estimate Std. Error t-value  Pr(>|t|)    
## innovation    0.027534   0.018043  1.5260 0.1286119    
## inflation    -0.023745   0.027053 -0.8778 0.3811517    
## pop_growth   -1.084759   0.466033 -2.3276 0.0209518 *  
## urban_growth  1.370221   0.408749  3.3522 0.0009619 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1459.1
## Residual Sum of Squares: 1338
## R-Squared:      0.083012
## Adj. R-Squared: -0.024594
## F-statistic: 4.43582 on 4 and 196 DF, p-value: 0.0018722
coeftest(
  fe_peace,
  vcov = vcovHC(fe_peace, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.027534   0.039845  0.6910 0.4903730    
## inflation    -0.023745   0.036522 -0.6502 0.5163398    
## pop_growth   -1.084759   0.345812 -3.1368 0.0019709 ** 
## urban_growth  1.370221   0.400403  3.4221 0.0007563 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# 2) Random Effect - Full Sample
re_peace <- plm(
  peace ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "random"
)

summary(re_peace)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = peace ~ innovation + inflation + pop_growth + urban_growth, 
##     data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                  var std.dev share
## idiosyncratic  6.826   2.613 0.075
## individual    84.194   9.176 0.925
## theta: 0.9145
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -8.19667 -1.80662  0.17292  2.00968  6.68124 
## 
## Coefficients:
##               Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)  65.526408   2.708807 24.1901 < 2.2e-16 ***
## innovation    0.040917   0.019143  2.1374  0.032564 *  
## inflation    -0.037723   0.028799 -1.3099  0.190245    
## pop_growth   -1.067278   0.498260 -2.1420  0.032193 *  
## urban_growth  1.300261   0.436617  2.9780  0.002901 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1821
## Residual Sum of Squares: 1685.5
## R-Squared:      0.074393
## Adj. R-Squared: 0.057172
## Chisq: 17.28 on 4 DF, p-value: 0.0017052
# 3) Hausman Test
phtest(fe_peace, re_peace)
## 
##  Hausman Test
## 
## data:  peace ~ innovation + inflation + pop_growth + urban_growth
## chisq = 6.4253, df = 4, p-value = 0.1696
## alternative hypothesis: one model is inconsistent

=========================

Peace Model by Country Group

=========================

# Developing Countries
fe_dev_peace <- plm(
  peace ~ innovation + inflation + pop_growth + urban_growth,
  data = developing,
  model = "within"
)

coeftest(
  fe_dev_peace,
  vcov = vcovHC(fe_dev_peace, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value Pr(>|t|)   
## innovation    0.018495   0.041579  0.4448 0.657445   
## inflation    -0.013893   0.042839 -0.3243 0.746415   
## pop_growth   -0.981240   0.381010 -2.5754 0.011539 * 
## urban_growth  1.372282   0.457074  3.0023 0.003415 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Developed Countries
fe_adv_peace <- plm(
  peace ~ innovation + inflation + pop_growth + urban_growth,
  data = developed,
  model = "within"
)

coeftest(
  fe_adv_peace,
  vcov = vcovHC(fe_adv_peace, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##              Estimate Std. Error t value Pr(>|t|)
## innovation    0.13309    0.12106  1.0994   0.2744
## inflation    -0.27056    0.16821 -1.6085   0.1110
## pop_growth   -2.20104    1.43696 -1.5317   0.1289
## urban_growth  1.79072    1.11614  1.6044   0.1119

=========================

11) Main Results Table - Fixed Effects

=========================

install.packages("stargazer")
## Warning: package 'stargazer' is in use and will not be installed
library(stargazer)
stargazer(
  fe_prosperity, fe_people, fe_planet, fe_partnership, fe_peace,
  type = "text",
  title = "Fixed Effects Results",
  column.labels = c("Prosperity", "People", "Planet", "Partnership", "Peace"),
  dep.var.labels.include = FALSE,
  digits = 3
)
## 
## Fixed Effects Results
## ============================================================================
##                                          Dependent variable:                
##                           --------------------------------------------------
##                           Prosperity  People   Planet   Partnership  Peace  
##                              (1)       (2)       (3)        (4)       (5)   
## ----------------------------------------------------------------------------
## innovation                  -0.003   0.104*** -0.014***    0.043     0.028  
##                            (0.020)   (0.030)   (0.004)    (0.040)   (0.018) 
##                                                                             
## inflation                   0.039     0.061    -0.006    0.241***    -0.024 
##                            (0.030)   (0.045)   (0.007)    (0.061)   (0.027) 
##                                                                             
## pop_growth                 -1.327**  1.799**    0.096      0.620    -1.085**
##                            (0.515)   (0.778)   (0.114)    (1.045)   (0.466) 
##                                                                             
## urban_growth                0.269     -1.039   -0.157     -0.173    1.370***
##                            (0.452)   (0.683)   (0.100)    (0.916)   (0.409) 
##                                                                             
## ----------------------------------------------------------------------------
## Observations                 220       220       220        220       220   
## R2                          0.092     0.111     0.062      0.105     0.083  
## Adjusted R2                 -0.014    0.007    -0.048     0.0005     -0.025 
## F Statistic (df = 4; 196)  4.981***  6.130***  3.244**   5.776***   4.436***
## ============================================================================
## Note:                                            *p<0.1; **p<0.05; ***p<0.01

=========================

12) Main Results Table - ٌRandom Effects

=========================

stargazer(
  re_prosperity, re_people, re_planet, re_partnership, re_peace,
  type = "text",
  title = "Random Effects Results",
  column.labels = c("Prosperity", "People", "Planet", "Partnership", "Peace"),
  dep.var.labels.include = FALSE,
  digits = 3,

  se = list(
    sqrt(diag(vcovHC(re_prosperity, type = "HC1", cluster = "group"))),
    sqrt(diag(vcovHC(re_people, type = "HC1", cluster = "group"))),
    sqrt(diag(vcovHC(re_planet, type = "HC1", cluster = "group"))),
    sqrt(diag(vcovHC(re_partnership, type = "HC1", cluster = "group"))),
    sqrt(diag(vcovHC(re_peace, type = "HC1", cluster = "group")))
  )
)
## 
## Random Effects Results
## =================================================================
##                              Dependent variable:                 
##              ----------------------------------------------------
##              Prosperity  People    Planet   Partnership   Peace  
##                 (1)        (2)       (3)        (4)        (5)   
## -----------------------------------------------------------------
## innovation     -0.020    0.114**   -0.013      0.052      0.041  
##               (0.015)    (0.046)   (0.008)    (0.062)    (0.039) 
##                                                                  
## inflation     0.063***    0.057    -0.007    0.236***    -0.038  
##               (0.018)    (0.038)   (0.008)    (0.060)    (0.034) 
##                                                                  
## pop_growth   -1.438***   1.794**    0.112      0.580    -1.067***
##               (0.413)    (0.838)   (0.087)    (0.755)    (0.342) 
##                                                                  
## urban_growth   0.688*    -1.024   -0.166***   -0.128    1.300*** 
##               (0.397)    (0.708)   (0.064)    (0.680)    (0.383) 
##                                                                  
## Constant      3.244**   94.495*** 8.918***   59.735***  65.526***
##               (1.384)    (5.955)   (1.714)    (7.969)    (4.816) 
##                                                                  
## -----------------------------------------------------------------
## Observations    220        220       220        220        220   
## R2             0.111      0.111     0.046      0.095      0.074  
## Adjusted R2    0.095      0.095     0.028      0.078      0.057  
## F Statistic  26.893***  26.924*** 10.275**   22.487***  17.280***
## =================================================================
## Note:                                 *p<0.1; **p<0.05; ***p<0.01

=========================

13) Robust Results Manually

=========================

coeftest(fe_prosperity, vcov = vcovHC(fe_prosperity, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                Estimate Std. Error t value  Pr(>|t|)    
## innovation   -0.0030262  0.0112007 -0.2702    0.7873    
## inflation     0.0391551  0.0317812  1.2320    0.2194    
## pop_growth   -1.3271898  0.1803145 -7.3604 4.931e-12 ***
## urban_growth  0.2690993  0.2397956  1.1222    0.2631    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_people, vcov = vcovHC(fe_people, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value Pr(>|t|)  
## innovation    0.104403   0.047138  2.2148  0.02792 *
## inflation     0.060890   0.038917  1.5646  0.11929  
## pop_growth    1.799063   0.836237  2.1514  0.03267 *
## urban_growth -1.038783   0.699747 -1.4845  0.13928  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_planet, vcov = vcovHC(fe_planet, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                Estimate Std. Error t value Pr(>|t|)  
## innovation   -0.0144209  0.0085399 -1.6887  0.09287 .
## inflation    -0.0055770  0.0080708 -0.6910  0.49038  
## pop_growth    0.0964916  0.0884479  1.0909  0.27664  
## urban_growth -0.1569759  0.0642528 -2.4431  0.01545 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_partnership, vcov = vcovHC(fe_partnership, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.043004   0.061586  0.6983 0.4858334    
## inflation     0.240690   0.061285  3.9274 0.0001189 ***
## pop_growth    0.619910   0.744969  0.8321 0.4063489    
## urban_growth -0.173052   0.647657 -0.2672 0.7895987    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_peace, vcov = vcovHC(fe_peace, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.027534   0.039845  0.6910 0.4903730    
## inflation    -0.023745   0.036522 -0.6502 0.5163398    
## pop_growth   -1.084759   0.345812 -3.1368 0.0019709 ** 
## urban_growth  1.370221   0.400403  3.4221 0.0007563 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

================================

Second Method: Two-Way Fixed Effects

================================

# Prosperity
twfe_prosperity <- plm(
  prosperity ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within",
  effect = "twoways"
)

summary(twfe_prosperity)
## Twoways effects Within Model
## 
## Call:
## plm(formula = prosperity ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -5.745747 -0.672581  0.089172  0.673767  6.241315 
## 
## Coefficients:
##               Estimate Std. Error t-value Pr(>|t|)  
## innovation    0.016241   0.018734  0.8669  0.38710  
## inflation    -0.014460   0.019184 -0.7538  0.45194  
## pop_growth   -0.682002   0.317253 -2.1497  0.03287 *
## urban_growth -0.125201   0.280512 -0.4463  0.65588  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    638.56
## Residual Sum of Squares: 569.55
## R-Squared:      0.10807
## Adj. R-Squared: -0.05017
## F-statistic: 5.63439 on 4 and 186 DF, p-value: 0.00026544
coeftest(
  twfe_prosperity,
  vcov = vcovHC(twfe_prosperity, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.016241   0.013738  1.1822    0.2386    
## inflation    -0.014460   0.013439 -1.0760    0.2833    
## pop_growth   -0.682002   0.086015 -7.9289 1.989e-13 ***
## urban_growth -0.125201   0.088076 -1.4215    0.1568    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# People
twfe_people <- plm(
  people ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within",
  effect = "twoways"
)

summary(twfe_people)
## Twoways effects Within Model
## 
## Call:
## plm(formula = people ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -11.82897  -1.23066  -0.04688   1.21813  16.34940 
## 
## Coefficients:
##               Estimate Std. Error t-value Pr(>|t|)   
## innovation    0.126812   0.047647  2.6615 0.008461 **
## inflation     0.059812   0.048794  1.2258 0.221818   
## pop_growth    1.837253   0.806907  2.2769 0.023930 * 
## urban_growth -1.003027   0.713460 -1.4059 0.161433   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    3978.3
## Residual Sum of Squares: 3684.4
## R-Squared:      0.073864
## Adj. R-Squared: -0.090451
## F-statistic: 3.7086 on 4 and 186 DF, p-value: 0.0062618
coeftest(
  twfe_people,
  vcov = vcovHC(twfe_people, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value Pr(>|t|)  
## innovation    0.126812   0.107455  1.1801  0.23945  
## inflation     0.059812   0.031766  1.8829  0.06127 .
## pop_growth    1.837253   0.799279  2.2986  0.02264 *
## urban_growth -1.003027   0.742537 -1.3508  0.17840  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Planet
twfe_planet <- plm(
  planet ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within",
  effect = "twoways"
)

summary(twfe_planet)
## Twoways effects Within Model
## 
## Call:
## plm(formula = planet ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -1.251333 -0.238935 -0.012009  0.234201  1.268538 
## 
## Coefficients:
##                Estimate Std. Error t-value Pr(>|t|)    
## innovation    0.0406261  0.0044725  9.0835  < 2e-16 ***
## inflation     0.0030973  0.0045801  0.6763  0.49972    
## pop_growth    0.1525493  0.0757415  2.0141  0.04544 *  
## urban_growth -0.1289809  0.0669699 -1.9260  0.05563 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    49.111
## Residual Sum of Squares: 32.463
## R-Squared:      0.33898
## Adj. R-Squared: 0.22171
## F-statistic: 23.8463 on 4 and 186 DF, p-value: 6.1928e-16
coeftest(
  twfe_planet,
  vcov = vcovHC(twfe_planet, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##                Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.0406261  0.0080134  5.0698 9.577e-07 ***
## inflation     0.0030973  0.0044454  0.6967   0.48683    
## pop_growth    0.1525493  0.0889109  1.7158   0.08787 .  
## urban_growth -0.1289809  0.0504951 -2.5543   0.01144 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Partnership
twfe_partnership <- plm(
  partnership ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within",
  effect = "twoways"
)

summary(twfe_partnership)
## Twoways effects Within Model
## 
## Call:
## plm(formula = partnership ~ innovation + inflation + pop_growth + 
##     urban_growth, data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##       Min.    1st Qu.     Median    3rd Qu.       Max. 
## -14.476587  -2.430891   0.037557   2.502254  17.336019 
## 
## Coefficients:
##               Estimate Std. Error t-value Pr(>|t|)    
## innovation   -0.166537   0.049366 -3.3735 0.000903 ***
## inflation     0.066078   0.050553  1.3071 0.192795    
## pop_growth    1.131432   0.836007  1.3534 0.177578    
## urban_growth -1.426034   0.739190 -1.9292 0.055230 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    4343.9
## Residual Sum of Squares: 3955
## R-Squared:      0.089529
## Adj. R-Squared: -0.072006
## F-statistic: 4.57249 on 4 and 186 DF, p-value: 0.0015186
coeftest(
  twfe_partnership,
  vcov = vcovHC(twfe_partnership, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value Pr(>|t|)  
## innovation   -0.166537   0.070551 -2.3605  0.01928 *
## inflation     0.066078   0.053779  1.2287  0.22074  
## pop_growth    1.131432   0.663641  1.7049  0.08989 .
## urban_growth -1.426034   0.655775 -2.1746  0.03092 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Peace
twfe_peace <- plm(
  peace ~ innovation + inflation + pop_growth + urban_growth,
  data = pdata,
  model = "within",
  effect = "twoways"
)

summary(twfe_peace)
## Twoways effects Within Model
## 
## Call:
## plm(formula = peace ~ innovation + inflation + pop_growth + urban_growth, 
##     data = pdata, effect = "twoways", model = "within")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -6.70093 -1.55753 -0.11623  1.59964  8.10860 
## 
## Coefficients:
##               Estimate Std. Error t-value  Pr(>|t|)    
## innovation    0.043292   0.028175  1.5365 0.1261057    
## inflation    -0.015869   0.028853 -0.5500 0.5829758    
## pop_growth   -1.050688   0.477147 -2.2020 0.0288935 *  
## urban_growth  1.434703   0.421889  3.4007 0.0008227 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    1416.6
## Residual Sum of Squares: 1288.3
## R-Squared:      0.090549
## Adj. R-Squared: -0.070805
## F-statistic: 4.62976 on 4 and 186 DF, p-value: 0.0013822
coeftest(
  twfe_peace,
  vcov = vcovHC(twfe_peace, type = "HC1", cluster = "group")
)
## 
## t test of coefficients:
## 
##               Estimate Std. Error t value  Pr(>|t|)    
## innovation    0.043292   0.049721  0.8707 0.3850336    
## inflation    -0.015869   0.040835 -0.3886 0.6980022    
## pop_growth   -1.050688   0.341785 -3.0741 0.0024290 ** 
## urban_growth  1.434703   0.388349  3.6944 0.0002897 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

================================

TWFE Results Table

================================

library(modelsummary)
## Warning: package 'modelsummary' was built under R version 4.4.3
modelsummary(
 list(
  "Prosperity" = twfe_prosperity,
  "People" = twfe_people,
  "Planet" = twfe_planet,
  "Partnership" = twfe_partnership,
  "Peace" = twfe_peace
 ),
 stars = TRUE,
 output = "markdown"
)
Prosperity People Planet Partnership Peace
innovation 0.016 0.127** 0.041*** -0.167*** 0.043
(0.019) (0.048) (0.004) (0.049) (0.028)
inflation -0.014 0.060 0.003 0.066 -0.016
(0.019) (0.049) (0.005) (0.051) (0.029)
pop_growth -0.682* 1.837* 0.153* 1.131 -1.051*
(0.317) (0.807) (0.076) (0.836) (0.477)
urban_growth -0.125 -1.003 -0.129+ -1.426+ 1.435***
(0.281) (0.713) (0.067) (0.739) (0.422)
Num.Obs. 220 220 220 220 220
R2 0.108 0.074 0.339 0.090 0.091
R2 Adj. -0.050 -0.090 0.222 -0.072 -0.071
AIC 843.6 1254.3 213.4 1269.9 1023.2
BIC 860.6 1271.3 230.3 1286.9 1040.1
RMSE 1.61 4.09 0.38 4.24 2.42
  • p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001

================================

Third Method: Correlated Random Effects (CRE) / Mundlak

================================

# Create country-level means
pdata$mean_innovation <- ave(pdata$innovation, pdata$country)
pdata$mean_inflation <- ave(pdata$inflation, pdata$country)
pdata$mean_pop_growth <- ave(pdata$pop_growth, pdata$country)
pdata$mean_urban_growth <- ave(pdata$urban_growth, pdata$country)

# Check emerging dummy
table(pdata$emerging)
## 
##   0   1 
## 110 110

================================

CRE Models

================================

cre_prosperity <- plm(
  prosperity ~ innovation + inflation + pop_growth + urban_growth +
    emerging + mean_innovation + mean_inflation +
    mean_pop_growth + mean_urban_growth,
  data = pdata,
  model = "random"
)

cre_people <- plm(
  people ~ innovation + inflation + pop_growth + urban_growth +
    emerging + mean_innovation + mean_inflation +
    mean_pop_growth + mean_urban_growth,
  data = pdata,
  model = "random"
)

cre_planet <- plm(
  planet ~ innovation + inflation + pop_growth + urban_growth +
    emerging + mean_innovation + mean_inflation +
    mean_pop_growth + mean_urban_growth,
  data = pdata,
  model = "random"
)

cre_partnership <- plm(
  partnership ~ innovation + inflation + pop_growth + urban_growth +
    emerging + mean_innovation + mean_inflation +
    mean_pop_growth + mean_urban_growth,
  data = pdata,
  model = "random"
)

cre_peace <- plm(
  peace ~ innovation + inflation + pop_growth + urban_growth +
    emerging + mean_innovation + mean_inflation +
    mean_pop_growth + mean_urban_growth,
  data = pdata,
  model = "random"
)

================================

Summaries

================================

summary(cre_prosperity)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = prosperity ~ innovation + inflation + pop_growth + 
##     urban_growth + emerging + mean_innovation + mean_inflation + 
##     mean_pop_growth + mean_urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                  var std.dev share
## idiosyncratic 8.3319  2.8865 0.954
## individual    0.3995  0.6321 0.046
## theta: 0.1909
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -10.74948  -0.88966   0.16356   1.34939   9.49080 
## 
## Coefficients:
##                     Estimate Std. Error z-value Pr(>|z|)   
## (Intercept)        3.6809403  1.8912341  1.9463 0.051617 . 
## innovation        -0.0030262  0.0199332 -0.1518 0.879331   
## inflation          0.0391551  0.0298872  1.3101 0.190164   
## pop_growth        -1.3271898  0.5148673 -2.5777 0.009945 **
## urban_growth       0.2690993  0.4515799  0.5959 0.551238   
## emerging          -0.8416570  0.8293534 -1.0148 0.310184   
## mean_innovation   -0.0310662  0.0291756 -1.0648 0.286968   
## mean_inflation    -0.0108225  0.0524076 -0.2065 0.836395   
## mean_pop_growth   -0.4497601  1.0730503 -0.4191 0.675113   
## mean_urban_growth  1.6688875  0.9485019  1.7595 0.078493 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    2056.6
## Residual Sum of Squares: 1749.7
## R-Squared:      0.14922
## Adj. R-Squared: 0.11276
## Chisq: 36.8333 on 9 DF, p-value: 2.8183e-05
summary(cre_people)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = people ~ innovation + inflation + pop_growth + 
##     urban_growth + emerging + mean_innovation + mean_inflation + 
##     mean_pop_growth + mean_urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                   var std.dev share
## idiosyncratic  19.036   4.363 0.085
## individual    205.433  14.333 0.915
## theta: 0.9086
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -11.18215  -1.57780  -0.22613   1.30395  18.73039 
## 
## Coefficients:
##                     Estimate Std. Error z-value Pr(>|z|)    
## (Intercept)        65.412752  25.307136  2.5848 0.009745 ** 
## innovation          0.104403   0.030130  3.4651 0.000530 ***
## inflation           0.060890   0.045176  1.3478 0.177709    
## pop_growth          1.799063   0.778242  2.3117 0.020794 *  
## urban_growth       -1.038783   0.682581 -1.5218 0.128047    
## emerging          -17.252362  11.097812 -1.5546 0.120048    
## mean_innovation     0.348995   0.286670  1.2174 0.223449    
## mean_inflation      0.271003   0.577834  0.4690 0.639071    
## mean_pop_growth    -7.069205  12.621968 -0.5601 0.575431    
## mean_urban_growth  13.235732  11.182249  1.1836 0.236557    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    4697.8
## Residual Sum of Squares: 3997.6
## R-Squared:      0.14905
## Adj. R-Squared: 0.11258
## Chisq: 36.7818 on 9 DF, p-value: 2.8785e-05
summary(cre_planet)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = planet ~ innovation + inflation + pop_growth + 
##     urban_growth + emerging + mean_innovation + mean_inflation + 
##     mean_pop_growth + mean_urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                   var std.dev share
## idiosyncratic  0.4113  0.6413  0.03
## individual    13.2344  3.6379  0.97
## theta: 0.9469
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -2.13800 -0.39195 -0.01792  0.39925  1.63398 
## 
## Coefficients:
##                     Estimate Std. Error z-value Pr(>|z|)   
## (Intercept)       -3.9661071  6.4054743 -0.6192 0.535801   
## innovation        -0.0144209  0.0044286 -3.2563 0.001129 **
## inflation         -0.0055770  0.0066401 -0.8399 0.400968   
## pop_growth         0.0964916  0.1143885  0.8435 0.398925   
## urban_growth      -0.1569759  0.1003278 -1.5646 0.117670   
## emerging          -3.7056110  2.8089607 -1.3192 0.187099   
## mean_innovation    0.1460366  0.0722928  2.0201 0.043376 * 
## mean_inflation    -0.1036246  0.1459586 -0.7100 0.477730   
## mean_pop_growth    5.1384807  3.1907115  1.6104 0.107300   
## mean_urban_growth -0.5144821  2.8268355 -0.1820 0.855583   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    101.9
## Residual Sum of Squares: 86.365
## R-Squared:      0.15245
## Adj. R-Squared: 0.11612
## Chisq: 37.7719 on 9 DF, p-value: 1.9152e-05
summary(cre_partnership)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = partnership ~ innovation + inflation + pop_growth + 
##     urban_growth + emerging + mean_innovation + mean_inflation + 
##     mean_pop_growth + mean_urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                   var std.dev share
## idiosyncratic  34.310   5.857 0.038
## individual    872.509  29.538 0.962
## theta: 0.9403
## 
## Residuals:
##      Min.   1st Qu.    Median   3rd Qu.      Max. 
## -14.16434  -3.50657  -0.73696   2.41664  26.17133 
## 
## Coefficients:
##                     Estimate Std. Error z-value Pr(>|z|)    
## (Intercept)       -57.039877  52.029034 -1.0963  0.27294    
## innovation          0.043004   0.040450  1.0632  0.28771    
## inflation           0.240690   0.060649  3.9686 7.23e-05 ***
## pop_growth          0.619910   1.044795  0.5933  0.55296    
## urban_growth       -0.173052   0.916368 -0.1888  0.85021    
## emerging            7.114247  22.816032  0.3118  0.75519    
## mean_innovation     1.336464   0.587496  2.2748  0.02292 *  
## mean_inflation     -1.566780   1.185886 -1.3212  0.18644    
## mean_pop_growth   -53.641162  25.921242 -2.0694  0.03851 *  
## mean_urban_growth  53.908156  22.965047  2.3474  0.01890 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    8325.5
## Residual Sum of Squares: 7205
## R-Squared:      0.13458
## Adj. R-Squared: 0.097492
## Chisq: 32.6571 on 9 DF, p-value: 0.00015321
summary(cre_peace)
## Oneway (individual) effect Random Effect Model 
##    (Swamy-Arora's transformation)
## 
## Call:
## plm(formula = peace ~ innovation + inflation + pop_growth + urban_growth + 
##     emerging + mean_innovation + mean_inflation + mean_pop_growth + 
##     mean_urban_growth, data = pdata, model = "random")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Effects:
##                  var std.dev share
## idiosyncratic  6.826   2.613 0.163
## individual    35.084   5.923 0.837
## theta: 0.8682
## 
## Residuals:
##     Min.  1st Qu.   Median  3rd Qu.     Max. 
## -6.67643 -1.50628  0.20879  1.72335  6.70523 
## 
## Coefficients:
##                     Estimate Std. Error z-value  Pr(>|z|)    
## (Intercept)        47.282338  10.506184  4.5004 6.782e-06 ***
## innovation          0.027534   0.018043  1.5260 0.1269999    
## inflation          -0.023745   0.027053 -0.8778 0.3800770    
## pop_growth         -1.084759   0.466033 -2.3276 0.0199311 *  
## urban_growth        1.370221   0.408749  3.3522 0.0008016 ***
## emerging          -21.428510   4.607224 -4.6511 3.302e-06 ***
## mean_innovation     0.341966   0.119718  2.8564 0.0042845 ** 
## mean_inflation     -0.450004   0.240677 -1.8697 0.0615195 .  
## mean_pop_growth    -9.636802   5.250726 -1.8353 0.0664572 .  
## mean_urban_growth  11.579174   4.651615  2.4893 0.0128002 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Total Sum of Squares:    2318.8
## Residual Sum of Squares: 1433.5
## R-Squared:      0.38179
## Adj. R-Squared: 0.35529
## Chisq: 129.689 on 9 DF, p-value: < 2.22e-16

================================

Robust Standard Errors

================================

coeftest(cre_prosperity, vcov = vcovHC(cre_prosperity, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        3.6809403  1.6701496  2.2040  0.02861 *  
## innovation        -0.0030262  0.0113596 -0.2664  0.79019    
## inflation          0.0391551  0.0322321  1.2148  0.22581    
## pop_growth        -1.3271898  0.1828723 -7.2575 7.52e-12 ***
## urban_growth       0.2690993  0.2431971  1.1065  0.26977    
## emerging          -0.8416570  0.6547398 -1.2855  0.20004    
## mean_innovation   -0.0310662  0.0243809 -1.2742  0.20400    
## mean_inflation    -0.0108225  0.0472939 -0.2288  0.81922    
## mean_pop_growth   -0.4497601  0.7376511 -0.6097  0.54271    
## mean_urban_growth  1.6688875  0.7122907  2.3430  0.02007 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_people, vcov = vcovHC(cre_people, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                     Estimate Std. Error t value Pr(>|t|)   
## (Intercept)        65.412752  21.331878  3.0664 0.002451 **
## innovation          0.104403   0.047807  2.1838 0.030081 * 
## inflation           0.060890   0.039469  1.5427 0.124401   
## pop_growth          1.799063   0.848099  2.1213 0.035070 * 
## urban_growth       -1.038783   0.709673 -1.4637 0.144758   
## emerging          -17.252362  11.818185 -1.4598 0.145835   
## mean_innovation     0.348995   0.228569  1.5269 0.128299   
## mean_inflation      0.271003   0.391496  0.6922 0.489561   
## mean_pop_growth    -7.069205  10.725002 -0.6591 0.510532   
## mean_urban_growth  13.235732   8.701514  1.5211 0.129743   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_planet, vcov = vcovHC(cre_planet, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                     Estimate Std. Error t value Pr(>|t|)  
## (Intercept)       -3.9661071  5.1289726 -0.7733  0.44023  
## innovation        -0.0144209  0.0086610 -1.6650  0.09740 .
## inflation         -0.0055770  0.0081853 -0.6813  0.49641  
## pop_growth         0.0964916  0.0897025  1.0757  0.28330  
## urban_growth      -0.1569759  0.0651643 -2.4089  0.01686 *
## emerging          -3.7056110  2.1153907 -1.7517  0.08128 .
## mean_innovation    0.1460366  0.0591991  2.4669  0.01443 *
## mean_inflation    -0.1036246  0.1164966 -0.8895  0.37475  
## mean_pop_growth    5.1384807  2.7001126  1.9031  0.05840 .
## mean_urban_growth -0.5144821  2.2472443 -0.2289  0.81914  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_partnership, vcov = vcovHC(cre_partnership, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                     Estimate Std. Error t value  Pr(>|t|)    
## (Intercept)       -57.039877  42.875636 -1.3304 0.1848438    
## innovation          0.043004   0.062460  0.6885 0.4918930    
## inflation           0.240690   0.062154  3.8725 0.0001439 ***
## pop_growth          0.619910   0.755536  0.8205 0.4128671    
## urban_growth       -0.173052   0.656844 -0.2635 0.7924548    
## emerging            7.114247  18.888073  0.3767 0.7068119    
## mean_innovation     1.336464   0.492623  2.7130 0.0072219 ** 
## mean_inflation     -1.566780   0.887015 -1.7664 0.0787897 .  
## mean_pop_growth   -53.641162  28.285147 -1.8964 0.0592742 .  
## mean_urban_growth  53.908156  25.832454  2.0868 0.0381097 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_peace, vcov = vcovHC(cre_peace, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                     Estimate Std. Error t value  Pr(>|t|)    
## (Intercept)        47.282338  11.652016  4.0579 6.984e-05 ***
## innovation          0.027534   0.040411  0.6814 0.4964000    
## inflation          -0.023745   0.037040 -0.6411 0.5221682    
## pop_growth         -1.084759   0.350717 -3.0930 0.0022509 ** 
## urban_growth        1.370221   0.406083  3.3742 0.0008815 ***
## emerging          -21.428510   4.766258 -4.4959 1.145e-05 ***
## mean_innovation     0.341966   0.134285  2.5466 0.0115953 *  
## mean_inflation     -0.450004   0.097200 -4.6297 6.412e-06 ***
## mean_pop_growth    -9.636802   2.385809 -4.0392 7.520e-05 ***
## mean_urban_growth  11.579174   2.870189  4.0343 7.668e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

================================

CRE Results Table

================================

library(modelsummary)

modelsummary(
  list(
    "Prosperity" = cre_prosperity,
    "People" = cre_people,
    "Planet" = cre_planet,
    "Partnership" = cre_partnership,
    "Peace" = cre_peace
  ),
  stars = TRUE,
  output = "markdown"
)
Prosperity People Planet Partnership Peace
(Intercept) 3.681+ 65.413* -3.966 -57.040 47.282***
(1.891) (25.307) (6.405) (52.029) (10.506)
innovation -0.003 0.104*** -0.014** 0.043 0.028
(0.020) (0.030) (0.004) (0.040) (0.018)
inflation 0.039 0.061 -0.006 0.241*** -0.024
(0.030) (0.045) (0.007) (0.061) (0.027)
pop_growth -1.327* 1.799* 0.096 0.620 -1.085*
(0.515) (0.778) (0.114) (1.045) (0.466)
urban_growth 0.269 -1.039 -0.157 -0.173 1.370***
(0.452) (0.683) (0.100) (0.916) (0.409)
emerging -0.842 -17.252 -3.706 7.114 -21.429***
(0.829) (11.098) (2.809) (22.816) (4.607)
mean_innovation -0.031 0.349 0.146* 1.336* 0.342**
(0.029) (0.287) (0.072) (0.587) (0.120)
mean_inflation -0.011 0.271 -0.104 -1.567 -0.450+
(0.052) (0.578) (0.146) (1.186) (0.241)
mean_pop_growth -0.450 -7.069 5.138 -53.641* -9.637+
(1.073) (12.622) (3.191) (25.921) (5.251)
mean_urban_growth 1.669+ 13.236 -0.514 53.908* 11.579*
(0.949) (11.182) (2.827) (22.965) (4.652)
Num.Obs. 220 220 220 220 220
R2 0.149 0.149 0.152 0.135 0.382
R2 Adj. 0.113 0.113 0.116 0.097 0.355
AIC 1102.5 1284.3 440.6 1413.9 1058.7
BIC 1139.8 1321.6 478.0 1451.2 1096.0
RMSE 2.82 4.26 0.63 5.72 2.55
  • p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001

================================

Fourth Method: Dynamic Panel Model: System GMM

================================

library(plm)
library(lmtest)
library(sandwich)
library(modelsummary)

—————-

Prosperity

—————-

gmm_prosperity <- pgmm(
  prosperity ~ lag(prosperity, 1) + innovation + inflation + pop_growth + urban_growth |
    lag(prosperity, 2:3) + lag(innovation, 2:3),
  data = pdata,
  effect = "individual",
  model = "twosteps",
  transformation = "ld"
)
## Warning in pgmm(prosperity ~ lag(prosperity, 1) + innovation + inflation + :
## the second-step matrix is singular, a general inverse is used
summary(gmm_prosperity, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = prosperity ~ lag(prosperity, 1) + innovation + 
##     inflation + pop_growth + urban_growth | lag(prosperity, 2:3) + 
##     lag(innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -11.15288  -1.59401  -0.13528  -0.09092   1.12632  17.26963 
## 
## Coefficients:
##                      Estimate Std. Error z-value  Pr(>|z|)    
## lag(prosperity, 1) -0.0829879  0.0801417 -1.0355   0.30043    
## innovation          0.0147178  0.0076776  1.9170   0.05524 .  
## inflation           0.0770571  0.0196368  3.9241 8.704e-05 ***
## pop_growth         -3.6072096  3.0113426 -1.1979   0.23097    
## urban_growth        2.8367006  2.4939336  1.1374   0.25535    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 19.51368 (p-value = 0.99999)
## Autocorrelation test (1): normal = -4.172157 (p-value = 3.0173e-05)
## Autocorrelation test (2): normal = -1.635858 (p-value = 0.10187)
## Wald test for coefficients: chisq(5) = 60.38876 (p-value = 1.0102e-11)

—————-

People

—————-

gmm_people <- pgmm(
  people ~ lag(people, 1) + innovation + inflation + pop_growth + urban_growth |
    lag(people, 2:3) + lag(innovation, 2:3),
  data = pdata,
  effect = "individual",
  model = "twosteps",
  transformation = "ld"
)
## Warning in pgmm(people ~ lag(people, 1) + innovation + inflation + pop_growth +
## : the second-step matrix is singular, a general inverse is used
summary(gmm_people, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = people ~ lag(people, 1) + innovation + inflation + 
##     pop_growth + urban_growth | lag(people, 2:3) + lag(innovation, 
##     2:3), data = pdata, effect = "individual", model = "twosteps", 
##     transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -23.8215  -1.1966  -0.1629  -0.1806   0.6846  25.7498 
## 
## Coefficients:
##                  Estimate Std. Error z-value Pr(>|z|)    
## lag(people, 1)  1.0145243  0.0156575 64.7947   <2e-16 ***
## innovation     -0.0156447  0.0203505 -0.7688   0.4420    
## inflation       0.0034494  0.0284166  0.1214   0.9034    
## pop_growth     -0.9494732  1.8210850 -0.5214   0.6021    
## urban_growth    0.9081725  1.5484466  0.5865   0.5575    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 14.85826 (p-value = 1)
## Autocorrelation test (1): normal = -1.975582 (p-value = 0.048202)
## Autocorrelation test (2): normal = 1.318212 (p-value = 0.18743)
## Wald test for coefficients: chisq(5) = 204485.6 (p-value = < 2.22e-16)

—————-

Planet

—————-

gmm_planet <- pgmm(
  planet ~ lag(planet, 1) + innovation + inflation + pop_growth + urban_growth |
    lag(planet, 2:3) + lag(innovation, 2:3),
  data = pdata,
  effect = "individual",
  model = "twosteps",
  transformation = "ld"
)
## Warning in pgmm(planet ~ lag(planet, 1) + innovation + inflation + pop_growth +
## : the second-step matrix is singular, a general inverse is used
summary(gmm_planet, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = planet ~ lag(planet, 1) + innovation + inflation + 
##     pop_growth + urban_growth | lag(planet, 2:3) + lag(innovation, 
##     2:3), data = pdata, effect = "individual", model = "twosteps", 
##     transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -1.480720 -0.188976 -0.011857 -0.004745  0.160136  2.350122 
## 
## Coefficients:
##                  Estimate Std. Error z-value Pr(>|z|)    
## lag(planet, 1)  0.9791390  0.0205394 47.6712   <2e-16 ***
## innovation      0.0006583  0.0031539  0.2087   0.8347    
## inflation       0.0020438  0.0050565  0.4042   0.6861    
## pop_growth     -0.1301399  0.2262853 -0.5751   0.5652    
## urban_growth    0.0948248  0.2350431  0.4034   0.6866    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 18.66998 (p-value = 1)
## Autocorrelation test (1): normal = -2.9581 (p-value = 0.0030954)
## Autocorrelation test (2): normal = -1.612135 (p-value = 0.10693)
## Wald test for coefficients: chisq(5) = 59770.6 (p-value = < 2.22e-16)

—————-

Partnership

—————-

gmm_partnership <- pgmm(
  partnership ~ lag(partnership, 1) + innovation + inflation + pop_growth + urban_growth |
    lag(partnership, 2:3) + lag(innovation, 2:3),
  data = pdata,
  effect = "individual",
  model = "twosteps",
  transformation = "ld"
)
## Warning in pgmm(partnership ~ lag(partnership, 1) + innovation + inflation + :
## the second-step matrix is singular, a general inverse is used
summary(gmm_partnership, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = partnership ~ lag(partnership, 1) + innovation + 
##     inflation + pop_growth + urban_growth | lag(partnership, 
##     2:3) + lag(innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -39.45528  -3.55603  -0.05144   0.07740   3.88720  23.67903 
## 
## Coefficients:
##                      Estimate Std. Error z-value Pr(>|z|)    
## lag(partnership, 1)  0.967443   0.090516 10.6881   <2e-16 ***
## innovation           0.031618   0.069987  0.4518   0.6514    
## inflation            0.056249   0.080540  0.6984   0.4849    
## pop_growth          -1.325611   1.780903 -0.7443   0.4567    
## urban_growth         0.434590   1.640797  0.2649   0.7911    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 18.96842 (p-value = 1)
## Autocorrelation test (1): normal = -2.657468 (p-value = 0.007873)
## Autocorrelation test (2): normal = -3.19606 (p-value = 0.0013932)
## Wald test for coefficients: chisq(5) = 4999.666 (p-value = < 2.22e-16)

—————-

Peace

—————-

gmm_peace <- pgmm(
  peace ~ lag(peace, 1) + innovation + inflation + pop_growth + urban_growth |
    lag(peace, 2:3) + lag(innovation, 2:3),
  data = pdata,
  effect = "individual",
  model = "twosteps",
  transformation = "ld"
)
## Warning in pgmm(peace ~ lag(peace, 1) + innovation + inflation + pop_growth + :
## the second-step matrix is singular, a general inverse is used
summary(gmm_peace, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = peace ~ lag(peace, 1) + innovation + inflation + 
##     pop_growth + urban_growth | lag(peace, 2:3) + lag(innovation, 
##     2:3), data = pdata, effect = "individual", model = "twosteps", 
##     transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -8.38213 -1.32595  0.03738  0.07950  1.45928 10.93956 
## 
## Coefficients:
##                 Estimate Std. Error z-value Pr(>|z|)    
## lag(peace, 1)  0.9991631  0.0354451 28.1890   <2e-16 ***
## innovation     0.0027963  0.0263189  0.1062   0.9154    
## inflation     -0.0052132  0.0197662 -0.2637   0.7920    
## pop_growth     0.5017130  1.3702688  0.3661   0.7143    
## urban_growth  -0.6384434  1.2448329 -0.5129   0.6080    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 17.77763 (p-value = 1)
## Autocorrelation test (1): normal = -3.042204 (p-value = 0.0023485)
## Autocorrelation test (2): normal = 1.104659 (p-value = 0.26931)
## Wald test for coefficients: chisq(5) = 39995.75 (p-value = < 2.22e-16)

================================

GMM Results Table

================================

modelsummary(
  list(
    "Prosperity" = gmm_prosperity,
    "People" = gmm_people,
    "Planet" = gmm_planet,
    "Partnership" = gmm_partnership,
    "Peace" = gmm_peace
  ),
  stars = TRUE,
  output = "markdown"
)
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
Prosperity People Planet Partnership Peace
lag(prosperity, 1) -0.083**
(0.029)
innovation 0.015*** -0.016 0.001 0.032 0.003
(0.004) (0.013) (0.002) (0.039) (0.015)
inflation 0.077*** 0.003 0.002 0.056 -0.005
(0.008) (0.017) (0.002) (0.039) (0.012)
pop_growth -3.607* -0.949 -0.130 -1.326 0.502
(1.798) (1.169) (0.118) (0.948) (1.111)
urban_growth 2.837+ 0.908 0.095 0.435 -0.638
(1.479) (1.010) (0.127) (0.870) (1.026)
lag(people, 1) 1.015***
(0.008)
lag(planet, 1) 0.979***
(0.011)
lag(partnership, 1) 0.967***
(0.052)
lag(peace, 1) 0.999***
(0.022)
  • p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001
summary(gmm_prosperity, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = prosperity ~ lag(prosperity, 1) + innovation + 
##     inflation + pop_growth + urban_growth | lag(prosperity, 2:3) + 
##     lag(innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -11.15288  -1.59401  -0.13528  -0.09092   1.12632  17.26963 
## 
## Coefficients:
##                      Estimate Std. Error z-value  Pr(>|z|)    
## lag(prosperity, 1) -0.0829879  0.0801417 -1.0355   0.30043    
## innovation          0.0147178  0.0076776  1.9170   0.05524 .  
## inflation           0.0770571  0.0196368  3.9241 8.704e-05 ***
## pop_growth         -3.6072096  3.0113426 -1.1979   0.23097    
## urban_growth        2.8367006  2.4939336  1.1374   0.25535    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 19.51368 (p-value = 0.99999)
## Autocorrelation test (1): normal = -4.172157 (p-value = 3.0173e-05)
## Autocorrelation test (2): normal = -1.635858 (p-value = 0.10187)
## Wald test for coefficients: chisq(5) = 60.38876 (p-value = 1.0102e-11)

============================================================

LOG TRANSFORMATION ROBUSTNESS CHECK

============================================================

1) Check if variables can be logged

summary(pdata$innovation)
## total sum of squares: 82821.48 
##        id      time 
## 0.7186724 0.1717624 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   13.50   69.68   84.80   77.98   92.34  100.00
summary(pdata$prosperity)
## total sum of squares: 2192.438 
##        id      time 
## 0.1794283 0.5293148 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -9.1029  0.5272  1.6561  1.5219  2.9813 10.8246
summary(pdata$people)
## total sum of squares: 64044.34 
##          id        time 
## 0.934453321 0.003429251 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   73.25   98.35  102.63  104.06  106.82  159.11
summary(pdata$planet)
## total sum of squares: 5749.602 
##          id        time 
## 0.985052098 0.006406287 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.680   3.875   6.238   7.784  10.362  20.697
summary(pdata$partnership)
## total sum of squares: 234381.3 
##         id       time 
## 0.96792673 0.01353995 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   23.40   42.23   59.31   65.34   75.97  184.11
summary(pdata$peace)
## total sum of squares: 50923.83 
##           id         time 
## 0.9713476533 0.0008343312 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   38.82   54.98   68.34   69.16   84.31   91.94
summary(pdata$inflation)
## total sum of squares: 21351.6 
##         id       time 
## 0.43849531 0.07306699 
## 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -15.827   1.499   3.071   5.147   6.010  95.526
# Count zero or negative values
sapply(
  pdata[, c("innovation", "prosperity", "people", "planet", "partnership", "peace")],
  function(x) sum(x <= 0, na.rm = TRUE)
)
##  innovation  prosperity      people      planet partnership       peace 
##           0          48           0           0           0           0
# Inflation check for log(1 + inflation)
sum(1 + pdata$inflation <= 0, na.rm = TRUE)
## [1] 7

============================================================

2) Create log variables

============================================================

# Variables with positive values only
pdata$ln_innovation  <- log(pdata$innovation)

pdata$ln_people      <- log(pdata$people)
pdata$ln_planet      <- log(pdata$planet)
pdata$ln_partnership <- log(pdata$partnership)
pdata$ln_peace       <- log(pdata$peace)

# Prosperity cannot be fully logged
# because it contains zero/negative values

# Inflation cannot be fully logged
# because some observations <= -1

============================================================

3) LOG ROBUSTNESS: MODELS

============================================================

—————————-

1) FE / RE

—————————-

library(plm)
library(sandwich)
library(lmtest)

fe_log_prosperity <- plm(prosperity ~ ln_innovation + inflation + pop_growth + urban_growth,
                         data = pdata, model = "within")
re_log_prosperity <- plm(prosperity ~ ln_innovation + inflation + pop_growth + urban_growth,
                         data = pdata, model = "random")

fe_log_people <- plm(ln_people ~ ln_innovation + inflation + pop_growth + urban_growth,
                     data = pdata, model = "within")
re_log_people <- plm(ln_people ~ ln_innovation + inflation + pop_growth + urban_growth,
                     data = pdata, model = "random")

fe_log_planet <- plm(ln_planet ~ ln_innovation + inflation + pop_growth + urban_growth,
                     data = pdata, model = "within")
re_log_planet <- plm(ln_planet ~ ln_innovation + inflation + pop_growth + urban_growth,
                     data = pdata, model = "random")

fe_log_partnership <- plm(ln_partnership ~ ln_innovation + inflation + pop_growth + urban_growth,
                          data = pdata, model = "within")
re_log_partnership <- plm(ln_partnership ~ ln_innovation + inflation + pop_growth + urban_growth,
                          data = pdata, model = "random")

fe_log_peace <- plm(ln_peace ~ ln_innovation + inflation + pop_growth + urban_growth,
                    data = pdata, model = "within")
re_log_peace <- plm(ln_peace ~ ln_innovation + inflation + pop_growth + urban_growth,
                    data = pdata, model = "random")

# Hausman
phtest(fe_log_prosperity, re_log_prosperity)
## 
##  Hausman Test
## 
## data:  prosperity ~ ln_innovation + inflation + pop_growth + urban_growth
## chisq = 8.491, df = 4, p-value = 0.07516
## alternative hypothesis: one model is inconsistent
phtest(fe_log_people, re_log_people)
## 
##  Hausman Test
## 
## data:  ln_people ~ ln_innovation + inflation + pop_growth + urban_growth
## chisq = 8.1942, df = 4, p-value = 0.08472
## alternative hypothesis: one model is inconsistent
phtest(fe_log_planet, re_log_planet)
## 
##  Hausman Test
## 
## data:  ln_planet ~ ln_innovation + inflation + pop_growth + urban_growth
## chisq = 1.6426, df = 4, p-value = 0.8011
## alternative hypothesis: one model is inconsistent
phtest(fe_log_partnership, re_log_partnership)
## 
##  Hausman Test
## 
## data:  ln_partnership ~ ln_innovation + inflation + pop_growth + urban_growth
## chisq = 3.0438, df = 4, p-value = 0.5505
## alternative hypothesis: one model is inconsistent
phtest(fe_log_peace, re_log_peace)
## 
##  Hausman Test
## 
## data:  ln_peace ~ ln_innovation + inflation + pop_growth + urban_growth
## chisq = 4.9474, df = 4, p-value = 0.2927
## alternative hypothesis: one model is inconsistent
# Robust FE results
coeftest(fe_log_prosperity, vcov = vcovHC(fe_log_prosperity, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                Estimate Std. Error t value  Pr(>|t|)    
## ln_innovation -0.527050   0.396250 -1.3301    0.1850    
## inflation      0.039953   0.031243  1.2788    0.2025    
## pop_growth    -1.320302   0.176886 -7.4641 2.677e-12 ***
## urban_growth   0.249123   0.241614  1.0311    0.3038    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_log_people, vcov = vcovHC(fe_log_people, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                  Estimate  Std. Error t value  Pr(>|t|)    
## ln_innovation  0.06813126  0.02011352  3.3873 0.0008529 ***
## inflation      0.00063750  0.00039718  1.6051 0.1100910    
## pop_growth     0.01392411  0.00667057  2.0874 0.0381452 *  
## urban_growth  -0.00721260  0.00546656 -1.3194 0.1885739    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_log_planet, vcov = vcovHC(fe_log_planet, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                  Estimate  Std. Error t value Pr(>|t|)  
## ln_innovation  0.03975478  0.06891342  0.5769  0.56468  
## inflation     -0.00060774  0.00079345 -0.7659  0.44463  
## pop_growth     0.01888996  0.01186146  1.5925  0.11287  
## urban_growth  -0.01626549  0.00839023 -1.9386  0.05398 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_log_partnership, vcov = vcovHC(fe_log_partnership, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                 Estimate Std. Error t value Pr(>|t|)   
## ln_innovation  0.0267037  0.0410286  0.6509 0.515901   
## inflation      0.0041367  0.0014168  2.9198 0.003912 **
## pop_growth     0.0106053  0.0115010  0.9221 0.357597   
## urban_growth  -0.0035579  0.0102969 -0.3455 0.730065   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(fe_log_peace, vcov = vcovHC(fe_log_peace, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                  Estimate  Std. Error t value  Pr(>|t|)    
## ln_innovation  0.03207279  0.02958084  1.0842 0.2795895    
## inflation     -0.00037929  0.00074595 -0.5085 0.6116993    
## pop_growth    -0.02020440  0.00647754 -3.1191 0.0020872 ** 
## urban_growth   0.02480187  0.00721182  3.4391 0.0007131 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

—————————-

2) TWFE

—————————-

twfe_log_prosperity <- plm(prosperity ~ ln_innovation + inflation + pop_growth + urban_growth,
                           data = pdata, model = "within", effect = "twoways")

twfe_log_people <- plm(ln_people ~ ln_innovation + inflation + pop_growth + urban_growth,
                       data = pdata, model = "within", effect = "twoways")

twfe_log_planet <- plm(ln_planet ~ ln_innovation + inflation + pop_growth + urban_growth,
                       data = pdata, model = "within", effect = "twoways")

twfe_log_partnership <- plm(ln_partnership ~ ln_innovation + inflation + pop_growth + urban_growth,
                            data = pdata, model = "within", effect = "twoways")

twfe_log_peace <- plm(ln_peace ~ ln_innovation + inflation + pop_growth + urban_growth,
                      data = pdata, model = "within", effect = "twoways")

coeftest(twfe_log_prosperity, vcov = vcovHC(twfe_log_prosperity, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                Estimate Std. Error t value  Pr(>|t|)    
## ln_innovation -0.140083   0.519761 -0.2695   0.78783    
## inflation     -0.014613   0.014002 -1.0436   0.29800    
## pop_growth    -0.683021   0.090155 -7.5761 1.624e-12 ***
## urban_growth  -0.152901   0.092257 -1.6573   0.09914 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(twfe_log_people, vcov = vcovHC(twfe_log_people, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                  Estimate  Std. Error t value Pr(>|t|)  
## ln_innovation  0.07387084  0.03345150  2.2083  0.02845 *
## inflation      0.00061866  0.00032645  1.8951  0.05963 .
## pop_growth     0.01432944  0.00629870  2.2750  0.02405 *
## urban_growth  -0.00723348  0.00538493 -1.3433  0.18082  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(twfe_log_planet, vcov = vcovHC(twfe_log_planet, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                  Estimate  Std. Error t value  Pr(>|t|)    
## ln_innovation  0.28542505  0.05262109  5.4242 1.796e-07 ***
## inflation      0.00092403  0.00052707  1.7532 0.0812224 .  
## pop_growth     0.02814155  0.00769788  3.6558 0.0003336 ***
## urban_growth  -0.01955922  0.00744323 -2.6278 0.0093118 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(twfe_log_partnership, vcov = vcovHC(twfe_log_partnership, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                 Estimate Std. Error t value Pr(>|t|)  
## ln_innovation -0.0690411  0.0377570 -1.8286  0.06907 .
## inflation      0.0013337  0.0012800  1.0420  0.29875  
## pop_growth     0.0190530  0.0109598  1.7385  0.08379 .
## urban_growth  -0.0211835  0.0107607 -1.9686  0.05049 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(twfe_log_peace, vcov = vcovHC(twfe_log_peace, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                  Estimate  Std. Error t value  Pr(>|t|)    
## ln_innovation  0.03772158  0.02616842  1.4415 0.1511272    
## inflation     -0.00023241  0.00080253 -0.2896 0.7724469    
## pop_growth    -0.01991018  0.00671105 -2.9668 0.0034046 ** 
## urban_growth   0.02588856  0.00731344  3.5399 0.0005058 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

—————————-

3) CRE / Mundlak

—————————-

pdata$mean_ln_innovation <- ave(pdata$ln_innovation, pdata$country)
pdata$mean_inflation <- ave(pdata$inflation, pdata$country)
pdata$mean_pop_growth <- ave(pdata$pop_growth, pdata$country)
pdata$mean_urban_growth <- ave(pdata$urban_growth, pdata$country)

cre_log_prosperity <- plm(
  prosperity ~ ln_innovation + inflation + pop_growth + urban_growth +
    emerging + mean_ln_innovation + mean_inflation + mean_pop_growth + mean_urban_growth,
  data = pdata, model = "random"
)

cre_log_people <- plm(
  ln_people ~ ln_innovation + inflation + pop_growth + urban_growth +
    emerging + mean_ln_innovation + mean_inflation + mean_pop_growth + mean_urban_growth,
  data = pdata, model = "random"
)

cre_log_planet <- plm(
  ln_planet ~ ln_innovation + inflation + pop_growth + urban_growth +
    emerging + mean_ln_innovation + mean_inflation + mean_pop_growth + mean_urban_growth,
  data = pdata, model = "random"
)

cre_log_partnership <- plm(
  ln_partnership ~ ln_innovation + inflation + pop_growth + urban_growth +
    emerging + mean_ln_innovation + mean_inflation + mean_pop_growth + mean_urban_growth,
  data = pdata, model = "random"
)

cre_log_peace <- plm(
  ln_peace ~ ln_innovation + inflation + pop_growth + urban_growth +
    emerging + mean_ln_innovation + mean_inflation + mean_pop_growth + mean_urban_growth,
  data = pdata, model = "random"
)

coeftest(cre_log_prosperity, vcov = vcovHC(cre_log_prosperity, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                       Estimate  Std. Error t value Pr(>|t|)    
## (Intercept)        11.31278352  4.25487482  2.6588 0.008447 ** 
## ln_innovation      -0.52704978  0.40187132 -1.3115 0.191125    
## inflation           0.03995297  0.03168645  1.2609 0.208749    
## pop_growth         -1.32030239  0.17939525 -7.3597  4.1e-12 ***
## urban_growth        0.24912333  0.24504168  1.0167 0.310487    
## emerging           -0.88004020  0.62613225 -1.4055 0.161345    
## mean_ln_innovation -1.84320311  1.03970320 -1.7728 0.077709 .  
## mean_inflation      0.00063311  0.04923179  0.0129 0.989752    
## mean_pop_growth    -0.14573248  0.69025177 -0.2111 0.832991    
## mean_urban_growth   1.35825358  0.68863364  1.9724 0.049878 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_log_people, vcov = vcovHC(cre_log_people, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                       Estimate  Std. Error t value  Pr(>|t|)    
## (Intercept)         3.37375047  0.62286052  5.4165 1.656e-07 ***
## ln_innovation       0.06813126  0.02039883  3.3400 0.0009915 ***
## inflation           0.00063750  0.00040282  1.5826 0.1150156    
## pop_growth          0.01392411  0.00676519  2.0582 0.0408056 *  
## urban_growth       -0.00721260  0.00554411 -1.3009 0.1947019    
## emerging           -0.14956171  0.10478317 -1.4273 0.1549658    
## mean_ln_innovation  0.21767648  0.13467825  1.6163 0.1075371    
## mean_inflation      0.00142285  0.00477218  0.2982 0.7658799    
## mean_pop_growth    -0.09858988  0.10975311 -0.8983 0.3700609    
## mean_urban_growth   0.14396785  0.09686317  1.4863 0.1386992    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_log_planet, vcov = vcovHC(cre_log_planet, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                       Estimate  Std. Error t value  Pr(>|t|)    
## (Intercept)        -4.07340198  1.63829838 -2.4864 0.0136853 *  
## ln_innovation       0.03975478  0.06989096  0.5688 0.5700919    
## inflation          -0.00060774  0.00080471 -0.7552 0.4509576    
## pop_growth          0.01888996  0.01202972  1.5703 0.1178568    
## urban_growth       -0.01626549  0.00850925 -1.9115 0.0573009 .  
## emerging           -0.49842122  0.27031617 -1.8438 0.0666146 .  
## mean_ln_innovation  1.30589298  0.38476231  3.3940 0.0008233 ***
## mean_inflation     -0.01283246  0.01634364 -0.7852 0.4332413    
## mean_pop_growth     0.41075778  0.38419929  1.0691 0.2862399    
## mean_urban_growth   0.04118362  0.33246188  0.1239 0.9015330    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_log_partnership, vcov = vcovHC(cre_log_partnership, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                      Estimate Std. Error t value Pr(>|t|)   
## (Intercept)        -0.6451553  1.3547695 -0.4762 0.634420   
## ln_innovation       0.0267037  0.0416105  0.6418 0.521733   
## inflation           0.0041367  0.0014369  2.8790 0.004402 **
## pop_growth          0.0106053  0.0116641  0.9092 0.364273   
## urban_growth       -0.0035579  0.0104430 -0.3407 0.733671   
## emerging            0.0355092  0.2661597  0.1334 0.893994   
## mean_ln_innovation  1.0194184  0.3131005  3.2559 0.001318 **
## mean_inflation     -0.0247400  0.0099785 -2.4793 0.013950 * 
## mean_pop_growth    -0.7365029  0.3297110 -2.2338 0.026552 * 
## mean_urban_growth   0.7826150  0.3087091  2.5351 0.011969 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(cre_log_peace, vcov = vcovHC(cre_log_peace, type = "HC1", cluster = "group"))
## 
## t test of coefficients:
## 
##                       Estimate  Std. Error t value  Pr(>|t|)    
## (Intercept)         3.13564815  0.49768423  6.3005 1.715e-09 ***
## ln_innovation       0.03207279  0.03000045  1.0691 0.2862624    
## inflation          -0.00037929  0.00075653 -0.5014 0.6166479    
## pop_growth         -0.02020440  0.00656943 -3.0755 0.0023807 ** 
## urban_growth        0.02480187  0.00731412  3.3910 0.0008321 ***
## emerging           -0.34166405  0.07723026 -4.4240 1.555e-05 ***
## mean_ln_innovation  0.24280465  0.11111806  2.1851 0.0299875 *  
## mean_inflation     -0.00899794  0.00165890 -5.4240 1.597e-07 ***
## mean_pop_growth    -0.16143499  0.03458189 -4.6682 5.414e-06 ***
## mean_urban_growth   0.19877049  0.04528895  4.3889 1.803e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

—————————-

4) System GMM

—————————-

gmm_log_prosperity <- pgmm(
  prosperity ~ lag(prosperity, 1) + ln_innovation + inflation + pop_growth + urban_growth |
    lag(prosperity, 2:3) + lag(ln_innovation, 2:3),
  data = pdata, effect = "individual", model = "twosteps", transformation = "ld"
)
## Warning in pgmm(prosperity ~ lag(prosperity, 1) + ln_innovation + inflation + :
## the second-step matrix is singular, a general inverse is used
gmm_log_people <- pgmm(
  ln_people ~ lag(ln_people, 1) + ln_innovation + inflation + pop_growth + urban_growth |
    lag(ln_people, 2:3) + lag(ln_innovation, 2:3),
  data = pdata, effect = "individual", model = "twosteps", transformation = "ld"
)
## Warning in pgmm(ln_people ~ lag(ln_people, 1) + ln_innovation + inflation + :
## the second-step matrix is singular, a general inverse is used
gmm_log_planet <- pgmm(
  ln_planet ~ lag(ln_planet, 1) + ln_innovation + inflation + pop_growth + urban_growth |
    lag(ln_planet, 2:3) + lag(ln_innovation, 2:3),
  data = pdata, effect = "individual", model = "twosteps", transformation = "ld"
)
## Warning in pgmm(ln_planet ~ lag(ln_planet, 1) + ln_innovation + inflation + :
## the second-step matrix is singular, a general inverse is used
gmm_log_partnership <- pgmm(
  ln_partnership ~ lag(ln_partnership, 1) + ln_innovation + inflation + pop_growth + urban_growth |
    lag(ln_partnership, 2:3) + lag(ln_innovation, 2:3),
  data = pdata, effect = "individual", model = "twosteps", transformation = "ld"
)
## Warning in pgmm(ln_partnership ~ lag(ln_partnership, 1) + ln_innovation + : the
## second-step matrix is singular, a general inverse is used
gmm_log_peace <- pgmm(
  ln_peace ~ lag(ln_peace, 1) + ln_innovation + inflation + pop_growth + urban_growth |
    lag(ln_peace, 2:3) + lag(ln_innovation, 2:3),
  data = pdata, effect = "individual", model = "twosteps", transformation = "ld"
)
## Warning in pgmm(ln_peace ~ lag(ln_peace, 1) + ln_innovation + inflation + : the
## second-step matrix is singular, a general inverse is used
summary(gmm_log_prosperity, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = prosperity ~ lag(prosperity, 1) + ln_innovation + 
##     inflation + pop_growth + urban_growth | lag(prosperity, 2:3) + 
##     lag(ln_innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -11.09523  -1.50334  -0.14556  -0.06449   1.27169  17.30328 
## 
## Coefficients:
##                     Estimate Std. Error z-value  Pr(>|z|)    
## lag(prosperity, 1) -0.077686   0.079788 -0.9737   0.33023    
## ln_innovation       0.311773   0.142174  2.1929   0.02831 *  
## inflation           0.071123   0.015342  4.6358 3.556e-06 ***
## pop_growth         -2.703746   1.145241 -2.3609   0.01823 *  
## urban_growth        1.988795   1.052160  1.8902   0.05873 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 19.46524 (p-value = 0.99999)
## Autocorrelation test (1): normal = -3.634756 (p-value = 0.00027824)
## Autocorrelation test (2): normal = -1.586719 (p-value = 0.11258)
## Wald test for coefficients: chisq(5) = 78.5302 (p-value = 1.7031e-15)
summary(gmm_log_people, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = ln_people ~ lag(ln_people, 1) + ln_innovation + 
##     inflation + pop_growth + urban_growth | lag(ln_people, 2:3) + 
##     lag(ln_innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##       Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
## -0.2040621 -0.0096939  0.0016394  0.0007794  0.0108544  0.1798164 
## 
## Coefficients:
##                      Estimate  Std. Error z-value Pr(>|z|)    
## lag(ln_people, 1)  1.01645231  0.01066042 95.3482   <2e-16 ***
## ln_innovation     -0.01889862  0.01183297 -1.5971   0.1102    
## inflation          0.00038869  0.00033917  1.1460   0.2518    
## pop_growth        -0.00059319  0.00558971 -0.1061   0.9155    
## urban_growth       0.00421032  0.00572256  0.7357   0.4619    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 17.66239 (p-value = 1)
## Autocorrelation test (1): normal = -2.192009 (p-value = 0.028379)
## Autocorrelation test (2): normal = 1.188304 (p-value = 0.23471)
## Wald test for coefficients: chisq(5) = 4823052 (p-value = < 2.22e-16)
summary(gmm_log_planet, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = ln_planet ~ lag(ln_planet, 1) + ln_innovation + 
##     inflation + pop_growth + urban_growth | lag(ln_planet, 2:3) + 
##     lag(ln_innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##       Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
## -0.1755267 -0.0312581 -0.0019850 -0.0008448  0.0291071  0.2317285 
## 
## Coefficients:
##                     Estimate Std. Error z-value Pr(>|z|)    
## lag(ln_planet, 1)  0.9903802  0.0218261 45.3759   <2e-16 ***
## ln_innovation      0.0014704  0.0104878  0.1402   0.8885    
## inflation          0.0001472  0.0004273  0.3445   0.7305    
## pop_growth        -0.0162505  0.0140591 -1.1559   0.2477    
## urban_growth       0.0144163  0.0137817  1.0460   0.2955    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 19.64818 (p-value = 0.99999)
## Autocorrelation test (1): normal = -3.299177 (p-value = 0.00096969)
## Autocorrelation test (2): normal = -1.312738 (p-value = 0.18927)
## Wald test for coefficients: chisq(5) = 295465.2 (p-value = < 2.22e-16)
summary(gmm_log_partnership, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = ln_partnership ~ lag(ln_partnership, 1) + ln_innovation + 
##     inflation + pop_growth + urban_growth | lag(ln_partnership, 
##     2:3) + lag(ln_innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##       Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
## -0.3474205 -0.0636935  0.0005158  0.0000326  0.0700580  0.4395825 
## 
## Coefficients:
##                          Estimate Std. Error z-value Pr(>|z|)    
## lag(ln_partnership, 1)  0.9088137  0.0516818 17.5848  < 2e-16 ***
## ln_innovation           0.0839340  0.0483603  1.7356  0.08263 .  
## inflation               0.0012224  0.0012823  0.9533  0.34044    
## pop_growth             -0.0442075  0.0293730 -1.5050  0.13231    
## urban_growth            0.0363622  0.0287888  1.2631  0.20656    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 19.23477 (p-value = 0.99999)
## Autocorrelation test (1): normal = -3.211723 (p-value = 0.0013194)
## Autocorrelation test (2): normal = -3.611547 (p-value = 0.00030438)
## Wald test for coefficients: chisq(5) = 235131.5 (p-value = < 2.22e-16)
summary(gmm_log_peace, robust = TRUE)
## Warning in vcovHC.pgmm(object): a general inverse is used
## Oneway (individual) effect Two-steps model System GMM 
## 
## Call:
## pgmm(formula = ln_peace ~ lag(ln_peace, 1) + ln_innovation + 
##     inflation + pop_growth + urban_growth | lag(ln_peace, 2:3) + 
##     lag(ln_innovation, 2:3), data = pdata, effect = "individual", 
##     model = "twosteps", transformation = "ld")
## 
## Balanced Panel: n = 20, T = 11, N = 220
## 
## Number of Observations Used: 380
## Residuals:
##       Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
## -0.1687445 -0.0212628 -0.0018075 -0.0002363  0.0195163  0.2080830 
## 
## Coefficients:
##                     Estimate  Std. Error z-value Pr(>|z|)    
## lag(ln_peace, 1)  1.00701453  0.02066479 48.7309   <2e-16 ***
## ln_innovation    -0.00560856  0.01956729 -0.2866   0.7744    
## inflation        -0.00019038  0.00019330 -0.9849   0.3247    
## pop_growth        0.00824978  0.00654220  1.2610   0.2073    
## urban_growth     -0.00940146  0.00704925 -1.3337   0.1823    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Sargan test: chisq(53) = 18.31517 (p-value = 1)
## Autocorrelation test (1): normal = -2.818569 (p-value = 0.0048238)
## Autocorrelation test (2): normal = 1.142425 (p-value = 0.25328)
## Wald test for coefficients: chisq(5) = 3100304 (p-value = < 2.22e-16)

=========================

GMM Diagnostic Tests

=========================

# ==============================
# GMM Diagnostic Tests
# ==============================

library(plm)

# --------------------------------
# Prosperity
# --------------------------------

cat("\n========================")
## 
## ========================
cat("\nProsperity - GMM Results")
## 
## Prosperity - GMM Results
cat("\n========================\n")
## 
## ========================
summary(gmm_log_prosperity, robust = TRUE)$coefficients
## Warning in vcovHC.pgmm(object): a general inverse is used
##                      Estimate Std. Error   z-value     Pr(>|z|)
## lag(prosperity, 1) -0.0776859 0.07978751 -0.973660 3.302254e-01
## ln_innovation       0.3117729 0.14217382  2.192899 2.831463e-02
## inflation           0.0711228 0.01534220  4.635763 3.556233e-06
## pop_growth         -2.7037457 1.14524108 -2.360853 1.823296e-02
## urban_growth        1.9887947 1.05215957  1.890203 5.873088e-02
cat("\n--- Sargan Test ---\n")
## 
## --- Sargan Test ---
sargan(gmm_log_prosperity)
## 
##  Sargan test
## 
## data:  prosperity ~ lag(prosperity, 1) + ln_innovation + inflation +  ...
## chisq = 19.465, df = 53, p-value = 1
## alternative hypothesis: overidentifying restrictions not valid
cat("\n--- AR(1) Test ---\n")
## 
## --- AR(1) Test ---
mtest(gmm_log_prosperity, order = 1)
## 
##  Arellano-Bond autocorrelation test of degree 1
## 
## data:  prosperity ~ lag(prosperity, 1) + ln_innovation + inflation +  ...
## normal = -4.587, p-value = 4.497e-06
## alternative hypothesis: autocorrelation present
cat("\n--- AR(2) Test ---\n")
## 
## --- AR(2) Test ---
mtest(gmm_log_prosperity, order = 2)
## 
##  Arellano-Bond autocorrelation test of degree 2
## 
## data:  prosperity ~ lag(prosperity, 1) + ln_innovation + inflation +  ...
## normal = -1.7365, p-value = 0.08247
## alternative hypothesis: autocorrelation present
# --------------------------------
# People
# --------------------------------

cat("\n====================")
## 
## ====================
cat("\nPeople - GMM Results")
## 
## People - GMM Results
cat("\n====================\n")
## 
## ====================
summary(gmm_log_people, robust = TRUE)$coefficients
## Warning in vcovHC.pgmm(object): a general inverse is used
##                        Estimate   Std. Error    z-value  Pr(>|z|)
## lag(ln_people, 1)  1.0164523102 0.0106604213 95.3482308 0.0000000
## ln_innovation     -0.0188986154 0.0118329681 -1.5971154 0.1102400
## inflation          0.0003886905 0.0003391678  1.1460125 0.2517900
## pop_growth        -0.0005931891 0.0055897095 -0.1061216 0.9154859
## urban_growth       0.0042103242 0.0057225597  0.7357414 0.4618881
cat("\n--- Sargan Test ---\n")
## 
## --- Sargan Test ---
sargan(gmm_log_people)
## 
##  Sargan test
## 
## data:  ln_people ~ lag(ln_people, 1) + ln_innovation + inflation + pop_growth +  ...
## chisq = 17.662, df = 53, p-value = 1
## alternative hypothesis: overidentifying restrictions not valid
cat("\n--- AR(1) Test ---\n")
## 
## --- AR(1) Test ---
mtest(gmm_log_people, order = 1)
## 
##  Arellano-Bond autocorrelation test of degree 1
## 
## data:  ln_people ~ lag(ln_people, 1) + ln_innovation + inflation + pop_growth +  ...
## normal = -2.1927, p-value = 0.02833
## alternative hypothesis: autocorrelation present
cat("\n--- AR(2) Test ---\n")
## 
## --- AR(2) Test ---
mtest(gmm_log_people, order = 2)
## 
##  Arellano-Bond autocorrelation test of degree 2
## 
## data:  ln_people ~ lag(ln_people, 1) + ln_innovation + inflation + pop_growth +  ...
## normal = 1.1888, p-value = 0.2345
## alternative hypothesis: autocorrelation present
# --------------------------------
# Planet
# --------------------------------

cat("\n====================")
## 
## ====================
cat("\nPlanet - GMM Results")
## 
## Planet - GMM Results
cat("\n====================\n")
## 
## ====================
summary(gmm_log_planet, robust = TRUE)$coefficients
## Warning in vcovHC.pgmm(object): a general inverse is used
##                        Estimate   Std. Error    z-value  Pr(>|z|)
## lag(ln_planet, 1)  0.9903801546 0.0218261407 45.3758715 0.0000000
## ln_innovation      0.0014704119 0.0104878527  0.1402014 0.8885008
## inflation          0.0001472034 0.0004272979  0.3444983 0.7304715
## pop_growth        -0.0162504742 0.0140590477 -1.1558730 0.2477331
## urban_growth       0.0144162741 0.0137817112  1.0460438 0.2955408
cat("\n--- Sargan Test ---\n")
## 
## --- Sargan Test ---
sargan(gmm_log_planet)
## 
##  Sargan test
## 
## data:  ln_planet ~ lag(ln_planet, 1) + ln_innovation + inflation + pop_growth +  ...
## chisq = 19.648, df = 53, p-value = 1
## alternative hypothesis: overidentifying restrictions not valid
cat("\n--- AR(1) Test ---\n")
## 
## --- AR(1) Test ---
mtest(gmm_log_planet, order = 1)
## 
##  Arellano-Bond autocorrelation test of degree 1
## 
## data:  ln_planet ~ lag(ln_planet, 1) + ln_innovation + inflation + pop_growth +  ...
## normal = -3.313, p-value = 0.000923
## alternative hypothesis: autocorrelation present
cat("\n--- AR(2) Test ---\n")
## 
## --- AR(2) Test ---
mtest(gmm_log_planet, order = 2)
## 
##  Arellano-Bond autocorrelation test of degree 2
## 
## data:  ln_planet ~ lag(ln_planet, 1) + ln_innovation + inflation + pop_growth +  ...
## normal = -1.3129, p-value = 0.1892
## alternative hypothesis: autocorrelation present
# --------------------------------
# Partnership
# --------------------------------

cat("\n===========================")
## 
## ===========================
cat("\nPartnership - GMM Results")
## 
## Partnership - GMM Results
cat("\n===========================\n")
## 
## ===========================
summary(gmm_log_partnership, robust = TRUE)$coefficients
## Warning in vcovHC.pgmm(object): a general inverse is used
##                            Estimate  Std. Error    z-value     Pr(>|z|)
## lag(ln_partnership, 1)  0.908813671 0.051681829 17.5847814 3.222217e-69
## ln_innovation           0.083934008 0.048360284  1.7355979 8.263495e-02
## inflation               0.001222416 0.001282297  0.9533016 3.404373e-01
## pop_growth             -0.044207533 0.029373048 -1.5050373 1.323145e-01
## urban_growth            0.036362244 0.028788833  1.2630677 2.065649e-01
cat("\n--- Sargan Test ---\n")
## 
## --- Sargan Test ---
sargan(gmm_log_partnership)
## 
##  Sargan test
## 
## data:  ln_partnership ~ lag(ln_partnership, 1) + ln_innovation + inflation +  ...
## chisq = 19.235, df = 53, p-value = 1
## alternative hypothesis: overidentifying restrictions not valid
cat("\n--- AR(1) Test ---\n")
## 
## --- AR(1) Test ---
mtest(gmm_log_partnership, order = 1)
## 
##  Arellano-Bond autocorrelation test of degree 1
## 
## data:  ln_partnership ~ lag(ln_partnership, 1) + ln_innovation + inflation +  ...
## normal = -3.4432, p-value = 0.0005748
## alternative hypothesis: autocorrelation present
cat("\n--- AR(2) Test ---\n")
## 
## --- AR(2) Test ---
mtest(gmm_log_partnership, order = 2)
## 
##  Arellano-Bond autocorrelation test of degree 2
## 
## data:  ln_partnership ~ lag(ln_partnership, 1) + ln_innovation + inflation +  ...
## normal = -3.6274, p-value = 0.0002863
## alternative hypothesis: autocorrelation present
# --------------------------------
# Peace
# --------------------------------

cat("\n===================")
## 
## ===================
cat("\nPeace - GMM Results")
## 
## Peace - GMM Results
cat("\n===================\n")
## 
## ===================
summary(gmm_log_peace, robust = TRUE)$coefficients
## Warning in vcovHC.pgmm(object): a general inverse is used
##                       Estimate   Std. Error    z-value  Pr(>|z|)
## lag(ln_peace, 1)  1.0070145335 0.0206647910 48.7309324 0.0000000
## ln_innovation    -0.0056085591 0.0195672859 -0.2866294 0.7743961
## inflation        -0.0001903811 0.0001932999 -0.9849001 0.3246732
## pop_growth        0.0082497799 0.0065422040  1.2610093 0.2073055
## urban_growth     -0.0094014639 0.0070492505 -1.3336828 0.1823078
cat("\n--- Sargan Test ---\n")
## 
## --- Sargan Test ---
sargan(gmm_log_peace)
## 
##  Sargan test
## 
## data:  ln_peace ~ lag(ln_peace, 1) + ln_innovation + inflation + pop_growth +  ...
## chisq = 18.315, df = 53, p-value = 1
## alternative hypothesis: overidentifying restrictions not valid
cat("\n--- AR(1) Test ---\n")
## 
## --- AR(1) Test ---
mtest(gmm_log_peace, order = 1)
## 
##  Arellano-Bond autocorrelation test of degree 1
## 
## data:  ln_peace ~ lag(ln_peace, 1) + ln_innovation + inflation + pop_growth +  ...
## normal = -2.8213, p-value = 0.004783
## alternative hypothesis: autocorrelation present
cat("\n--- AR(2) Test ---\n")
## 
## --- AR(2) Test ---
mtest(gmm_log_peace, order = 2)
## 
##  Arellano-Bond autocorrelation test of degree 2
## 
## data:  ln_peace ~ lag(ln_peace, 1) + ln_innovation + inflation + pop_growth +  ...
## normal = 1.1435, p-value = 0.2528
## alternative hypothesis: autocorrelation present

———- Prosperity ———-

gmm_summary_prosperity <- summary(gmm_log_prosperity, robust = TRUE)

cat(“====================”) cat(“Diagnostics”) cat(“====================”)

gmm_summary_prosperity\(sargan gmm_summary_prosperity\)m1 gmm_summary_prosperity$m2

———- People ———-

gmm_summary_people <- summary(gmm_log_people, robust = TRUE)

cat(“====================”) cat(“Diagnostics”) cat(“====================”)

gmm_summary_people\(sargan gmm_summary_people\)m1 gmm_summary_people$m2

———- Planet ———-

gmm_summary_planet <- summary(gmm_log_planet, robust = TRUE)

cat(“====================”) cat(“Diagnostics”) cat(“====================”)

gmm_summary_planet\(sargan gmm_summary_planet\)m1 gmm_summary_planet$m2

———- Partnership ———-

gmm_summary_partnership <- summary(gmm_log_partnership, robust = TRUE)

cat(“====================”) cat(“Diagnostics”) cat(“====================”)

gmm_summary_partnership\(sargan gmm_summary_partnership\)m1 gmm_summary_partnership$m2

———- Peace ———-

gmm_summary_peace <- summary(gmm_log_peace, robust = TRUE)

cat(“====================”) cat(“Diagnostics”) cat(“====================”)

gmm_summary_peace\(sargan gmm_summary_peace\)m1 gmm_summary_peace$m2


# ----------------------------
# 5) Tables
# ----------------------------


``` r
library(modelsummary)

modelsummary(
  list(
    "Prosperity" = twfe_log_prosperity,
    "People" = twfe_log_people,
    "Planet" = twfe_log_planet,
    "Partnership" = twfe_log_partnership,
    "Peace" = twfe_log_peace
  ),
  stars = TRUE,
  output = "markdown"
)
Prosperity People Planet Partnership Peace
ln_innovation -0.140 0.074*** 0.285*** -0.069* 0.038*
(0.766) (0.016) (0.023) (0.035) (0.019)
inflation -0.015 0.001 0.001 0.001 -0.000
(0.019) (0.000) (0.001) (0.001) (0.000)
pop_growth -0.683* 0.014* 0.028** 0.019 -0.020*
(0.318) (0.007) (0.010) (0.014) (0.008)
urban_growth -0.153 -0.007 -0.020* -0.021+ 0.026***
(0.280) (0.006) (0.008) (0.013) (0.007)
Num.Obs. 220 220 220 220 220
R2 0.105 0.134 0.473 0.062 0.110
R2 Adj. -0.054 -0.019 0.380 -0.105 -0.048
AIC 844.4 -859.0 -695.1 -519.7 -783.2
BIC 861.4 -842.0 -678.1 -502.8 -766.3
RMSE 1.61 0.03 0.05 0.07 0.04
  • p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001
modelsummary(
  list(
    "Prosperity" = cre_log_prosperity,
    "People" = cre_log_people,
    "Planet" = cre_log_planet,
    "Partnership" = cre_log_partnership,
    "Peace" = cre_log_peace
  ),
  stars = TRUE,
  output = "markdown"
)
Prosperity People Planet Partnership Peace
(Intercept) 11.313* 3.374*** -4.073+ -0.645 3.136***
(4.869) (0.641) (2.272) (2.002) (0.473)
ln_innovation -0.527 0.068*** 0.040 0.027 0.032*
(0.960) (0.012) (0.027) (0.032) (0.014)
inflation 0.040 0.001+ -0.001 0.004*** -0.000
(0.030) (0.000) (0.001) (0.001) (0.000)
pop_growth -1.320* 0.014* 0.019 0.011 -0.020**
(0.514) (0.006) (0.015) (0.017) (0.008)
urban_growth 0.249 -0.007 -0.016 -0.004 0.025***
(0.450) (0.006) (0.013) (0.015) (0.007)
emerging -0.880 -0.150 -0.498 0.036 -0.342***
(0.735) (0.097) (0.343) (0.302) (0.071)
mean_ln_innovation -1.843 0.218 1.306* 1.019* 0.243*
(1.450) (0.144) (0.508) (0.448) (0.107)
mean_inflation 0.001 0.001 -0.013 -0.025 -0.009*
(0.051) (0.005) (0.019) (0.017) (0.004)
mean_pop_growth -0.146 -0.099 0.411 -0.737+ -0.161+
(1.047) (0.120) (0.426) (0.375) (0.089)
mean_urban_growth 1.358 0.144 0.041 0.783* 0.199*
(0.935) (0.108) (0.383) (0.337) (0.080)
Num.Obs. 220 220 220 220 220
R2 0.164 0.224 0.138 0.134 0.350
R2 Adj. 0.128 0.191 0.101 0.097 0.323
AIC 1102.2 -828.9 -462.2 -397.2 -748.7
BIC 1139.5 -791.6 -424.8 -359.8 -711.4
RMSE 2.82 0.03 0.08 0.09 0.04
  • p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001
modelsummary(
  list(
    "Prosperity" = gmm_log_prosperity,
    "People" = gmm_log_people,
    "Planet" = gmm_log_planet,
    "Partnership" = gmm_log_partnership,
    "Peace" = gmm_log_peace
  ),
  stars = TRUE,
  output = "markdown"
)
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
## Warning: `modelsummary could not extract goodness-of-fit statistics from a model
## of class "pgmm". The package tried a sequence of 2 helper functions:
## 
## performance::model_performance(model)
## broom::glance(model)
## 
## One of these functions must return a one-row `data.frame`. The `modelsummary` website explains how to summarize unsupported models or add support for new models yourself:
## 
## https://modelsummary.com/vignettes/modelsummary.html
Prosperity People Planet Partnership Peace
lag(prosperity, 1) -0.078**
(0.025)
ln_innovation 0.312*** -0.019*** 0.001 0.084** -0.006
(0.060) (0.004) (0.005) (0.027) (0.009)
inflation 0.071*** 0.000*** 0.000 0.001** -0.000*
(0.005) (0.000) (0.000) (0.000) (0.000)
pop_growth -2.704*** -0.001 -0.016** -0.044*** 0.008***
(0.535) (0.002) (0.006) (0.009) (0.002)
urban_growth 1.989*** 0.004+ 0.014* 0.036*** -0.009**
(0.490) (0.002) (0.006) (0.009) (0.003)
lag(ln_people, 1) 1.016***
(0.004)
lag(ln_planet, 1) 0.990***
(0.010)
lag(ln_partnership, 1) 0.909***
(0.028)
lag(ln_peace, 1) 1.007***
(0.009)
  • p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001