Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Global Macro Database

R Package

Explore the Global Macro Database

Read the paper Download the data R package License: Non-Commercial

Link to paper

This repository complements the paper, Müller, Xu, Lehbib, and Chen (2025), which introduces a panel dataset of 46 core macroeconomic variables (provided as 77 harmonized series) across 239 countries and territories from historical records beginning in the year 1086 until 2025, including projections through the year 2031.

Features

  • Unparalleled Coverage: Combines data from 35 contemporary sources (e.g., IMF, World Bank, OECD) and 132 historical datasets, totaling 167 sources.
  • Extensive Variables: GDP, inflation, government finance, trade, employment, interest rates, and more.
  • Harmonized Data: Resolves inconsistencies and splices all available data together.
  • Scheduled Updates: Regular releases ensure data reliability.
  • Full Transparency: All code is open source and available in this repository.
  • Accessible Formats: Provided in .dta, .csv and as Stata/Python/R/Julia/MATLAB package.

Installation

Download via website

R package:

# Install from GitHub
install.packages("remotes")
remotes::install_github("KMueller-Lab/Global-Macro-Database-R")

Usage

library(globalmacrodata)

# Get data from latest available version
df <- gmd()

# Get data from a specific version
df <- gmd(version = "2026_09")

# List all available versions
gmd(version = "list")

# Get data for a specific country
df <- gmd(country = "USA")

# Get data for multiple countries
df <- gmd(country = c("USA", "CHN", "DEU"))

# Get specific variables
df <- gmd(variables = c("rGDP", "infl", "unemp"))

# Get raw data for a single variable
df <- gmd(variables = "rGDP", raw = TRUE)

# Load available variables as a dataframe
df <- gmd(vars = TRUE)

# Print available variables (without saving)
gmd(vars = TRUE)

# Load available countries as a dataframe
df <- gmd(iso = TRUE)

# Print available countries (without saving)
gmd(iso = TRUE)

# Access data from a specific source (e.g., IMF World Economic Outlook)
df <- gmd(sources = "IMF_WEO")

# Access specific variables from a source
df <- gmd(sources = "IMF_WEO", variables = "nGDP")

# List all available sources
gmd(sources = "list")

# Load the full source list as a dataframe
df <- gmd(sources = "load")

# Get BibTeX citation for a specific source
gmd(cite = "GMD")

# Load the full citation list as a dataframe
df <- gmd(cite = "load")

# Combine parameters
df <- gmd(
  country = c("USA", "CHN"),
  variables = c("rGDP", "unemp", "CPI")
)

Parameters

Parameter Type Description
variables character or vector Variable code(s) to include (e.g., "rGDP" or c("rGDP", "unemp"))
country character or vector ISO3 country code(s) (e.g., "SGP" or c("MRT", "SGP"))
version character Dataset version in format "YYYY_MM" (e.g., "2026_09"). Use "current" for the latest version, "list" to see all available versions
raw logical If TRUE, download raw data for a single variable
iso logical If TRUE, return available countries. Use df <- gmd(iso = TRUE) to load as dataframe, or gmd(iso = TRUE) to print
vars logical If TRUE, return available variables with definitions and units. Use df <- gmd(vars = TRUE) to load as dataframe, or gmd(vars = TRUE) to print
sources character "load" to load source list, "list" to print sources, or a source name (e.g., "IMF_IFS") to load that source's data. You can combine with variables to load only specific variables from that source
cite character "load" to load citation list, or a source key (e.g., "GMD") to display its BibTeX

Citation

When using the Global Macro Database, please cite the following NBER Working Paper:

Müller, K., Xu, C., Lehbib, M., & Chen, Z. (2025). The Global Macro Database: A New International Macroeconomic Dataset (NBER Working Paper No. 33714).

@techreport{mueller2025global,
    title = {{The Global Macro Database: A New International Macroeconomic Dataset}},
    author = {Müller, Karsten and Xu, Chenzi and Lehbib, Mohamed and Chen, Ziliang},
    institution = {National Bureau of Economic Research},
    type = "Working Paper",
    series = "Working Paper Series",
    number = "33714",
    year = "2025",
    month = "April",
    doi = {10.3386/w33714},
    URL = "http://www.nber.org/papers/w33714",
}

Documentation

You can find the Technical Appendix on the official website.

Please visit this repository to access the project source code.

Authors

Maintainer

License & Terms of Use

This repository and the bundled metadata shipped with the package are available for non-commercial use only. By using this package, you agree to the terms in LICENSE and the terms of use outlined on the GMD website.

For license enquiries, please email kmueller@globalmacrodata.com.

About

No description, website, or topics provided.

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages