*! version 2.0 June 2018

Title

sdmxuse -- Import data from statistical agencies using the SDMX standard

Available providers:

- European Central Bank (ECB)

- Eurostat (ESTAT)

- International Monetary Fund (IMF)

- Organisation for Economic Co-operation and Development (OECD)

- United Nations Statistics Division (UNSD)

- World Bank (WB)

Syntax

sdmxuse dataflow provider

sdmxuse datastructure provider, dataset(identifier)

sdmxuse data provider, dataset(identifier)

Main
attributes download attributes (e.g. observations' flags)

clear clears data in memory

Select data
dimensions() allows customizing requests for data

start() defines start period

end() defines end period

Reshape data
timeseries reshapes dataset to obtain time series

panel() reshapes dataset to obtain a panel

Merge DSD
mergedsd merges data (time series) and Data Structure Definition

Description

sdmxuse imports data from statistical agencies using the SDMX standard. Available providers are the European Central Bank (ECB), Eurostat (ESTAT),
the International Monetary Fund (IMF), the Organisation for Economic Co-operation and Development (OECD), the United Nations Statistics Division (UNSD) and the World Bank (WB).

You can get a complete list of publicly available datasets from a provider by specifying the resource: dataflow.
Then, you can obtain the Data Structure Definition (DSD) of a given dataset by specifying the resource: datastructure.
Finally, you can download the dataset by specifying the resource: data.

You can also find the dataset identifier on some providers' website. Eurostat, for instance, refers to the dataset identifier as 'product code',
indicated between brackets after the titles in the navigation tree: http://ec.europa.eu/eurostat/data/database

Options

Main

attributes downloads attributes that give additional information about the series or the observations but do not affect the dataset structure itself (e.g. observations' flags).

clear clears data memory before proceeding.

Select data

dimensions() allows customizing requests for data. Time series can be retrieved based on the value they take for each dimension.
Dimensions should be separated by a dot "." character and must respect the order specified in the Data Structure Definition.
A dimension can be left empty if all values are requested. Multiple values for a dimension are separated by a plus "+" sign.

start() defines the start period. You can specify the exact value (e.g. 2010-01) or just the year (e.g. 2010).

end() defines the end period.

Reshape data

timeseries reshapes the dataset so that each series is stored in a single variable. Variables' names are made of dimensions' values.

panel(panelvar) reshapes the dataset into a panel. panelvar must be specified, it will often be the geographical dimension.

Merge DSD

mergedsd merges the data (time series) and the Data Structure Definition - particularly useful when dimensions' codes are not transparent (e.g. HRV is the ISO ALPHA-3 code for Croatia).

Examples

. sdmxuse dataflow OECD, clear

. sdmxuse datastructure OECD, clear dataset(EO)

. sdmxuse data OECD, clear dataset(EO) dimensions(FRA+DEU.GDPV_ANNPCT.A) start(1993)

. sdmxuse data OECD, clear dataset(EO) dimensions(FRA+DEU.GDPV_ANNPCT.A) start(1993) timeseries

. sdmxuse data OECD, clear dataset(EO) dimensions(.GDPV_ANNPCT+CPIH.A) panel(location)

. sdmxuse data OECD, clear dataset(EO) dimensions(.GDPV_ANNPCT.A) mergedsd

Remarks

The author is grateful to Robert Picard and Nicholas J. Cox for allowing him to reproduce their code of the package moss to deal with multiple occurrences of substrings.

For queries larger than 30,000 cells, Eurostat will post the file to a different repository.
sdmxuse can accommodate this but processing time will be longer.

Author

Sebastien Fontenay

Universite catholique de Louvain

sebastien.fontenay@uclouvain.be