🧑🔬 Capstone Mini Project - NHANES 2020 Body Measurement Analysis
A data-driven exploration of adult body metrics from the National Health and Nutrition Examination Survey (NHANES) 2020.
📊 Project Overview
This project analyses body measurements of US adults from the NHANES 2020 survey, with a particular focus on comparing males and females across several body composition metrics:
- BMI (Body Mass Index)
- Waist-to-Height Ratio (WHtR)
- Waist-to-Hip Ratio (WHR)
Utilizes powerful Python tools: NumPy, SciPy, Matplotlib, Seaborn, and Pandas.
🗂️ Dataset
- Source: gagolews/teaching-data (NHANES Adult BMX 2020)
- Files:
nhanes_adult_male_bmx_2020.csvnhanes_adult_female_bmx_2020.csv
- Columns:
Weight | Height | Upper Arm/Leg Length | Arm/Hip/Waist Circumference
ℹ️ Data loaded directly from GitHub with
np.genfromtxt. Rows with missing values are dropped before analysis.
🧩 Project Structure
Capstone_mini_project.ipynb # Main Jupyter analysis
README.md # This file
🧠 Analysis Workflow
| Section | Description |
|---|---|
| 1 | Importing libraries and loading data |
| 2 | Histogram comparison: male vs. female weight |
| 3 | Box-and-whisker: weights by sex |
| 4 | Descriptive statistics & distribution shape |
| 5 | Computing BMI |
| 6 | Z-score standardization (female dataset) |
| 7 | Pairplot matrix + correlation analysis (Pearson/Spearman) |
| 8 | Calculating WHtR and WHR |
| 9 | Boxplots: WHtR & WHR by sex |
| 10 | Pros & cons of BMI, WHtR, WHR |
| 11 | Extreme BMI participants (lowest/highest 5) |
✨ Key Findings (click to expand)
- Males were heavier on average
Greater variability in weight compared to females. - Both distributions are right-skewed:
Most participants fall in lower weight ranges, with a tail of high values. - Weight and BMI are strongly correlated:
- Correlation coefficient ~0.9+ (Pearson).
- Males had substantially higher WHR:
- Consistent with abdominal fat distribution patterns.
- Height weakly correlated with waist/hip circumference:
- Height alone is a poor predictor of body composition here.
- Highest BMI individuals:
- Above average on all circumference measures; average or below for height.
⚙️ Tech Stack
- Python 3.7+
- NumPy — numerical computing
- Matplotlib — data visualization
- SciPy — stats/correlation/skewness/kurtosis
- Seaborn — advanced pairplots
- Pandas — used for DataFrame creation
How to start
- Clone this repo:
git clone https://github.com/tomato9553-bit/Capstone-project.git cd Capstone-project - Install dependencies:
pip install numpy matplotlib scipy seaborn pandas
- Open the Jupyter notebook:
jupyter notebook Capstone_mini_project.ipynb
💡 Requires an active internet connection to fetch the dataset.
⚠️ Limitations
- Missing rows are dropped (not imputed)
- Dataset limited to US adults (2020) — results may not generalize
- Measurement variability (waist/hip ratios) may affect reliability
⏳ Timeline
- Initiated: 08-04-2026
- Completed: 15-04-2026
👤 Author
M. Gopal
Data Science Enthusiast
✅ Project Checklist
- Data import/validation
- Exploratory analysis
- Metrics calculation (BMI, WHtR, WHR)
- Visualization & stats
- Summarize findings
- Write-up complete
Have questions or suggestions? Open an issue or pull request!