Wealth Functions

Wealth Functions

wealth.py modules

ogcore.wealth

ogcore.wealth.compute_wealth_moments(scf, bin_weights)[source]

This function computes moments (wealth shares, Gini coefficient, var[ln(wealth)]) from the distribution of wealth using SCF data.

Parameters
  • scf (Pandas DataFrame) – pooled cross-sectional data from SCFs

  • bin_weights (Numpy Array) –

  • J (int) –

Returns

array of wealth moments

Return type

wealth_moments (Numpy Array)

ogcore.wealth.get_wealth_data(scf_yrs_list=[2019, 2016, 2013, 2010, 2007], web=True, directory=None)[source]

Reads wealth data from the 2007, 2010, 2013, 2016, and 2019 Survey of Consumer Finances (SCF) files.

Parameters
  • scf_yrs_list (list) – list of SCF years to import. Currently the largest set of years that will work is [2019, 2016, 2013, 2010, 2007]

  • web (Boolean) – =True if function retrieves data from internet

  • directory (string or None) – local directory location if data are stored on local drive, not use internet (web=False)

Returns

pooled cross-sectional data from SCFs

Return type

df_scf (Pandas DataFrame)