This repository contains the code for the paper titled, Age at first birth, completed fertility, and literacy skills in sub-Saharan Africa.
# DHS Fertility Cohort Analysis
This repository contains R code used to process DHS Birth Recode (BR) files for a cohort-based analysis of age at first birth and Individual (women's) Recode (IR) completed fertility across sub-Saharan African countries. It also contains the codes in the paper titled "Age at first birth, completed fertility and literacy skills in sub-Saharan Africa", in Revue Quetelet (doi link:
doi.org), including codes for Figures and tables.
## Files
- `Age at First Birth by cohort and educational attainment yos.R`: Extracts and harmonises DHS BR files and calculates weighted cohort-level means by education, literacy, years of schooling and survey year.
- `Age at First Birth by cohort and educational attainment.R`: Extracts and harmonises DHS BR files and calculates weighted cohort-level means by education, literacy, and survey year.
- `Children ever born by cohort and literacy and yos.R`: Extracts and harmonises DHS IR files and calculates weighted cohort-level means by education, literacy, years of schooling and survey year.
- `Children ever born by cohort and literacy.R`: Extracts and harmonises DHS IR files and calculates weighted cohort-level means by education, literacy, and survey year.
- `Plots for postponement paper.R`: Fits generalised additive models (GAMs) using `mgcv` and all other plots and figures in the manuscript.
## Data
Due to DHS licensing terms, datasets are **not included**. You can request access at
dhsprogram.com and download the BR and IR datasets.