trade
-
The updated paper and dataset can be downloaded from UNESCAP.
Load libraries and read data library(AER) library(dplyr) library(foreign) library(ggplot2) library(lmtest) library(multiwayvcov) library(sampleSelection) data <- read.dta("servicesdataset_2016.dta") Correlations Table 1
data <- data %>% mutate(ln_trade = log(trade), ln_distance = log(dist), ln_gdp_exp = log(gdp_exp), ln_gdp_imp = log(gdp_imp)) cor.data <- data %>% filter(sector == "SER") %>% select(ln_trade, ln_gdp_exp, ln_gdp_imp, ln_distance) %>% na.omit %>% filter(ln_trade > -Inf) round(cor(cor.data), 4) ## ln_trade ln_gdp_exp ln_gdp_imp ln_distance ## ln_trade 1.