Interactive Correlation Matrix

Correlation Matrix

Autocorrelation Function

Time-Series Plotting

Download Data

White Noise, Seasonality, Unit Root, Stationarity and Cointegration Tests



Download


                    

                    

P-values from each tests reported:

Information About the Tests:


                            

Phillips-Ouliaris Cointegration Test: Computes the Phillips-Perron test for a unit root in the residuals of the cointegration regression: A regression of the first series on the remaining ones without a linear trend

Custom API Call

to

  

R Application Programming Interface (API)

The R package ugatsdb connects to a relational time series database and provides direct access to more than 5000 time series available in the Macro Data Portal at various frequencies (daily, monthly, quarterly, annual CY and FY). These series broadly cover of the 4 sectors of the economy (real, external, financial and fiscal) and also include various development indicators. They are sourced on a monthly basis from the Bank of Uganda, UBOS, the Ministry of Finance, the IMF, and the World Bank. Data with a cross-sectional dimension such as census data or trade-related panels are not available through the API but can be accessed via the Portal.

The API allows bulk download of entire datasets or query of individual series from one or more datasets. The functions datasource(), datasets() and series() provide information about the available data, analogous to the 'Data Catalog' tab in the Portal. Dataset and series codes from these tables are needed to query data using the get_data() function. The API is fully documented on the R help pages, calling help(ugatsdb) after installation. A small demonstration is provided below.

It should be noted that the API connects directly to a database, requiring remote connections to be permitted by the users firewall (which may not be the case inside institutional networks that block all remote connections).

Installation

The package can be installed from the R console by executing the following line of R code:

install.packages('ugatsdb')

Example Usage

The following code downloads daily interest rates data from the Bank of Uganda for the last 365 days. The dygraphs library can be used to generate a dynamic chart of this data following easy conversion to extensible time series format.


          

The ugatsdb package also provides functions wide2long() and long2wide() to reshape data from the API (by default the format is wide). The database stores data at all frequencies in a 'Date' column. The function expand_date() can be used to generate various additional identifiers from the date variable (by default year, quarter, fiscal year, quarter of fiscal year and month), which are useful for data manipulations tasks such as aggregation.


        
Copyright © 2021, MEPD

Purpose of the Macro Data Portal

The Macro Data Portal was built within the Macroeconomic Policy Department (MEPD) of the Ministry of Finance, Planning and Economic Development (MoFPED) of Uganda. It's aim is to simplify MoFPED staff and general public access to timely and highly structured macroeconomic and financial data on Uganda, published in heterogenous formats by various national and international bodies. The portal facilitates selection, filtering, aggregation and transformation of data and subsequent download in a concise format as CSV, Excel, R, STATA, SPSS or SAS file. Since all the data is published elsewhere, it it free for access by the general public.

Technical Details

The portal was built using the shiny package for web-application development in R, supplemented with some custom HTML and CSS elements. It also uses R code to download and process data from various sources using various R API packages (IMFData, wbstats, Rilostat, tradestatistics) and direct excel sheet access and processing from the BOU and UBOS websites. The downloaded data is read into a relational database, enabling fast access by the portal and the R API package. Monthly and quarterly data in the portal are updated once a month (around the 15th of each month). These updates usually take along revisions to earlier data conducted by the issuing authorities. The web-application was built by Sebastian Krantz (ODI Fellow 2020/21). A simplified version of the source code has been made available as an open-source project on Github.

Open Source Code

Other Web-Applications

Based on data available in this portal, the Macroeconomic Policy Department also provides an interactive dashboard to monitor recent macroeconomic developments in Uganda, and an application to visualize detailed spatial data from the latest census.

Macroeconomic Monitor
Census Mapper