STI731 - Task 7D Exploring Health Determinants in the United States: A Comprehensive Analysis of NHANES Data¶
Student Number: Thi Thu Suong Ngo
Email: s224757434@deakin.edu.au
Unit: SIT731 Data Wrangling (Postgraduate Student)
Introduction¶
The report is a detailed exploratory data analysis of the National Health and Nutrition Examination Survey (NHANES) data of the 2017-2020 pre-pandemic cycle. NHANES is a study program aimed at determining the health and nutritional condition of adults and children in the United States that incorporates interviews, physical examinations and laboratory tests. The first thing that made me interested in this dataset was that the outcomes of the socioeconomic factors and health outcome might be complicated at a population level.
This analysis incorporates five different datasets, which are demographics, body measurements, blood pressure, diabetes indicators, and smoking behaviour. I explore the correlation between lifestyle variables (e.g., smoking status) and the most important health outcomes (e.g., body mass index, blood pressure, and risk of diabetes) by means of interactive visualisations designed with the help of the Bokeh library. The rigorous methodology and nationally representative sampling design have been one of the most appealing aspects to me about NHANES and gives credence to the trends noted.
The results indicate that there are considerable positive relationships between socioeconomic status, lifestyle habits, and health outcomes. Nevertheless, in my opinion, these correlations should be viewed with skepticism because cross-sectional information cannot be used to prove causality. Another aspect that is covered in this report is the proper considerations in the privacy of data and the ethical usage of sensitive health information, which I believe is becoming more and more topical due to the increased access to health datasets to use in research.
1. Environment Setup and Library Imports¶
The first thing to do before commencing my analysis is to import Python-related libraries. I work with pandas to manipulate data and numerical operations with numpy, and also with the creation of interactive visualisation with bokeh. The choice of using Bokeh over fixed plotting libraries such as matplotlib was not accidental, since I also intended on allowing users to interact with the data, and not to show them set views. The data files of the NHANES are in the SAS Transport format (.XPT) and are readable in pandas by using its partnership with the SAS7BDAT reader.
2. Data Acquisition and Loading¶
I select five sets of data of the NHANES 2017-March 2020 Pre-Pandemic cycle. This cycle has been chosen because it gives the latest overall information prior to the COVID-19 pandemic disrupting the data collection process. I find this time especially significant, pandemic-era data would probably indicate abnormal health behaviour as well as access to care that may confound the relationships I am studying. The datasets I selected are:
Demographics (P_DEMO) - This has demographic data such as age, gender, race/ethnicity, education, and income. This is the basis of gaining knowledge about the health disparities within groups of the population.
Body Measures (P_BMX) - Includes body measures, such as height, weight and BMI. I consider anthropometric data particularly useful because it is objective producing measurements as opposed to self-reported measurements.
Blood Pressure (P_BPX) - This holds blood pressure and pulse. The oscillometric measurement protocol of the NHANES provides consistency and minimizes bias of the observer.
Diabetes (P_DIQ) - Contains the history and related information about diabetes. This will enable me to look into one of the largest chronic disease burdens in the United States.
Smoking - Cigarette Use (P_SMQ) - Includes the data on the history of smoking cigarettes and smoking at present. Smoking is a major modifiable risk factor that leads to various chronic ones.
These data sets were specifically selected so that they could be used to explore the relationship between socioeconomic variables, lifestyle behaviours and health indicators of interest. I observe that this choice is just a part of the NHANES data ecosystem and that subsequent analyses can include other sources of data like dietary consumption or physical activity.
Loading NHANES datasets from CDC... -------------------------------------------------- Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_DEMO.xpt Downloaded 3,614,720 bytes Demographics: 15,560 records, 29 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_BMX.xpt Downloaded 3,614,720 bytes Demographics: 15,560 records, 29 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_BMX.xpt Downloaded 2,520,640 bytes Body Measures: 14,300 records, 22 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_BPXO.xpt Downloaded 2,520,640 bytes Body Measures: 14,300 records, 22 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_BPXO.xpt Downloaded 1,039,840 bytes Blood Pressure: 11,656 records, 12 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_DIQ.xpt Downloaded 1,039,840 bytes Blood Pressure: 11,656 records, 12 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_DIQ.xpt Downloaded 3,361,520 bytes Diabetes: 14,986 records, 28 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_SMQ.xpt Downloaded 3,361,520 bytes Diabetes: 14,986 records, 28 variables Downloading from: https://wwwn.cdc.gov/Nchs/Data/Nhanes/Public/2017/DataFiles/P_SMQ.xpt Downloaded 1,428,560 bytes Smoking: 11,137 records, 16 variables -------------------------------------------------- All datasets loaded successfully! Downloaded 1,428,560 bytes Smoking: 11,137 records, 16 variables -------------------------------------------------- All datasets loaded successfully!
====================================================================== DATASET STRUCTURE PREVIEW ====================================================================== 1. DEMOGRAPHICS (P_DEMO) -------------------------------------------------- Shape: 15,560 rows × 29 columns Columns: ['SEQN', 'SDDSRVYR', 'RIDSTATR', 'RIAGENDR', 'RIDAGEYR', 'RIDAGEMN', 'RIDRETH1', 'RIDRETH3', 'RIDEXMON', 'DMDBORN4']...
| SEQN | SDDSRVYR | RIDSTATR | RIAGENDR | RIDAGEYR | RIDAGEMN | RIDRETH1 | RIDRETH3 | RIDEXMON | DMDBORN4 | ... | FIAINTRP | MIALANG | MIAPROXY | MIAINTRP | AIALANGA | WTINTPRP | WTMECPRP | SDMVPSU | SDMVSTRA | INDFMPIR | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 109263.0 | 66.0 | 2.0 | 1.0 | 2.0 | NaN | 5.0 | 6.0 | 2.0 | 1.0 | ... | 2.0 | NaN | NaN | NaN | NaN | 7891.762435 | 8951.815567 | 3.0 | 156.0 | 4.66 |
| 1 | 109264.0 | 66.0 | 2.0 | 2.0 | 13.0 | NaN | 1.0 | 1.0 | 2.0 | 1.0 | ... | 2.0 | 1.0 | 2.0 | 2.0 | 1.0 | 11689.747264 | 12271.157043 | 1.0 | 155.0 | 0.83 |
| 2 | 109265.0 | 66.0 | 2.0 | 1.0 | 2.0 | NaN | 3.0 | 3.0 | 2.0 | 1.0 | ... | 2.0 | NaN | NaN | NaN | NaN | 16273.825939 | 16658.764203 | 1.0 | 157.0 | 3.06 |
3 rows × 29 columns
2. BODY MEASURES (P_BMX) -------------------------------------------------- Shape: 14,300 rows × 22 columns Columns: ['SEQN', 'BMDSTATS', 'BMXWT', 'BMIWT', 'BMXRECUM', 'BMIRECUM', 'BMXHEAD', 'BMIHEAD', 'BMXHT', 'BMIHT']...
| SEQN | BMDSTATS | BMXWT | BMIWT | BMXRECUM | BMIRECUM | BMXHEAD | BMIHEAD | BMXHT | BMIHT | ... | BMXLEG | BMILEG | BMXARML | BMIARML | BMXARMC | BMIARMC | BMXWAIST | BMIWAIST | BMXHIP | BMIHIP | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 109263.0 | 4.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 1 | 109264.0 | 1.0 | 42.2 | NaN | NaN | NaN | NaN | NaN | 154.7 | NaN | ... | 36.3 | NaN | 33.8 | NaN | 22.7 | NaN | 63.8 | NaN | 85.0 | NaN |
| 2 | 109265.0 | 1.0 | 12.0 | NaN | 91.6 | NaN | NaN | NaN | 89.3 | NaN | ... | NaN | NaN | 18.6 | NaN | 14.8 | NaN | 41.2 | NaN | NaN | NaN |
3 rows × 22 columns
3. BLOOD PRESSURE (P_BPXO) -------------------------------------------------- Shape: 11,656 rows × 12 columns Columns: ['SEQN', 'BPAOARM', 'BPAOCSZ', 'BPXOSY1', 'BPXODI1', 'BPXOSY2', 'BPXODI2', 'BPXOSY3', 'BPXODI3', 'BPXOPLS1', 'BPXOPLS2', 'BPXOPLS3']
| SEQN | BPAOARM | BPAOCSZ | BPXOSY1 | BPXODI1 | BPXOSY2 | BPXODI2 | BPXOSY3 | BPXODI3 | BPXOPLS1 | BPXOPLS2 | BPXOPLS3 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 109264.0 | b'R' | 3.0 | 109.0 | 67.0 | 109.0 | 68.0 | 106.0 | 66.0 | 94.0 | 95.0 | 91.0 |
| 1 | 109266.0 | b'R' | 4.0 | 99.0 | 56.0 | 99.0 | 55.0 | 99.0 | 52.0 | 68.0 | 66.0 | 66.0 |
| 2 | 109270.0 | b'R' | 3.0 | 123.0 | 73.0 | 124.0 | 77.0 | 127.0 | 70.0 | 95.0 | 98.0 | 93.0 |
4. DIABETES (P_DIQ) -------------------------------------------------- Shape: 14,986 rows × 28 columns Columns: ['SEQN', 'DIQ010', 'DID040', 'DIQ160', 'DIQ180', 'DIQ050', 'DID060', 'DIQ060U', 'DIQ070', 'DIQ230']...
| SEQN | DIQ010 | DID040 | DIQ160 | DIQ180 | DIQ050 | DID060 | DIQ060U | DIQ070 | DIQ230 | ... | DIQ300D | DID310S | DID310D | DID320 | DID330 | DID341 | DID350 | DIQ350U | DIQ360 | DIQ080 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 109263.0 | 2.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 1 | 109264.0 | 2.0 | NaN | 2.0 | 2.0 | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2 | 109265.0 | 2.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
3 rows × 28 columns
5. SMOKING (P_SMQ) -------------------------------------------------- Shape: 11,137 rows × 16 columns Columns: ['SEQN', 'SMQ020', 'SMD030', 'SMQ040', 'SMQ050Q', 'SMQ050U', 'SMD057', 'SMQ078', 'SMD641', 'SMD650', 'SMD100FL', 'SMD100MN', 'SMQ670', 'SMQ621', 'SMD630', 'SMAQUEX2']
| SEQN | SMQ020 | SMD030 | SMQ040 | SMQ050Q | SMQ050U | SMD057 | SMQ078 | SMD641 | SMD650 | SMD100FL | SMD100MN | SMQ670 | SMQ621 | SMD630 | SMAQUEX2 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 109264.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1.0 | NaN | 2.0 |
| 1 | 109266.0 | 2.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1.0 |
| 2 | 109267.0 | 2.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1.0 |
====================================================================== SAVING DATASETS TO LOCAL CSV FILES... ====================================================================== ✓ All 5 datasets saved to local CSV files in the current folder! ✓ All 5 datasets saved to local CSV files in the current folder!
2.1 Data Merging¶
Each of the NHANES datasets has one common column known as SEQN (respondent sequence number), which enables me to combine the datasets together. I use a sequence of left joins of the demographics dataset so that I can have one data frame with all the variables. The usage of left joins on the demographics table is not random since I would like to keep all the demographic records in case of the missing health measurements. This method will recognize the fact that missing data in health surveys can have informational importance because some groups of people are less inclined to complete all the elements of examination.
Merged dataset dimensions: 15,560 records x 103 variables Memory usage: 12.69 MB
3. Data Exploration and Cleaning¶
I will need to learn about the format of the merged data and address data quality problems before going on with my analysis. This will involve analysis of types of variables, finding missing values, as well as creation of derived variables, which will be helpful in the visualisations. This exploration step is important to me because it usually uncovers unforeseen trends in the data that may be used to make decisions about the analysis further on.
3.1 Variable Selection and Renaming¶
I choose the most appropriate variables to analyze and rename them in a way that is more intuitive. The NHANES codebook contains abbreviated names of the variables which can be hard to comprehend without constant consultation of documentation. It is through the development of meaningful names that I will make the following analysis more readable and minimize chances of confusing the variables. This is one of the practices that I would recommend to every individual handling a complex survey data.
Working dataset: 15,560 records x 20 variables Variables in working dataset: - id - gender - age - ethnicity - education - income_ratio - weight - height - bmi - waist - systolic_bp1 - systolic_bp2 - systolic_bp3 - diastolic_bp1 - diastolic_bp2 - diastolic_bp3 - pulse1 - diabetes_status - smoked_100 - current_smoker
3.2 Missing Value Analysis¶
In any health related analysis, it is important to understand the pattern of missing data. I look at the level of missing values in the key variables to guide my data cleaning technique. The most relevant part of this, as I see it, is the sense of differentiating between missing completely at random (MCAR) and missing not at random (MNAR). To give an example, when people who have particular health issues tend to be less prone to taking physical examinations, it can easily be biased towards systematic bias when they are excluded. This is one of the methodological considerations that I find to be worthy of close consideration in epidemiological studies.
Missing Value Analysis:
==================================================
Variable Missing_Count Missing_Percent
current_smoker 11671 75.01
education 6328 40.67
pulse1 6089 39.13
smoked_100 5867 37.71
diastolic_bp3 5274 33.89
systolic_bp3 5274 33.89
systolic_bp2 5233 33.63
diastolic_bp2 5233 33.63
diastolic_bp1 5208 33.47
systolic_bp1 5208 33.47
waist 2986 19.19
bmi 2423 15.57
height 2403 15.44
income_ratio 2201 14.15
weight 1485 9.54
diabetes_status 574 3.69
gender 0 0.00
ethnicity 0 0.00
age 0 0.00
id 0 0.00
==================================================
Total records: 15,560
3.3 Creating Derived Variables and Category Labels¶
The NHANES data has numeric codes of categorical variables. I generate labels that are easy to understand by humans and extract other variables that will strengthen my analysis like BMI groups, ages, and mean blood pressure levels. My decisions concerning the categorisation in this case are informed by clinical standards, such as the WHO BMI classification thresholds. But I also admit that the categorisation of continuous variables is always associated with a loss of data and that the decision on where to make a cut can affect the inferences made. This is a trade off between analytical simplicity and accuracy that a researcher has to navigate.
Derived variables created successfully! New variables added: gender_label, ethnicity_label, education_label, age_group, bmi_category, avg_systolic, avg_diastolic, bp_category, smoking_status, diabetes_label, income_category Dataset now contains 31 variables
3.4 Data Filtering for Analysis¶
In my main analysis, I target adults aged 20 years and above whose data on the key variables of interest are complete. This makes the visualisations and conclusions to be founded on sound data. I would like to observe, though, that this full-case method does decrease the sample size and can also cause selection bias when the people who are not sampled differ in a systematic way with those who are sampled. To address this issue I would take into consideration more rigorous epidemiological methods in a more rigorous study though in the case of this exploratory analysis the complete-case approach will be sufficient to provide adequate validity.
Adults (age 20+): 9,232 records
Records with complete key health data: 7,577
Summary Statistics for Key Health Indicators:
============================================================
age bmi avg_systolic avg_diastolic waist income_ratio
count 7577.00 7577.00 7577.00 7577.00 7399.00 6607.00
mean 50.81 30.05 124.75 74.72 101.14 2.62
std 17.37 7.45 19.28 11.56 17.14 1.63
min 20.00 14.60 76.33 41.33 57.90 0.00
25% 36.00 24.90 110.67 66.67 89.20 1.20
50% 52.00 28.80 122.00 74.00 99.60 2.27
75% 64.00 33.80 135.33 81.67 111.60 4.25
max 80.00 80.60 218.67 135.00 187.50 5.00
4. Interactive Data Visualisations¶
This part introduces five interactive visualisations that have been developed with Bokeh library. All the visualisations are created to show meaningful relationships within the health data and enable users to interact with the data using a number of controls including sliders, dropdowns and hover.
4.1 Interactive Visualisation 1: BMI vs Blood Pressure Explorer¶
This scatter plot makes it possible to explore the correlation between Body Mass Index and blood pressure, and filter the results in terms of age range and colour-coded by different demographic characteristics. I have created this visualisation as I wanted the users to be able to interact with the data using sliders that would filter the age range shown. The use of BMI, as compared to systolic blood pressure, as the main relationship to consider is not an accident, and this relationship has significant clinical implications. The fact that elevated BMI is a modifiable risk factor of hypertension has been accepted and supported by numerous research studies, but its strength and nature might depend on population sub-groups, which I wanted to allow users to explore.
Observations:
The scatter plot indicates that there is a positive correlation between BMI and systolic blood pressure and this is in line with the available medical literature regarding the pathophysiology of hypertension that is influenced by obesity. The most notable aspect about my experience with this visualisation is the fact that the relationship grows stronger with age. This age related trend implies that the cardiovascular consequences of high BMI can be compounded over time and this theory needs to be explored further using longitudinal research.
On clicking the legend items, the users can isolate the data according to the gender and I observed that the males are likely to have a higher blood pressure reading in the same BMI levels. This gender disparity is in line with epidemiological evidence that premenopausal females normally possess a reduced blood pressure compared to males of the same age although the difference diminishes after menopause. Nevertheless, I would warn not to make strong causal inferences based on these cross-sectional observations because such confounding variables as the use of medications, levels of physical activity, and diet patterns are not adjusted in this visualisation.
The high scatter of the data can also be mentioned because it shows that BMI, in itself, can explain only a part of the variation in blood pressure, and the cardiovascular health is a multifactorial phenomenon.
✓ Static snapshot saved: screenshots/viz1_bmi_blood_pressure.png File size: 518.1 KB
Comment:
The image above is a static snapshot view of the interactive visualization showing relationship between BMI and Systolic Blood Pressure according to gender and age range.
4.2 Interactive Visualisation 2: Health Indicators Dashboard by Demographic Groups¶
This interactive dashboard shows the aggregated health metrics on the various demographic categories. I selected the design of this visualisation to allow users to choose which health indicator to show and which demographic grouping to show to give a holistic picture on health disparity within subgroups of the population. The aggregation strategy, in this case, is not accidental, but rather it is the shift to the population-level patterns instead of individual-level variation, which is more pertinent to the issue of a population health policy. But I am also conscious of the fact that aggregated means may be obscure to important within-group heterogeneity which can be of clinical significance.
Observations:
This interactive dashboard shows significant health inequalities between demographic groups that need to be studied critically. I point out the following major findings:
The BMI is on an upward trend until 60-79 age group, which reports a minimal decline in individuals aged 80 years and above. I take this pattern carefully as it is more of survivor bias than actual weight loss among the elderly. Those who live long with high BMI might be a very robust section of the population and the patients with morbidity because of obesity might have passed away earlier when they were aged 80 or above. A typical instance of how cross-sectional data can be misleading in understanding age trends is this one.
There is a clear positive trend of blood pressure along all measures with age, and this is in line with the long-established effects of stiffening of arteries as one ages. What catches my eye as a public health issue is the rate of this upsurge, which points to the possibility that the preventive measures that are currently used are not enough to counter the effect of age on cardiovascular risk.
There are considerable disparities in terms of income level with better income being connected to lower BMI and blood pressure. This is a disturbing but not startling socioeconomic gradient. It mirrors interplay of access to healthy food, safe place to exercise, healthcare access, and chronic stress, which is disproportionately impacting the population with lower income. I feel that health policy should focus on addressing such structural determinants.
There are ethnic inequalities as the Non-Hispanic Black individuals exhibit greater mean blood pressure levels. Such a finding has to be viewed in the light of past and present structural racism that not only impacts health in various ways, but also includes chronic stress, residential segregation and healthcare discrimination. I would advise against biological essentialism in the explanation of these differences.
The dynamic change capabilities between groupings and metrics allows exploration of these health determinants holistically and shows how health inequities overlap.
✓ Static snapshot saved: screenshots/viz2_health_dashboard.png File size: 169.5 KB
Comment
The image above shows 4 static snapshot views from the interactive dashboard. The interactive version allows dynamic switching between different demographic groupings (Age, Gender, Ethnicity, Education, Income) and health metrics (BMI, Systolic BP, Diastolic BP, Waist Circumference).
4.3 Interactive Visualisation 3: Smoking Status and Health Outcomes¶
The relationship between smoking status and the major health indicators is examined in this visualisation. I have introduced the use of an interactive tabbed interface so that the user can be able to compare various health measurements with regard to the smoking categories (Never Smoker, Former Smoker, Current Smoker). The smoking status categorisation provides some interesting analytical issues because the former smoker category includes both those who have stopped smoking decades ago and those who have stopped smoking recently, with potentially quite different health profiles. Irrespective of this weakness, the comparison can still be useful in analysing the patterns at the population level.
Observations:
Tabbed visualisation displays trends in terms of smoking and health of which I believe needs to be interpreted with a lot of care:
The means of BMI are less among current smokers than those never smokers. Although this might appear contradictory on the face of it, it makes sense in the pharmacological literature which indicates that nicotine inhibits appetite and raises the metabolic rate. I would say though that this is not to be taken as a positive aspect of smoking since the metabolic effects of smoking are greatly overshadowed by the catastrophic health results of tobacco use. The same finding also demonstrates a possible confounding effect of observational studies: smoking status is correlated with many health behaviours, which may independently influence BMI.
Ex-smokers have the greatest average BMI and probably this is a result of gaining weight after giving up smoking. It is a phenomenon that has been well documented that I find worrying in a message about public health in that fear of gaining weight is always mentioned as a concern to giving up smoking. The statistics indicate that weight management support should be included in smoking cessation programmes to overcome the problem.
Trends in blood pressure demonstrate that the average blood pressure of the former smokers is highest. I would explain this result to be due to confounding by age, and not necessarily by former smoking. It is probable that the former smokers in this sample will be older in general than current smokers (because many smokers persist or succumb to diseases caused by smoking) and age has a strong predictive value of blood pressure. Also, ex-smokers who have already acquired cardiovascular disease could have been recommended to quit which brings about reverse causation.
These results underscore the complexity of health behaviours and the need to take into account confounding variables which include the age, the length of exposure and time since cessation in interpreting the results. In my opinion, this is a great lesson on the weaknesses of observational data in formulating causal conclusions on health behaviours.
✓ Static snapshot saved: screenshots/viz3_smoking_health.png File size: 120.0 KB
Comment:
The image above shows all 3 tabs from the interactive visualization in a single view: BMI, Blood Pressure (Systolic/Diastolic), and Waist Circumference comparisons across smoking status categories. The interactive version allows switching between tabs.
4.4 Interactive Visualisation 4: Diabetes Prevalence Analysis¶
This visualisation is a two-dimensional interactive heatmap of the prevalence of diabetes by demographic crossbreeds. The reason I selected the heatmap format, in particular, is that this visualisation method allows visualising two categorical variables at the same time (age group and BMI category), and the trends in the spread of diabetes can be observed at a glance. There is also the option of hovering over cells to get detailed statistics of each subgroup as an important tool in interpreting rates in cells having small sample sizes, in my opinion. The colour gradient was chosen to visually express prevalence that is increasing in a more intuitive way with the darker colours depicting more prevalence of diabetes.
Observations:
The heatmap is an interesting visual display of the age-BMI combination risk of developing diabetes. In this pattern, I consider a number of things worth discussion in details:
BMI category and age have a significant and drastic impact on the prevalence of diabetes. The most striking thing to me is the synergistic effect that seems to exist, the interaction between old age and obesity generates prevalence rates much higher than would otherwise be expected under the influence of each factor separately. This indicates that the biology that obesity is associated with diabetes might be enhanced with old age, possibly because of cumulative destruction of the pancreatic beta-cells or rising insulin resistance.
The greatest rates are found in the older population (60-79 age group) that is obese (rates are greater than 25 percent). I observe that this is a good clinical and general health public burden. As the population grows older, and the prevalence of obesity increases, such numbers indicate that the epidemic of diabetes can become even more severe in the following decades without efficient actions taken to address it.
Obesity is a significant risk factor of diabetes even among the younger age group when compared to the normal weight. The implications of this observation on early intervention are significant since it proves the existence of metabolic effects of obesity at an early age. In my opinion, this demonstrates the significance of childhood and adolescent obesity prevention programmes.
The trend is a firm advocate of the public health message concerning healthy weight and especially as one grows in age. Nonetheless, I would say that the data also backs up the question of whether the existing methods of communal health are sufficient as well. When the correlation between BMI and diabetes is this good, why have years of weight management communications not resulted in a reversal of the obesity trend?
The interactive hover option shows the real sample sizes of each cell which is necessary to interpret critically. I noticed that the sample sizes of some of the cells, and especially in the underweight elderly, are relatively small, and thus the prevalence estimates in question are less certain.
✓ Static snapshot saved: screenshots/viz4_diabetes_heatmap.png File size: 94.0 KB
Comment:
The image above is a static version of the interactive heatmap showing diabetes prevalence rates across age groups and BMI categories. Cell annotations show the percentage rate and sample size (n). The interactive version includes hover tooltips with detailed statistics for each cell.
4.5 Interactive Visualisation 5: Multi-Variable Health Profile Explorer¶
This interactive visualisation in a comprehensive manner enables the user to view the connections between several health variables at the same time. I made this the most customizable tool in my analysis package allowing the user to choose other variables to be used as the x-axis, y-axis, colour encoding. The income-poverty ratio slider is a socioeconomic filter with the potential of exploring whether health relationships are different across economic levels. I find this feature especially useful to study health equity issues because it allows users to visually determine whether there are higher health risks among the lower-income populations.
Observations:
This comprehensive explorer enables discovery of complex multi-variable relationships that I find essential for understanding population health patterns:
The income filter reveals that health indicators vary significantly by socioeconomic status. When I filter to lower income groups (ratio less than 1), I observe higher clustering in the elevated BMI and blood pressure regions. This visual confirmation of the socioeconomic gradient in health is sobering. It suggests that economic disadvantage translates directly into biological risk, a phenomenon that epidemiologists term the "embodiment" of social inequality. I believe this finding has profound implications for health policy, as it suggests that economic interventions may be as important as medical ones for improving population health.
Age consistently shows strong positive correlations with blood pressure and waist circumference. The strength and consistency of these relationships across different subgroups reinforces the view that aging is accompanied by predictable metabolic changes. However, I note that the magnitude of age-related changes appears to vary somewhat by income level, suggesting that the aging process may be accelerated by socioeconomic disadvantage.
The relationship between BMI and waist circumference is nearly linear, as expected, but the scatter increases with higher values. I interpret this increasing heteroscedasticity as reflecting the diversity of body composition patterns among individuals with higher BMI. Two people with identical BMI values may have very different distributions of fat tissue, and waist circumference provides additional information about central adiposity, which is particularly associated with metabolic risk.
By dynamically changing variables, users can discover unexpected relationships and generate hypotheses for further investigation. I consider this exploratory capability one of the primary strengths of interactive visualisation, as it supports the hypothesis-generating phase of research that often precedes more rigorous confirmatory analysis.
✓ Static snapshot saved: screenshots/viz5_multivariable_explorer.png File size: 1192.7 KB
Comment:
The image above shows 5 example variable combinations from the multi-variable explorer. The top panel shows the default view (BMI vs Systolic BP colored by Age). The interactive version allows users to dynamically select any combination of 6 variables (Age, BMI, Systolic BP, Diastolic BP, Waist Circumference, Income Ratio) for X-axis, Y-axis, and color encoding, plus an income filter slider.
5. Key Statistical Findings¶
In addition to the interactive visualisations, I would now provide some important statistical summaries that would quantify the above relationships. Although the visualisations are a way of gaining intuitive knowledge of the patterns, I think numerical summaries are required to convey findings in an accurate way and compare them with other studies. The correlation coefficients and prevalence rates herein are to be considered as descriptive statistics of this sample, because it would need to apply the NHANES survey weights to make proper population level inferences, which I have not done in this preliminary study.
======================================================================
KEY STATISTICAL FINDINGS
======================================================================
1. CORRELATION MATRIX (Numeric Health Variables)
--------------------------------------------------
age bmi avg_systolic avg_diastolic waist income_ratio
age 1.000 0.001 0.440 0.009 0.165 0.072
bmi 0.001 1.000 0.020 0.202 0.905 -0.052
avg_systolic 0.440 0.020 1.000 0.616 0.107 -0.038
avg_diastolic 0.009 0.202 0.616 1.000 0.222 -0.021
waist 0.165 0.905 0.107 0.222 1.000 -0.037
income_ratio 0.072 -0.052 -0.038 -0.021 -0.037 1.000
2. HEALTH METRICS BY GENDER
--------------------------------------------------
bmi avg_systolic avg_diastolic waist
gender_label
Female 30.64 122.40 73.88 99.58
Male 29.44 127.16 75.57 102.73
3. DIABETES PREVALENCE BY BMI CATEGORY
--------------------------------------------------
Underweight: 3.81%
Normal: 7.62%
Overweight: 13.98%
Obese: 21.07%
4. SAMPLE SIZE SUMMARY
--------------------------------------------------
Total participants in analysis: 7,577
Male participants: 3,736
Female participants: 3,841
Age range: 20 - 80 years
======================================================================
Analysis of Key Statistical Findings:
The quantitative data presented above as the statistical summaries has been used to supplement the visual patterns of the interactive visualisations. I outline a number of important findings:
- Correlation Matrix Insights:
Age shows a moderate positive relationship with systolic blood pressure (0.440), but interestingly, it shows virtually no correlation with diastolic blood pressure (0.009). This disparity highlights the prevalence of cardiovascular aging patterns where systolic pressure rises while diastolic remains stable. This divergence is a classic indicator of isolated systolic hypertension, driven by the stiffening of arteries (arteriosclerosis) as the population ages, causing a widening pulse pressure rather than a uniform increase in both metrics.
Analysis reveals a very strong positive correlation between BMI and waist circumference (r = 0.905). However, contrary to typical clinical expectations, BMI showed negligible correlation with systolic blood pressure (r = 0.020) and only a weak correlation with diastolic blood pressure (r = 0.202) in this specific population
Income-to-poverty ratio has weak negative relationships with BMI and blood pressure, and this demonstrates that the better a socioeconomic status, the better are the health outcomes. Although these correlations are small in magnitude, they do agree with the large literature on social determinants of health.
- Gender Differences:
Males have an average systolic and diastolic blood pressure that is higher than female, which is also consistent with established sex differences in cardiovascular physiology. It is a clinically significant difference, as it helps explain why cardiovascular disease is more prevalent in men, particularly in men under 65 years of age.
In this sample, females exhibit greater average BMI, this could be an indication of compound interactions between both biological (such as the difference in body composition and the hormonal effect) and social (such as gender difference in physical activity behaviour and dietary habits) factors.
Waist circumference is significantly greater in the male, which indicates the predisposition of the male to accumulate visceral fat (androgenic or apple-shaped) where metabolism is more at risk than the gynoid (pear-shaped) distribution found in females.
- Diabetes Prevalence Gradient:
The fact that the level of diabetes prevalence has risen dramatically across the BMI categories, as reaching a certain point of about 3-5 percent in normal weight people and reaching up to 15-20 percent in obese patients is one of the most clinically important observations in the given analysis. The sharp inclination highlights the direness of the weight control in the prevention of diabetes.
I observe that, even the overweight category has significantly high levels of diabetes risk as opposed to normal weight implying that contrary to solely obesity, the overweight category must also be considered as a risk category in the intervention of the population health.
-Sample Size Considerations:
- Equality in the gender representation and large sample size give confidence on the stability of these estimates. I however point out that these are descriptive statistics that are unweighted. NHANES has a complex survey design which would require the consideration of the complex survey design by appropriate weighting processes to be able to draw proper population level inferences.
5.1 Interactive Data Summary Table¶
The table presented below is an interactive table that shows aggregated health statistics across subgroups of the demographic. I have added this tabular display since there are users who will value numerical accuracy rather than a visual display and also the table will enable values to be compared across groups easily. The data can be sorted by clicking on the headers and the users can scroll. The sorting feature is also very helpful to me in the search of the most drastic values of each health indicator in the demographic subgroups.
Observations
According to the table, the following three high-impact insights can be identified:
The Pulse Pressure Warning: Systolic pressure (top number) also increases steadily with age, Diastolic pressure (bottom number) however decreases beyond 60 years. This increasing difference (Pulse Pressure) among 80+ implies excessive arterial hardening, which is a significant risk factor of cardiovascular conditions not comparable to ordinary hypertension.
The Reversal of Genders: Young men (20-39) are much more blood-pressured in comparison with young women. But this overturns in the 80+ category with women having the highest average Systolic pressure of any group (143.6 mmHg), exceeding those of the men.
Hidden Visceral Fat: Female BMI shows a minimum in the 80+ group (28.0), it is even lower than the 20-39 group (29.9). However, they have a bigger circumference of their waist (98.3 cm vs 95.6 cm). This implies that total weight can be reduced in old age (it is the loss of muscle probably), but unsafe abdominal fat is elevated.
6. Privacy and Ethical concerns of data.¶
One of the aspects that should be taken seriously is the ethics involved in the management of health information. In my opinion, good management of sensitive health information is not only a legal requirement but also a requirement in order to perform a basic duty to those whose information has been provided. This part represents the reflection of the primary privacy and ethics issues that I needed to confront in this analysis and compare them to the broad spheres of concern in health data research.
The NHANES dataset introduces several important privacy protection principles, which I consider to be a perfect example in the area of public health information (CDC, 2024):
De-identification: The personal identifiers (names, addresses, exact dates of birth, etc.) in the public-use data files are deleted. I can note that this is the first and most important step towards the provision of privacy of the participants.
Geographic masking: In this method, location information is limited to broad categories (or eliminated completely in the publication version) to prevent the possibility of identification. As the geographic position along with the demographic factors may be used as a good quasi-identifiers, I like the cautious attitude NHANES adopts in that regard.
Top-coding: The radical values of sensitive variables (e.g. 80+ age, very high income) are constrained or capped so that particular individuals are not recognized as population uniques. It has its constraints in analysis, which I have in the aggregated age group of 80+, but I believe that this level of trade-off is appropriate given the privacy advantages.
Informed consent: Acknowledged all the participants in NHANES gave informed consent to use their data in research. It is the essence of ethical research and I understand that new methods of data analysis may sometimes provide information which the participants may not have necessarily understood at the time of signing the consent forms.
The issue of ethics in the analysis of health data also raises various ethical concerns. These precautions notwithstanding, various ethical issues emerge that I consider that researchers should work hard to address:
Re-identification risk: Despite de-identification, combination of multiple variables might be able to identify individuals, particularly in small subgroups. This, again, reflects the experience of such cases as the Myki data leak in Victoria, Australia, where supposedly de-identified transport data was re-identified by linking it to publicly accessible data (OVIC, 2019). I am also aware that health information on its high dimensionality and personal nature could also be susceptible to the same linkage issues unless handled with caution.
Stigmatisation: Stigmatisation analysis that points out disparities in health care sectors of racial, ethnic or socioeconomic groups should be done in a manner that does not promote stereotypical ideas or stigmatisation of specific communities. In this report, I have tried to place the inequalities in terms of structural and social determinants instead of assuming structural differences in groups. In my opinion, such framing is the key to ethical health studies.
Health equity: Policies that improve health equity should be informed by the results instead of disadvantaged populations being marginalised even more. I am also bothered because the history of health research is sometimes used to justify discrimination, and I believe it is my duty to make report of health research in a manner that fosters equity.
Representation: NHANES relies on complicated sampling to represent the US population, yet some groups might remain under-represented, and the researchers cannot be sure that the results apply to the whole population. Using the weight of the survey in this particular analysis I do not claim to be representing the sample but Binney and the population. This is one of the limitations that I would handle in a more rigorous epidemiological study.
6.3 Responsible Use of Findings¶
The knowledge gained with the help of this analysis must be spent wisely and I would provide the following recommendations:
Public health interventions need to be informed by the results and all the segments of the population should be considered, but special consideration should be given to the groups with high health risks caused by structural disadvantages.
Correlations made should not be viewed as causal relationships without further advice. I have highlight this drawback across the report since the data were cross-sectional and thus, they do not allow any causal inference.
There should not be individual-level predictions or discrimination use of population-level statistics. It would be a great moral failure to refuse people medical services, insurance, or other opportunities based on these findings.
Sharing and publishing of data must ensure that the participants are not identified. I have neither exported nor republished this analysis at individual level, only putting out aggregated statistics and visualisation.
Conclusion¶
This NHANES data analysis has demonstrated some significant health trends in the American population. Summarizing what I have gained as part of this exploration analysis, I would like to mention the following major insights:
Age and Health: There is a steady rise in blood pressure with age, but the sharpest rises begin after 60 years of age. The fact that makes the discovery grow on me is that this is inevitable as per the current methods of prevention. It, in my view, not only shows the significance of monitoring cardiovascular health among the geriatric population but also a more suitable approach to a primary prevention at an earlier age.
Obesity and Disease Risk: The correlation between the BMI and the blood pressure and prevalence of diabetes is strong and positive. It is steep enough that I believe that obesity is a central mediator of the burden of chronic diseases in the population. Obese people are at a high risk regarding several health outcomes, which may indicate that the benefits of weight management programs may be enormous in terms of benefiting the entire population.
Socioeconomic Disparities: Income level has a negative relationship with a number of poor health outcomes. This tendency is especially alarming to me, as it makes the idea of health a personal choice look less relevant to a significant degree, and economic conditions largely shape it. Disadvantaged populations have larger average BMI and blood pressure, adding to the increasingly accepted view that social determinants of health can be as significant as medical services in determining the health of the population.
Smoking and Health: The correlation between smoking and health realize is more than it would seem to be due to simple dose responses. Although the smokers are lower in their average BMI (mostly because of reduced appetite), the former smokers are associated with high health risks. This I would read as an indication of confounding by age, reverse causation (sick people are more likely to quit) and gain of weight after quitting. These findings highlight the need to have subtle interpretation in the analysis of health behaviours.
Ethnic Health Disparities: There are significant disparities among the different ethnic groups with certain groups exhibiting more prevalence of hypertension and diabetes. I would like to highlight that these inequalities are not to be ascribed to the inherent differences in biological aspects but should be perceived as the results of historical and continuing structural inequalities that impact health in various ways. Specialized population health responses are justified, albeit in a manner that tackles the underlying causes and not just the symptoms.
To sum up, this exploratory analysis has shown how interactive data visualisation can be an effective tool in understanding complex health patterns as well as showing the apprehension that needs to be taken when dealing with observational health data. The patterns I have determined fit in the standard epidemiological knowledge and also pose questions to be answered through further research. This is what I hope this work will add to the existing body of evidence that can be used in effective interventions in public health.
References¶
Bokeh Development Team (2024) Bokeh: Python library for interactive visualization [Computer software]. Available at: https://bokeh.org/ (Accessed: 9 January 2026).
Centers for Disease Control and Prevention (CDC) (2021) NHANES 2017–March 2020 pre-pandemic data documentation. Available at: https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx (Accessed: 10 January 2026).
Centers for Disease Control and Prevention (CDC) (2024) National Health and Nutrition Examination Survey (NHANES). Available at: https://www.cdc.gov/nchs/nhanes/ (Accessed: 11 January 2026).
Centers for Disease Control and Prevention (CDC) (n.d.) National Health and Nutrition Examination Survey data. Hyattsville, MD: U.S. Department of Health and Human Services. Available at: https://www.cdc.gov/nchs/nhanes/ (Accessed: 11 January 2026).
Office of the Victorian Information Commissioner (OVIC) (2019) Report of investigation: disclosure of Myki travel information. Melbourne: Office of the Victorian Information Commissioner.
HTML Export¶
Converting notebook to HTML... Input: /Users/sophiengo1811/Documents/SIT731 - Data Wrangling/Week 7/Task_7D-Suong_Ngo.ipynb Output: /Users/sophiengo1811/Documents/SIT731 - Data Wrangling/Week 7/Task_7D-Suong_Ngo.html ✓ HTML export successful! HTML file created: /Users/sophiengo1811/Documents/SIT731 - Data Wrangling/Week 7/Task_7D-Suong_Ngo.html File size: 2.93 MB The HTML file contains all interactive Bokeh visualizations. You can open it in any web browser to view the interactive plots. ✓ HTML export successful! HTML file created: /Users/sophiengo1811/Documents/SIT731 - Data Wrangling/Week 7/Task_7D-Suong_Ngo.html File size: 2.93 MB The HTML file contains all interactive Bokeh visualizations. You can open it in any web browser to view the interactive plots.