DOI: 10.3886/e228942v1
title: Data and Code Repository: Nowcasting Distributional National Accounts for the United States

description: Inequality statistics are usually calculated from high-quality, comprehensive survey or administrative microdata. Naturally, this data is typically available with a lag of at least 9 months from the reference period. In turbulent times, there is interest in knowing the distributional impacts of observable aggregate business cycle and policy changes sooner. In this paper, we use an elastic net, a generalized model that incorporates lasso and ridge regressions as special cases, to nowcast the overall Gini coefficient and quintile-level income shares. We use national accounts data starting in 2000, published by the Bureau of Economic Analysis, as features instead of the underlying microdata to produce a series of distributional nowcasts for 2020-2023. We find that we can create advance inequality estimates approximately one month after the end of the calendar year, reducing the present lag by almost a year.<br><br>Replication code for "Nowcasting Distributional National Accounts for the United States: A Machine Learning Approach”Dr. Marina Gindelsky (corresponding author)marina.gindelsky@bea.govDr. Gary Cornwallgary.cornwall@bea.govThe views expressed in this paper are those of the authors and do not necessarily represent the U.S. Bureau of Economic Analysis or the U.S. Department of Commerce.All analysis completed in R version 4.3.2All analysis completed using NIPA Vintage October 2024All analysis completed using distributional accounts vintage December 2024This replication package is based on inputs which have been rounded, consistent with BEA publication criteria. Accordingly, while the code will produce results consistent with the tables and figures in the published version, the results will not be exactly the same. In particular, for improvements in RMSE between the elastic net and VAR models it is important to note that rounding changes the structure of errors between observed and predicted. These changes are magnified through the square term meaning that the replication table, based on three digit reporting, may contain some elements that are quite different from the table in the paper which is based on a higher level of precision. For example, going from an RMSE of 0.04 to 0.03 is a 25% improvement while going from 0.04 to 0.02 (due to rounding) is a 50% improvement. However, researchers seeking to apply this method can use the code as a foundation from which to build.In order to replicate paper results, researchers should proceed as follows:Clone the repository to personal spaceRun results.R. This will produce dataframes containing the main specification predictions.Run var_models.R This will produce the autoregressive estimates that are directly compared to the main specification in Table 1.Run table.R This will print Table 1.Run figures.R This will generate six individual figures for the Gini and quintiles.For those who wish to use another statistical language, the data is located in an excel replication_data.xlsx and can be loaded directly into an alternative program for further analysis.<br><br>SEE GITHUB HERE: https://github.com/mgindelsky/Cornwall_Gindelsky_2025<br><br>
description: Response Rates: N/A
description: N/A
description: U.S. Households. Smallest Geographic Unit: National level
description: other;