RDP 2025-08: Ageing and Economic Growth in China Read me file
November 2025
This ‘read me’ file contains details of the code and data used in the RDP 2025-08.
Data
All data used in the model originate from China's National Bureau of Statistics (NBS). NBS provincial GDP sectoral data, GDP per capita data and data on migration and life expectancy were sourced via the CEIC data platform. Data for the 1990, 2000 and 2010 censuses were sourced directly from the relevant NBS census tabulations on the NBS website. As discussed in the paper, the 1982 Census – the first of China's ‘reform and opening’ period – does not provide this tabulation publicly, so I estimate provincial population by age for 1982 using the IPUMS International 1 per cent microdata sample for the 1982 Census. The 1982 data files included in the ‘data’ folder are a transformation of this data.
Due to copyright reasons, I cannot provide the underlying raw data sourced from NBS or CEIC. I have provided the input excel files with the data redacted to show the structure of the data. For more information about how to collect the relevant data, please contact the author.
The graph data used to plot Figures 1, 2, 8, 9 and 10 are available to the public and can be found in ‘rdp-2025-08-graph-data.xlsx’.
Code
I use R version 4.4.0 and StataMP 18 to run the code. Begin with the file ‘main.R’ which generates Figures 3–7, 11–12 and A1–A5 in the paper and cleans data for the regressions. The file points to all dependencies. This version of the code generates graphs in ggplot rather than in the RBA format. Make sure to open ‘main.R’ using UTF-8 encoding, as Chinese characters are used in the file.
After running ‘main.R’, run ‘regressions.do’ in Stata. Set the appropriate file path to point to the output folder of ‘main.R’. This file runs the regressions described in the paper.
In order to estimate the Rotemberg weights, the Stata file relies on the package provided with Goldsmith-Pinkham, Sorkin and Swift (2020) available on Github at <https://github.com/paulgp/bartik-weight>. To install the Stata package, copy the files ‘bartik_weight.ado’ and ‘bartik_weight.sthlp’ to your personal Stata ado folder.
The code files will not produce any output as the copyrighted third-party data underlying the model are redacted but are provided to help you understand the methodology.
Reference
Goldsmith-Pinkham P, I Sorkin and H Swift (2020), ‘Bartik Instruments: What, When, Why, and How’, The American Economic Review, 110(8), pp 2586–2624.
12 November 2025
- Supplementary information Download 538KB