The Groupwise Decomposition: Estimating Group-Specific Contributions to Differences between Demographic Measures ================ The decomposition of demographic measures is a fundamental tool in a demographer’s toolkit. Through decomposition of demographic measures, researchers can gain crucial insights into the importance of different mechanisms in producing demographic change. Most decomposition techniques decompose changes in demographic measures over time or, more generally, differences between demographic rates. However, fewer techniques are available to researchers needing to estimate the contribution of different subpopulations to the difference between a demographic measure for the total population and for a reference population. This repository contains codes to perform such a decomposition technique and implements one practical application. ## General repository structure The repository is organized in several directories: - `R`: Contains R code. Files are named starting with a numeric code and should be executed in a sequence from the lowest to the highest. - `data`: Contains mortality data from CDC WONDER for the application. - `outputs`: Contains all artifacts produced by the R code. - `outputs/data`: Contains data files. - `outputs/figures`: Contains figures. - `outputs/tables`: Contains tables. The key functions to perform the basic and extended groupwise decompositions are stored in the `00_functions.R` and `00_functions_extended.R` scripts. ## Folder Structure ## /Users/eugeniopaglino/Dropbox/Upenn/GitHub/groupwise-decomposition ## ├── R ## │ ├── 00_functions.R ## │ ├── 00_functions_extended.R ## │ ├── 01_clean_mort_data.R ## │ ├── 02_vaupel_canudas_romo.R ## │ ├── 11_groupwise_decomp.R ## │ ├── 12_groupwise_decomp_extended.R ## │ ├── 13_benchmark.R ## │ ├── 14_benchmark_extended.R ## │ ├── 21_visualize_data.R ## │ ├── README.Rmd ## │ └── legacy ## │ ├── GDecompose.Rmd ## │ ├── GDecomposeByAge.Rmd ## │ └── cleanMortalityData.Rmd ## ├── README.md ## ├── data ## │ ├── CDCMortByMetro ## │ │ ├── mortByMetro10YrAgeGroups.txt ## │ │ └── mortByMetro5YrAgeGroups.txt ## │ └── HMD_credentials.RData ## ├── docs ## │ ├── mixed ## │ │ ├── Groupwise-Decomposition.docx ## │ │ ├── Groupwise-Decomposition_EWF.pdf ## │ │ ├── NG-decomposition-PAA.docx ## │ │ ├── NG-decomposition-PAA.pdf ## │ │ ├── PAA_pres.pdf ## │ │ ├── PAA_pres.pptx ## │ │ ├── UniversityofPennsylvania_FullLogo_RGB.eps ## │ │ ├── UniversityofPennsylvania_FullLogo_RGB.svg ## │ │ ├── UniversityofPennsylvania_FullLogo_RGB_blue_text.svg ## │ │ ├── decompTest.xls ## │ │ ├── illustration.pdf ## │ │ ├── illustration.xlsx ## │ │ ├── manuscript_Nov_10.docx ## │ │ ├── paglino_Grouwise_PAA_2024.pdf ## │ │ └── paglino_Grouwise_PAA_2024.pptx ## │ ├── revision ## │ │ ├── 6911.pdf ## │ │ ├── 6911_Reviewer A comments.pdf ## │ │ ├── response.docx ## │ │ ├── revised_manuscript.docx ## │ │ └── revised_manuscript_track_changes.docx ## │ ├── submitted_DR ## │ │ ├── manuscript.docx ## │ │ └── title_page.docx ## │ └── ~$template3_42x84.pptx ## ├── groupwise-decomposition.Rproj ## ├── groupwise-decomposition.docx ## ├── groupwise-decomposition.pdf ## └── outputs ## ├── data ## │ ├── 01_mort_data_clean.csv ## │ ├── 13_group_specific_res.RData ## │ └── 14_group_and_age_specific_res.RData ## ├── figures ## │ ├── 11_comparison_plot.svg ## │ ├── 11_contributions_plots.svg ## │ ├── 11_decomp_methods_comparison_no_stepwise_plot.svg ## │ ├── 11_decomp_methods_comparison_plot.svg ## │ ├── 12_contributions_by_age.svg ## │ ├── 12_horiuchi_contribs_by_age.svg ## │ └── 21_le_and_pop_plot.svg ## └── tables ## └── 11_contributions_table.docx