Public
Edited
Nov 28, 2024
Insert cell
Insert cell
Plot.dot(data, { x: "actual", y: "estimate", fill: true }).plot({
x: { percent: true, label: "Actual income bracket (%)" },
y: { percent: true, label: "Estimated income bracket (%)" },
marks: [Plot.ruleX([0, 1]), Plot.ruleY([0, 1])],
caption:
"U.S. adults (N = 4,890) consistently underestimated how good their actual income was relative to the rest of the world."
})
Insert cell
data = [
{ income: "≤$20k", value: 14000, estimate: 0.26, actual: 1 - 0.4848 },
{ income: "$20k–49k", value: 34500, estimate: 0.34, actual: 1 - 0.232 },
{ income: "$50k–79k", value: 65000, estimate: 0.43, actual: 1 - 0.131 },
{ income: "$80k–99k", value: 90000, estimate: 0.49, actual: 1 - 0.087 },
{ income: "$100k–150k", value: 125000, estimate: 0.53, actual: 1 - 0.05 },
{ income: "≥$150k", value: 200000, estimate: 0.62, actual: 1 - 0.019 }
]
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more