library(dplyr)
library(openxlsx)
data <- read.xlsx("https://www.policyuncertainty.com/media/All_Country_Data.xlsx", sheet=1) %>%
as.data.frame()
head(data)
## Year Month GEPU_current GEPU_ppp Australia Brazil Canada Chile China
## 1 1985 1 NA NA NA NA 106.92593 NA NA
## 2 1985 2 NA NA NA NA 114.69938 NA NA
## 3 1985 3 NA NA NA NA 79.58830 NA NA
## 4 1985 4 NA NA NA NA 73.37599 NA NA
## 5 1985 5 NA NA NA NA 75.60223 NA NA
## 6 1985 6 NA NA NA NA 43.14037 NA NA
Für die weiteren Schritte bringen wir den Datensatz erst einmal ins long-Format und gruppieren zudem die Länder:
library(zoo)
library(reshape2)
data_long <- data %>%
mutate(Date = as.yearmon(paste(.$Year, .$Month), "%Y %m")) %>%
select(-Year, -Month, -GEPU_current, -GEPU_ppp) %>%
melt(id.vars = "Date", variable.name = "country") %>%
mutate(region =
ifelse(country %in% c("Australia", "China", "India", "Japan", "Korea", "Singapore", "SCMP China", "Mainland China"), 'Asia',
ifelse(country %in% c("Brazil", "Canada", "Chile", "Colombia", "Mexico", "US"), 'Americas',
ifelse(country %in% c("France", "Germany", "Greece", "Ireland", "Italy", "Netherlands", "Russia", "Spain", "UK", "Sweden"), 'Europe', 'Global'))))
head(data_long)
## Date country value region
## 1 Jan 1985 Australia NA Asia
## 2 Feb 1985 Australia NA Asia
## 3 Mar 1985 Australia NA Asia
## 4 Apr 1985 Australia NA Asia
## 5 May 1985 Australia NA Asia
## 6 Jun 1985 Australia NA Asia
Und nun können wir die Entwicklung visualisieren:
library(ggplot2)
library(ggrepel)
data_long %>%
filter(Date >= "Jan 1990") %>%
mutate(Date = as.Date(as.yearmon(.$Date))) %>%
ggplot(aes(x=Date, y=value, color=country)) +
geom_smooth(span=0.01, se=FALSE) +
geom_text_repel(data = . %>% group_by(region) %>% filter(Date == max(Date)),
aes(label = country)) +
scale_x_date(date_labels="%Y", date_breaks ="4 years") +
expand_limits(x = as.Date(c("1990-01-01", "2028-01-01"))) +
facet_grid(region~.) +
theme_minimal() +
theme(axis.title.x=element_blank(),
axis.title.y=element_blank(),
#axis.text.y=element_blank(),
legend.position="none")
Interessanterweise sehen wir einen Anstieg der Unsicherheit weltweit; allerdings kaum in den USA. Insofern schauen wir uns nun einmal die USA genauer an; allerdings anhand der täglichen Daten, welche hierfür auch aufbereitet werden müssen. Die große Frage nun: Spiegeln die täglichen Werte die Hektik der Politik in den USA wider?
library(rio)
data_US_EPUdaily = import("http://policyuncertainty.com/media/All_Daily_Policy_Data.csv") %>%
mutate(Date = as.Date(paste(.$year, .$month, .$day), "%Y %m %d"))
data_US_EPUdaily %>%
filter(year >= 2019) %>%
ggplot(aes(x=Date, y=daily_policy_index, group=1)) +
geom_line(color="grey")+
geom_smooth(span=0.05) +
theme_minimal()+
theme(axis.title.x=element_blank(), axis.title.y=element_blank()) +
labs(
title = paste("US Daily News Index"),
subtitle = "tägliche Werte")
Wir sehen auch hier einen eindeutigen Trend nach oben. Ein großer Streitpunkt ist ja die Auseinandersetzung zwischen Trump und China. Können wir hier eine Entwicklung sehen? AUch hierzu gibt es einen spezifischen Index. Mit der Zählung von Artikeln welche die USA, China und Streitthemen und erkennbaren Spannungen. Wir sehen hier ein anhaltendes hohes Niveau:
library(tidyr)
data_US_China_EPU = import("https://www.policyuncertainty.com/media/UCT.csv") %>%
separate(col = date, into = c("year", "month"), sep = "m") %>%
mutate(Date = as.yearmon(paste(.$year, .$month), "%Y %m"))
data_US_China_EPU %>%
#filter(year >= 2019) %>%
ggplot(aes(x=Date, y=UCT, group=1)) +
geom_line(color="grey")+
geom_smooth(span=0.5) +
theme_minimal()+
theme(axis.title.x=element_blank(), axis.title.y=element_blank()) +
labs(
title = paste("US China Uncertainty"),
subtitle = "monatliche Werte")
Bitte beachte, dass der EPU auf der Arbeit der folgenden Arbeiten fußt: Australia, Brazil, Canada, France, Germany, India, Italy, Mexico, South Korea, Russia, United Kingdom, United States: Baker, Bloom and Davis (2016). Chile: Cerda, Silva and Valente (2016). China: Baker, Bloom, Davis and Wang (2013). Colombia: Gil and Silva (2018) Global: Davis (2016). Greece: Hardouvelis, Karalas, Karanastasis and Samartzis (2018). Ireland: Zalla (2016). Japan: Arbatli, Davis, Ito and Miake (2019). The Netherlands: Kroese, Kok and Parlevliet (2015) Singapore: Davis (2016). Spain: Ghirelli, Perez, and Urtasun (2019). Sweden: Armelius, Hull, and Köhler (2017). References: Arbatli, E., S.J. Davis, A. Ito, and N. Miake, 2019. “Policy Uncertainty in Japan,” NBER Working Paper 23411. Revised, August 2019. Forthcoming in The Economic Challenges of Japan’s Aging and Shrinking Population, International Monetary Fund, edited by Paul Cashin and Todd Schneider. Armelius, H., I. Hull, and H.S. Köhler, 2017. “The Timing of Uncertainty Shocks in a Small Open Economy,” Economics Letters, 155 (June), 31-34. Baker, S.R., N. Bloom, S.J. Davis and Xiaoxi Wang, 2013. “Economic Policy Uncertainty in China,” unpublished paper, University of Chicago. Baker, S. R., N. Bloom, and S. J. Davis, 2016. “Measuring Economic Policy Uncertainty,” Quarterly Journal of Economics, 131, no. 4 (November), 1593-1636. Cerda, R., A. Silva and J. T. Valente, 2016. “Economic Policy Uncertainty Indices for Chile,” working paper. Davis, S. J., 2016. “An Index of Global Economic Policy Uncertainty.” Macroeconomic Review, October. Also available as NBER Working Paper No. 22740. Davis, S. J., Dingquian Liu and Xuguang Simon Sheng, 2019. “Economic Policy Uncertainty in China Since 1946: The View from Mainland Newspapers,” working paper, August. Ghirelli, C., J.J. Perez, and A. Urtasun, 2019. “A New Economic Policy Uncertainty Index for Spain,” Bank of Spain, WorkingPaper No., 1906. Gil, M. and D. Silva, 2018. “Economic Policy Uncertainty Indices for Colombia,” working paper. Hardouvelis, G. A., G. I. Karalas, D. I. Karanastasis and P. K. Samartzis, 2018. “Economic Policy Uncertainty, Political Uncertainty and the Greek Economic Crisis,” working paper, May. Kroese, L., S. Kok and J. Parlevliet, 2015. “Beleidsonzekerheid in Nederland,” Economisch Statistische Berichten, No. 4715, pp. 464-467. Zalla, R., 2016. “Economic Policy Uncertainty in Ireland,” working paper, 20 September.
Photo by Johannes Plenio: https://www.pexels.com/photo/scenic-view-of-ocean-during-sunset-2304423/