Earnings and Education
This example displays the file size, row count, and column count of a CSV dataset on earnings and education from Stock and Watson (2007), using data from the March Current Population Surveys. It loads the data with d3.csv and renders the summary statistics as text in a large <pre> element. The code also includes commented alternatives using fetch with async/await and a nested promise chain to illustrate different parsing approaches.
AI-generated descriptionA program that loads and parses some CSV data: Earnings and Education.
Stock and Watson (2007) provide several subsets created from March Current Population Surveys (CPS) with data on the relationship of earnings and education over several year.
References:
Stock, J.H. and Watson, M.W. (2007). Introduction to Econometrics, 2nd ed. Boston: Addison Wesley.
Original data source: https://rdrr.io/cran/AER/man/CPSSW.html
Variables:
age: age in years.
gender: factor indicating gender.
earnings: average hourly earnings (sum of annual pretax wages, salaries, tips, and bonuses, divided by the number of hours worked annually).
education: number of years of education.