README file for codes and input data used in "A Bayesian model for the reconstruction of education- and age-specific fertility rates: An application to African and Latin American countries". The codes can be run on the open access software RStudio version RStudio 2022.02.1+461 "Prairie Trillium" Release (8aaa5d470dd82d615130dbf663ace5c7992d48e3, 2022-03-17) for Windows Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36 The Individual recode files from the Demographic and Health Surveys are publically available for downloads at https://dhsprogram.com/data/available-datasets.cfm Datasets are also available from the DHS after a free registration at https://dhsprogram.com/data/new-user-registration.cfm. The sample STATA codes used to derive DHS estimates after installing the STATA "tfr2" module by Schoumaker 2013 in Cleaned_DHS_Africa.xlsx and Cleaned_DHS_LA.xlsx are as follows: sysdir set PLUS "~\Stata\Stata16\ado\plus" *For all countries we do single year, single ages and 5 year interval and 5 year age groups use BRIR01FL.DTA tfr2, len(29) trend(1) cy by v106, sort: tfr2, len(20) trend(1) cy tfr2, len(30) trend(5) cy by v106, sort: tfr2, len(30) trend(5) cy *Values for education . or unknown were ignored as the sample sizes were very small tabexp, len(30) trend(1) ageg(1) cy rates by v106, sort: tabexp, len(30) trend(1) ageg(1) cy rates tabexp, len(30) trend(5) ageg(5) cy rates by v106, sort: tabexp, len(30) trend(5) ageg(5) cy rates Schoumaker, B. (2013). A Stata module for computing fertility rates and TFRs from birth histories: tfr2. Demographic research, 28, 1093-1144. We provide all codes and input materials used below: Input data sets ********************************************************************************************************************************************************************************************************************** 1. cc_y_edu_all_paper_models.csv This file contains UN-DHS consistent education-specific total fertility rates (ESTFR) in Yildiz et al. (2023). These datasets are used as benchmarks for ESTFR for African countries. 2. Cleaned_DHS_LA.xlsx This file contains DHS fertility estfr and easfr estimates from the "tfr2" module described in Schoumaker (2013) for Latin American countries. 3. Cleaned_DHS_Africa.xlsx We provide estfr and easfr "tfr2" estimates for African countries for easy comparisons with Bayesian estimates. 4. glm_predict_all.xlsx These are estimates from the glm model described in Equation (1) in the methods section of the main text. 5. UN_datasets3.xlsx These are UN age-specific fertility rates from WPP 2022 that are used as benchmark in Equation (2) of the main text. 6. WIC_datasets.xlsx This file provides the age- and education-specific population estimates for females from WIC. These are used to calculate the weights in Equation (3). Modelling codes ********************************************************************************************************************************************************************************************************************** All codes can run using the R-studio statistical software which is free to download. 1. Bayesian model Africa.R This file contains the R codes for the model described in Equations (2) to (6) and Equations (11) to (13). These codes pertain only to African countries. 2. Bayesian model Latin America.R This file contains the R codes for the model described in Equations (2) to (10). These codes pertain only to Latin American countries. 3. Glm code.R This file contains the Glm code which produces estimates that are used as initial inputs for the Bayesian estimation as described in Equation (1). Validation exercises ********************************************************************************************************************************************************************************************************************** 1. Validation EASFR Africa.R We provide a k-fold cross-validation exercise for the model described for Africa. We apply a 5, 10 and 15% fold cross-validation technique and compare estimates with the initial estimates from the glm model. 2. Validation EASFR Latin America.R Since the model specification for Latin American countries differs from African countries, we supply a different code for model validation code for Latin America's EASFRs. We perform the same k-fold validation exercise as for Africa. PDFs of validation exercises ********************************************************************************************************************************************************************************************************************** 1. Validation_easfr Africa.pdf This file contains graphs comparing the results of the validation exercise with the input values for African countries. 2. Validation_easfr Latin America.pdf This file contains graphs comparing the results of the validation exercise with the input values for Latin American countries.