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.
❗❗ 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.
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.
To use medusa
package first you need to follow this steps:
Install R and Rstudio (only if not already installed)
Load medusa
package. For this, open Rstudio and load the library:
install.packages('remotes')
options(timeout=400) # to prevent errors if the connection is slow
remotes::install_github("bc3LC/medusa")
library(medusa)
❗❗ This may take a few minutes because the package contains a lot of data.
Now the package is fully loaded and you can start using its functions.
The medusa
package contains 3 main blocks of functions:
calc_di
, ex_shocks
, available_var_impact
, available_var_intersec
and ex_var_intersec
.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
.calc_ep
id_ep1
, id_ep2
, weighted.median
and weighted.quantile
.calc_tp
id_tp
, weighted.median
and weighted.quantile
.In addition, the package includes some default input files (.Rda), that are read by the different functions.