Applying post-hoc tests using ANOVA
Select the data from the diabetes dataset subject with diagnosed diabetes (CLASS: Y
). Using the available data, perform an analysis comparing average values of glycated hemoglobin (HbA1C) between underweight, normal, and overweight subjects.
Note
Perform the ANOVA analysis for comparing multiple groups and present the results visually.
In this analysis, we will be comparing multiple groups’ HbA1C based on their BMI level categories.
Figure 8.4 – Comparison of HbA1c between underweight, normal weight, and overweight subjects
In the initial steps, we will load the data and separate subjects into groups based on their BMI levels:
- Those with a BMI of < 25 belong to Normal
- Those with a BMI of >= 25 and < 30 belong to Overweight
- BMI > 30 is for Obese
Let’s start with the coding part:
import pandas as pd import scipy.stats as stats # Load the data data = pd...