A Poincaré plot is traditionally used in physics to visualize the dynamic behavior of a system. In this use case, “a smaller, more concentrated plot indicates system (patient) stability, whereas a more scattered Poincare plot indicates system (patient) irregularity, reflecting in our case poorer glucose control and rapid glucose excursions.”
Each point of the plot has coordinates BG(t-1) on the x-axis and BG(t) on the y-axis. The difference between the coordinates (y-x) of each point represents the BG rate of change. To calculate this, I simply created a new column in the DataFrame called “Lag” and used the Pandas .shift() function to get (t-1):
This plot is an ideal comparison tool to visualize the effect of changes in treatment. For example, one could gather BG “control” data for a 30 day period, make some change in treatment (e.g. adjustment of carb ratios, adjustment of basal dose, regular exercise, dietary changes, etc.) for 30 days and gather that BG data, then plot the two periods next to each other and compare the spread. A more concentrated second 30 day period would be indicative of a beneficial treatment.
Since I didn’t have any treatment changes to compare across, I decided to showcase the Poincaré plot with 3 separate timeframes — one “good day”, one “bad day”, and the total 30 day period:
From Figure 7 above it’s clear that the left-most plot was indeed a “bad” day, with a greater spread of points indicating more variation in BG.
There is one outlier point on the “Total 30 Day” graph that is the result of a two-hour period where my CGM failed to acquire data. My BG changed by 108 mg/dL in that period, resulting in a significant difference between the two adjacent timestamps.
Continue reading: https://towardsdatascience.com/how-to-analyze-blood-glucose-data-with-python-data-science-packages-4f160f9564be?source=rss—-7f60cf5620c9—4