Heart Disease Indicators (CDC 2022)
Which habits and health conditions go with having had a heart attack?
- Rows
- 445,132
- Columns
- 40
- Year
- 2022
- Format
- CSV in a zip
The data
Every year the US Centers for Disease Control (CDC) phones hundreds of thousands of adults and asks about their health: the BRFSS survey. This dataset is the 2022 survey, prepared as one table: one row per person, 40 questions.
It covers age, sex and state, habits (smoking, e-cigarettes, alcohol, physical activity, sleep), body measures (height, weight, BMI), and many conditions: heart attack, stroke, diabetes, asthma, depression, kidney disease…
No medical background is needed: almost every column is a simple answer like Yes, No or Former smoker.
Download
Dataset (Kaggle) ↗About the BRFSS survey (CDC) ↗
About the format
- The zip has three files. Use
2022/heart_2022_with_nans.csv, the version with missing values. Cleaning them is part of the project. - Don't use
heart_2022_no_nans.csv(someone already deleted the rows with gaps) or the2020file (older and different columns).
heart = pd.read_csv("2022/heart_2022_with_nans.csv")
heart["HadHeartAttack"].value_counts(dropna=False)
Main columns
| Column | What it holds |
|---|---|
State, Sex, AgeCategory | Who and where (age in 5-year groups) |
HadHeartAttack | The main column: ever had a heart attack (Yes / No) |
SmokerStatus, ECigaretteUsage, AlcoholDrinkers | Habits |
PhysicalActivities, SleepHours | Activity in the past month, sleep per night |
HeightInMeters, WeightInKilograms, BMI | Body measures |
HadStroke, HadDiabetes, HadAngina, HadCOPD… | Other conditions |
GeneralHealth, PhysicalHealthDays, MentalHealthDays | How people rate their own health |
Watch out for
These are hints, not instructions. Check each one in the data, decide what to do, and explain your choice in the notebook.
- Missing values everywhere, from under 1% to almost 20% depending on the question. Which ones can you fill honestly, and which should stay missing?
- BMI is missing for ~11% of the people, but some of them have a height and a weight…
- Values that are hard to believe: 24 hours of sleep, a BMI near 100.
- Long answer texts ("Current smoker - now smokes some days") need shorter labels before they fit on a chart.
HadDiabeteshas four answers, two of them "half yes".- ⚠️ Age hides everything. Smokers, drinkers and inactive people have different ages. Compare groups inside the same age band.
- A survey shows links, not causes. Some links may run backwards (people change habits after getting ill).
Questions to explore
Age and sex
- How does the heart-attack rate change with age? Is it different for men and women?
Habits
- Do smokers have more heart attacks than people who never smoked, at the same age? What about former smokers?
- Physical activity, alcohol, e-cigarettes: what do you see, and can you believe it?
Body and sleep
- Does BMI matter?
- Is there a "right" amount of sleep?
Other conditions
- Which conditions go together with heart attacks? What happens when people have several?
Places
- Which US states have the highest rates?
Ideas for the app
- A risk explorer: pick age band, sex and habits, see the heart-attack rate of people like that.
- A habits page where every comparison is split by age band.
- A map of the states.