get_epu() function collects the EPU data and outputs an xts object. The required argument is region which is a character indicating the region of EPU data you need. By default, it collects all regions.
The data collection is in real time and normally takes about several seconds to download.
As it is a
xts object, so
dygraph can be directly applied for interactive plots.
Another way to get country level data is to directly manipulate the all_data object:
regionwill take care of the NA values so there is no large white area in the plot. However, it is not a problem in
xts, just delete the NAs.
The US TPU data is one of the category-specific EPU indices developed in the original paper by Baker et al. (2016). “It reflects the frequency of articles in American newspapers that discuss policy-related economic uncertainty and also contain one or more references to trade policy”. To get the US TPU data:
To get the China TPU: