This zip file contains R script for calculating decomposition of changes in completed cohort fertility rates into the effect of parity progression ratios for paper: "Cohort fertility decline in low fertility countries: decomposition using parity progression ratios" by Krystof Zeman, Eva Beaujouan, Zuzanna Brzozowska and Tomas Sobotka (Wittgenstein Centre for Demography and Global Human Capital (IIASA, VID/ÖAW, WU), Vienna Institute of Demography/Austrian Academy of Sciences, November 2017) published in Demographic Research All data files are located in the zipped folder "data". Most of the data come from the CFE database at: http://www.cfe-database.org/ some data are reconstructed from Human Fertility Database data (see Supplement table S1 for details). The script should work also for other data from CFE database, not included in the paper. The file "countries.csv" contains some metainformation on the data. The 8 regions used for the paper are as: #1=Eastern Europe #2=Central Europe #3=Western Europe #4=Northern Europe #5=German-speaking #6=Southern Europe #7=English-speaking non-European #8=East Asia The R code replicates calculation of data used in the paper, especially Figure 1, 4, 5, 6 and Table 2 and Supplement tables S1 and S2. (Please note that some indicators for East Asia may differ, as in the article, Japan was excluded from the calculations of regional means for the first stage 1940-1955).