Replication code for household financial asset diversification and the energy transition in China (CGSS and CHARLS)
Description
This dataset contains the Python code used to reproduce the quantitative results reported in the manuscript 'Household financial asset diversification and the energy transition in China: Cross-sectional and longitudinal evidence from the CGSS and CHARLS'. Contents: replication_code.zip (seven numbered scripts, expected_output/ with reference log output, requirements.txt, README.md) and a standalone README.md. The code covers the cross-sectional CGSS 2015 models (Tables 2-4), the instrumental-variable and propensity-score checks (Tables 5-9 and Appendix A.11), and the three-wave CHARLS 2013/2015/2018 household fixed-effects models with the Mundlak decomposition (Section 5 and Appendix B), together with the construction of the fuel-type, financial-asset and wealth variables. CGSS and CHARLS are third-party datasets and are not redistributed here; README.md states where to obtain them, which variables are used, and what each script should print. Scripts were run with Python 3.12.11, pandas 2.2.3, NumPy 1.26.4, linearmodels 7.1 and statsmodels 0.15.0.
Files
Steps to reproduce
1) pip install -r requirements.txt 2) run scripts 01 to 07 in order with Python 3.12 3) compare console output against expected_output/ CGSS and CHARLS source files are not redistributed; see README.md for download locations and variable lists.