CoolFace
Datasetpublic

lihicarmeli/lihi_caremeli.life_expectancy_who_eda

Life Expectancy (WHO) — EDA Assignment https://cdn-uploads.huggingface.co/production/uploads/69d9149c90277a9a700c29a3/dPb7Y-8k1u5S7qZMtBkeT.mp4 Overview This project presents an Exploratory Data Analysis (EDA) of the Life Expectancy (WHO) dataset from Kaggle.The dataset combines health statistics collected by the World Health Organization (WHO) through the Global Health Observatory (GHO) with economic and demographic data from the United Nations.… See the full description on the dataset page: https://huggingface.co/datasets/lihicarmeli/lihi_caremeli.life_expectancy_who_eda.

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes10downloads
Dataset Card

Life Expectancy (WHO) — EDA Assignment

https://cdn-uploads.huggingface.co/production/uploads/69d9149c90277a9a700c29a3/dPb7Y-8k1u5S7qZMtBkeT.mp4 <video controls src="https://cdn-uploads.huggingface.co/production/uploads/69d9149c90277a9a700c29a3/dPb7Y-8k1u5S7qZMtBkeT.mp4" width="100%"></video> ---

Overview

This project presents an Exploratory Data Analysis (EDA) of the Life Expectancy (WHO) dataset from Kaggle. The dataset combines health statistics collected by the World Health Organization (WHO) through the Global Health Observatory (GHO) with economic and demographic data from the United Nations.

The target variable is Life expectancy, a continuous numerical feature representing the average age at death. Accordingly, the research problem is framed as a regression task.


Dataset Summary

  • —Dataset: Life Expectancy (WHO) — Kaggle
  • —Rows: 2,938
  • —Columns: 22
  • —Countries: 193
  • —Years Covered: 2000–2015

Feature Groups

  • —Health indicators — mortality rates, immunization coverage, disease prevalence
  • —Socio-economic indicators — GDP, schooling, income composition
  • —Demographic indicators — population, development status (Developed / Developing)

Central Research Question

Which factors — health, economic, demographic, or social — have the strongest impact on life expectancy, and can they be used to build a regression model that accurately predicts life expectancy in a given country?


Data Cleaning and Missing Values

The dataset contained no duplicate rows. However, several key variables, including Population, Hepatitis B, and GDP, had hundreds of missing values.

Dropping rows would have caused substantial data loss, so median imputation was applied to all numerical columns. The median was preferred over the mean because it is more robust to outliers and prevents extreme values from disproportionately influencing the dataset.

Screenshot 2026-04-12 113043

Screenshot 2026-04-12 113632


Exploratory Data Analysis

Distribution of Life Expectancy

The distribution of life expectancy is left-skewed. Most countries cluster around 70–75 years, while a smaller group of countries with very low life expectancy pulls the global average downward.

The scatter matrix also suggests a clear separation between developed and developing countries: developed countries form a tight cluster at high life expectancy values, whereas developing countries are much more dispersed across lower ranges.

Screenshot 2026-04-12 114810

Screenshot 2026-04-12 114008


Top and Bottom 10 Countries

A gap of more than 30 years separates the highest- and lowest-performing countries.

Countries such as Japan, Sweden, and Switzerland consistently exceed 80 years, while countries such as Sierra Leone and Nigeria struggle to surpass 50 years. This highlights a dramatic global inequality in survival outcomes.

Screenshot 2026-04-12 114542


Global Choropleth Map

Life expectancy is strongly clustered geographically rather than randomly distributed.

  • —Western Europe and North America appear at the top end of the scale, approaching 80 years
  • —Much of Africa forms a lower-life-expectancy band, often around 50–60 years

This suggests that geography acts as a macro-level indicator of broader development conditions.

https://cdn-uploads.huggingface.co/production/uploads/69d9149c90277a9a700c29a3/WG0ZhfCYIVl_lVdlxNQVq.mp4

<video controls autoplay loop src="https://cdn-uploads.huggingface.co/production/uploads/69d9149c90277a9a700c29a3/WG0ZhfCYIVl_lVdlxNQVq.mp4"></video> ---

Wealth vs. Life Expectancy (GDP)

