This repository contains all codes necessary to reproduce the results of our article “Pairwise share ratio interpretations of compositional regression models”, available at:
Dargel, Lukas, and Christine Thomas-Agnan (2024). Pairwise share ratio interpretations of compositional regression models. Computational Statistics & Data Analysis, Volume 195, July 2024, 107945 Accessed 08 Mar 2024. Online at https://doi.org/10.1016/j.csda.2024.107945
The vignette accompanying the article illustrates the presented mathematical tools for a case study of French electoral sociology and can be downloaded directly as HTML.
To reproduce the results, you can run the bash commands below:
# get all codes from GitHub
git clone https://github.com/LukeCe/paper_Share_Ratio
cd paper_Share_Ratio # change working directory to the cloned git
# build the docker image for the paper from the current directory
docker build -t repro_share_ratio .
# run the analysis from within the docker container
docker run --rm \
-v .:/home/paper_Share_Ratio \ # mount the repository into the docker
-w '/home/paper_Share_Ratio' \ # change working directory accordingly
repro_share_ratio \ # specfiy the docker image
Rscript repro.R # execute the repro.R script
Executing the command Rscript repro.R
performs the following steps:
-
Download the three source data sets and places them in
in\data
:- Election results from the French Ministry of the Interior
- Socio-demographic information from the population census provided by INSEE
- Geographic contours of French municipalities provided by IGN (this file has about 250MB and can take some time to download)
-
Merge the data sources and place the combined data in
out/data
-
Rebuild the HTML vignette that generates all results used in the article
- The vignette is placed in
notebooks
- The outputs used for the article are placed in
out/figures
andout/tables
- The vignette is placed in
Please cite the above article when using any material from this repository.
Text and figures : CC BY 4.0
Code : GPL 3.0
Data : See the policies of the original data providers