MEDUSA

MEDUSA: An R tool to model equity and distributional impacts - Published in JOSS (2025)

https://github.com/bc3lc/medusa

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 7 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Engineering Computer Science - 33% confidence
Last synced: 6 months ago · JSON representation

Repository

R package to develop distributional analyzes (Spain)

Basic Info
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 1
Created over 2 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog License

README.md

MEDUSA - Modelling Equity and DistribUtional impacts for Socioeconomic Analysis

docs pages-build-deployment test_coverage codecov build draft-pdf DOI DOI

Contents

Introduction

Back to Contents

State of the field

Addressing critical challenges, such as climate change, requires ambitious policies that promote social justice while avoiding the deepening of existing inequalities, such as income or gender disparities. To achieve this, policy impact assessments must not only take a holistic view of the economy, energy, land, and water systems but also analyze the distributional effects on different population groups.

While Integrated Assessment Models (IAMs) play a key role in policy evaluation, they often lack the granularity needed to capture socio-economic disparities. Micro-simulation models help bridge this gap by providing detailed, heterogeneous results that allow policymakers to identify vulnerable populations and design targeted compensatory measures. However, despite the growing emphasis on distributional analysis in the academic literature, these approaches have not yet been widely integrated into policymaking. A key barrier is the lack of accessible tools that facilitate this type of analysis for practitioners and policymakers.

MEDUSA is the first R package specifically designed to fill this gap. MEDUSA provides a user-friendly framework for conducting distributional analysis. By simplifying complex modeling processes, it enables a broader audience including researchers, policymakers, and analysts to incorporate equity considerations into policy design, ensuring that policies are both effective and socially just.

The package

MEDUSA is an R package that allows the development of distributional analyses in isolation or in connection with other models (soft links). The extensive database in which the microsimulation model is based allows for highly disaggregated results, taking into account numerous socioeconomic and demographic characteristics of households, such as income level, place of residence, type of family or the feminization degree of the household. Additionally, the package combines these with the calculation of energy and transport poverty indices.

:exclamation::exclamation: Note: At the moment, medusa package works for Spain, but in the short term the idea is to extend it to all EU countries. Moreover, the package could be extended to all countries that are able to provide the raw data of the model.

The microsimulation model

MEDUSA allows to develop distributional analyses based in an overnight effect microsimulation model. The model is built up with the microdata from the Household Budget Survey. For more details on the model in which medusa is based click here.

Installation Guide

Back to Contents

To use medusa package first you need to follow this steps:

  1. Install R (required) and optionally an interface to facilitate usage, such as RStudio (only if not already installed):
-   To download R click [here](https://www.r-project.org/)

-   To download Rstudio click [here](https://www.rstudio.com/)
  1. Load medusa package. For this, open Rstudio and load the library:

    r install.packages('remotes') options(timeout=400) # to prevent errors if the connection is slow remotes::install_github("bc3LC/medusa") library(medusa)

:exclamation::exclamation: This may take a few minutes because the package contains a lot of data. If the installation fails, the timeout parameter may need to be further increased. Additionally, sometimes users downloading medusa with remotes may need to set up a Personal Access Token (PAT) and store it in their credentials file. For more information about how to proceed click here.


Now the package is fully loaded and you can start using its functions.

Getting Started

Back to Contents

The medusa package contains 3 main blocks of functions:

  1. Module 1. Functions to calculate distributional impacts
    • Main function: calc_di, ex_shocks, available_var_impact , available_var_intersec and ex_var_intersec.
    • Auxiliary functions: load_rawhbs, rename_values, standardize, add_coicop, elevate_hbs, price_shock, impact, impact_intersectional, basic_graph, intersectional_graph, order_var, adjust_wh and adjust_wh_is.
  2. Module 2. Functions to calculate energy poverty indices
    • Main function: calc_ep
    • Auxiliary functions: id_ep1, id_ep2, weighted.median and weighted.quantile.
  3. Module 3. Functions to calculate transport poverty indices
    • Main function: calc_tp
    • Auxiliary functions: id_tp, weighted.median and weighted.quantile.

In addition, the package includes some default input files (.Rda), that are read by the different functions.

Contributing

Back to Contents

We welcome contributions! You can provide feedback, report issues, or suggest improvements by opening an issue on GitHub here. If you would like to make changes to the code, we recommend first opening an issue to outline your proposed modifications before submitting a pull request.

If you have any questions about the package, feel free to post them as issues on GitHub as well.

Owner

  • Name: BC3 Low Carbon department
  • Login: bc3LC
  • Kind: organization
  • Location: Spain

JOSS Publication

MEDUSA: An R tool to model equity and distributional impacts
Published
July 07, 2025
Volume 10, Issue 111, Page 7697
Authors
Eva Alonso-Epelde ORCID
Basque Centre for Climate Change (BC3), Edificio Sede 1-1, Parque Científico de UPV/EHU, Barrio Sarriena s/n, 48940 Leioa, Spain
Clàudia Rodés-Bachs ORCID
Basque Centre for Climate Change (BC3), Edificio Sede 1-1, Parque Científico de UPV/EHU, Barrio Sarriena s/n, 48940 Leioa, Spain
Editor
Nikoleta Glynatsi ORCID
Tags
distributional impacts equality socioeconomic analysis

GitHub Events

Total
  • Watch event: 2
  • Push event: 80
  • Pull request event: 2
  • Fork event: 2
  • Create event: 1
Last Year
  • Watch event: 2
  • Push event: 80
  • Pull request event: 2
  • Fork event: 2
  • Create event: 1

Committers

Last synced: 6 months ago

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • Nikoleta-v3 (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • dplyr * imports
  • knitr * imports
  • markdown * imports
  • reshape2 * imports
  • restatapi * imports
  • rgcam * imports
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/docs.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/build.yaml actions
  • actions/checkout v1 composite
  • r-lib/actions/setup-pandoc v2-branch composite
  • r-lib/actions/setup-r v2-branch composite
  • r-lib/actions/setup-tinytex v2-branch composite
.github/workflows/test_coverage.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • codecov/codecov-action v3 composite
  • r-lib/actions/setup-pandoc v2-branch composite
  • r-lib/actions/setup-r v2-branch composite
  • r-lib/actions/setup-tinytex v2-branch composite
.github/workflows/draft-pdf.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v4 composite
  • openjournals/openjournals-draft-action master composite