Skip to main content
Public

Share visualization

Loading preview…

Fork of regression

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of regression

0
JjohnmurphyLC
Last edited May 28, 2023
Created on May 28, 2023

A scatter plot compares GDP to health expenditures across countries, with a regression line showing their correlation. A checkbox toggles a logarithmic scale for the x-axis, which compresses the skewed GDP distribution. Point radius encodes each country’s World Happiness Score. The chart uses D3 v3/v4 with `d3.svg.axis`, `d3.scale.linear`, and a custom least-squares function for the regression. Data comes from the World Happiness Report, loaded via `d3.csv`.

AI-generated description

A scatter plot of GDP vs Health Expenditures with a regression line with and without logscale.

The data is from the The World Happiness Report that uses survey data, demographic information and statistical analysis to rank 156 nations according to the happiness of their people.

<a href="https://www.kaggle.com/arielyeung/world-happiness-data"> Data Source </a>

<a href="https://gist.github.com/mkt-ds/640984c80835e2823c1b0f5c9a3fabe"> Gist File </a>

A country’s overall happiness score is a composite of different factors collected in an annual worldwide survey, including GDP per capita School years Sustainable economic development Employement Rate Health expenditure Government effectiveness Female MPS Control of corruption

What factors contributes to happiness for different countries is interesting. For example more school years increases happiness in certain countries, it's probably correlated with more salaries when a person studies more. I need to create another visual to show the relationship between each factors for each country.

Comments

Sign in to join the discussion.

MIT Licensed