The scatter plot between GDP and life expectancy demonstrates diminishing marginal returns.

For low-income countries, even modest gains in GDP are associated with large improvements in life expectancy. However, among wealthy countries, the relationship flattens and life expectancy tends to plateau around 80 years.

Screenshot 2026-04-12 114857


Correlation Heatmap

The correlation matrix shows that the strongest positive relationships with life expectancy are largely socio-economic, especially:

  • —Schooling
  • —Income composition of resources

The strongest negative relationships are:

  • —Adult Mortality
  • —HIV/AIDS prevalence

This suggests that life expectancy is shaped not only by direct health interventions, but by broader structural and social conditions.

Screenshot 2026-04-12 114936


Outlier Treatment and Transformations

To improve data quality without removing observations, IQR capping was applied to variables such as GDP and Adult Mortality. This reduced the impact of extreme values while retaining 100% of the dataset.

In addition:

  • —GDP and Population were log-transformed using np.log1p to reduce right skew
  • —All input features were standardized using StandardScaler
  • —The target variable (Life Expectancy) was intentionally not scaled, to preserve interpretability in real years

Screenshot 2026-04-12 115151


Dimensionality Reduction — PCA

Because the dataset included overlapping variables and multicollinearity, Principal Component Analysis (PCA) was applied.

PCA reduced 20 features to 12 principal components while preserving 95% of the original variance, producing a more compact and less redundant representation of the data for future modeling.

Screenshot 2026-04-12 115242


Bivariate and Multivariate Analysis

  • —A regression plot showed a strong positive relationship between income composition and life expectancy
  • —A hexbin density plot highlighted a dense cluster of countries with low adult mortality and high life expectancy
  • —A 3D scatter plot indicated that the highest life expectancy levels are associated with a combination of both high GDP and strong educational development

These results suggest that no single variable fully explains longevity; instead, life expectancy emerges from the interaction of multiple structural factors.

Screenshot 2026-04-12 115322

Screenshot 2026-04-12 115410

Screenshot 2026-04-12 115503


Research Questions and Answers

Q1. How does development status impact life expectancy?

Developed countries show a consistently high median life expectancy of roughly 80 years with relatively little variation. Developing countries cluster closer to 69 years and show much wider dispersion, reflecting greater instability in health and living conditions.

Screenshot 2026-04-12 115535


Q2. Is there an improving trend in global life expectancy over time?

Yes. The data shows a clear upward trend, from approximately 67 years in 2000 to around 71.5 years in 2015, indicating broad global improvement in healthcare, sanitation, and living standards.

Screenshot 2026-04-12 115545


Q3. What is the relationship between Polio immunization and life expectancy?

Countries with near-universal immunization coverage tend to achieve the highest life expectancy levels. Countries with low coverage often fall below 60 years. However, some wealthy countries maintain high life expectancy despite lower immunization rates, suggesting that wealth can partially offset weaknesses in individual indicators.

Screenshot 2026-04-12 115553


Q4. Is there a correlation between alcohol consumption and life expectancy?

Yes, but the relationship is likely spurious. Countries with higher alcohol consumption also tend to be wealthier and more developed. The true explanatory factor is more likely to be national wealth and development, not alcohol consumption itself.

Screenshot 2026-04-12 115600


Key Decisions

DecisionReason
Median imputation for missing valuesRobust to outliers and preserves all 2,938 rows
IQR capping for outliersReduces anomaly bias without deleting data
Log transformation on GDP and PopulationBoth variables were strongly right-skewed
StandardScaler on featuresPrevents large-scale variables from dominating
Excluding target from scalingKeeps predictions interpretable in years
PCA to 12 componentsRetains 95% variance and reduces multicollinearity

Final Conclusions

The findings suggest that high life expectancy is not driven by medical care alone. Instead, it reflects a broader socio-economic ecosystem.

The strongest drivers of longevity appear to be the interaction between:

  • —economic development
  • —education
  • —lower adult mortality
  • —better public health conditions

Therefore, policies aimed at increasing life expectancy should not rely solely on isolated medical interventions. Sustainable gains are more likely when health, education, and economic infrastructure improve together.


Author

Lihi Caremeli Reichman University · 2026