Export Code
index.js
import { csv, select } from 'd3';
import { scatterPlot } from './scatterPlot.js';
import { barPlot } from './barPlot.js';
import { menu } from './menu.js';

const numPoints = 70;

const x = Array(numPoints)
.fill(0)
.map((d) => Math.floor(Math.random() * 20));

const y = Array(numPoints)
.fill(0)
.map((d) => Math.floor(Math.random() * 20));

const dataset = x.map((d, i) => [d, y[i]]);

const width = window.innerWidth;
const height = window.innerHeight;

const margin = { top: 30, right: 30, bottom: 40, left: 70 };

const dataLink = [
'https://raw.githubusercontent.com/',
'rfordatascience/tidytuesday/',
'master/data/',
'2021/2021-02-09/',
'race_wealth.csv',
].join('');

const parseRow = (d) => {
d.wealth_family = +d.wealth_family;
d.year = +d.year;
return d;
};

Analysis using scatterplots

Kaustav Sen

Last edited Jun 20, 2021
Created on Jun 20, 2021
Forked from HTML Starter

Exploring median family wealth in the US (1983-2016)

Data

  • The data originally comes from the Urban Institue & US Census. This was collated into .csv files as part of the #TidyTuesday project.

  • The above chart explores the median family wealth of US households over the period 1983-2016 split by race.

  • The figures have been normalized to 2016 rates so as to make them comparable and not be affected by inflation.

Observations

  • The median White family wealth is almost 8x of that of Black and Hispanic families. Thus, there is a significant disparity in the ditribution of wealth and this has not improved over the years.

  • From 2007 to 2010, there was a sharp fall in the median family wealth which was most pronounced for White families. This seems to be driven by the 2007-08 housing market crash and the subsequent recession.

  • Historically, the median family wealth of Black housholds has been higher than that of Hispanic households. However, over the last ten years, this trend seems to be reversing.

MIT Licensed