Number Crunchin'

Tuesday, March 06, 2007 | 15 comment(s)


So last weekend I ate the better part of a half gallon of Breyer's Vanilla ice cream, had a slice of birthday cake, and a few Girl Scout cookies.

I think I've got that out of my system now (at least I hope so).

But the non-movement of my A1c still haunts me.
So when faced with a situation like this I decided to do what any self-respecting geek would do: turn to the data.
This is going to get a little technical.
You might want to turn back now.


So after explaining my dilemma here and to a few other friends or family, several have asked whether there's an issue with when I'm measuring my blood sugar: Could I be missing peaks? Could I be biasing my results with more frequent tests when I'm low? And I think these are valid questions.

Going into all of this, I have as my baseline a report in Diabetes Care titled "Defining the Relationship between Plasma Glucose and HbA1c." The result of the article is to estimate a reltionship between average meter readings and HbA1c readings (duh). And basically, the table below is what was found.

 A1c (%)    Mean Plasma Glucose    
From Diabetes Care - 26 (Supplement 1): Table 1

This relationship was based on a sample of 1,439 type 1 diabetics producing 26,056 quarterly HbA1c readings (mean duration of participation in the study was 6.5 years), and blood glucose readings taken 7 times/day (before and after each of 3 meals and at bed time). The relationship was estimated using least-squares linear regression.

But first, in order to estimate the relationship, they needed to come up with a measure of "mean plasma glucose" that is appropriately weighted for time.

This is important.

Below is a simple example I created. Imagine you have 3 blood sugar readings over a period of 4 hours. At 1 PM you have a reading of 200 mg/dl, at 3 PM you have a reading of 150 mg/dl, and at 4 PM you have a reading of 100 mg/dl. If you were to take the simple average of these three readings, you'd have an average of 150 mg/dl over the 4-hour period.

But that's not likely to be what you're "True Average" blood sugar reading was over the 4-hour period. If we assume a straight drop in blood sugar between 1 PM and 3 PM, you could imply (or interpolate) a reading for 2 PM of 175 mg/dl. If you include this reading of 175 mg/dl, your average for the 4-hour period now goes up to 156 mg/dl -- 6 mg/dl higher.

Conversely, if you were to have the timing switched up a little (like Scenario 3), you could arrive at a lower average reading if you were to interpolate between readings (150 mg/dl vs. 144 mg/dl).

Meter Readings
Time Scenario 1 Scenario 2 Scenario 3 Scenario 4
1:00 PM 200200 200200
2:00 PM   175 150150
3:00 PM 150 150  125
4:00 PM 100100 100 100
Average 150156 150144

To account for this timing effect of blood sugar readings, the authors "linearly interoplate" between the 7-points of actual data they collected. Or in their own words:
"For each profile, the seven time points were connected by straight lines over time for a 24-h period, and then the trapezoidal areas under each curve were determined, added together, and divided by time. A constant BG level between bedtime and the following morning was assumed."

Basically, you need a measure of the "area under the glucose curve." If you had a continuous function, you would simply take the integral of the function to calculate the area under the curve. To arrive at an approximation of this, however, you can chop up the area under the glucose curve into small units of time, create rectangular areas for each unit of time that go as high as the glucose curve, and add up the area of all these interpolated rectangles, and divide by time to come up with a properly weighted average blood sugar reading.

So... based on their table, my 7.1 HbA1c reading indicates that my average blood sugar has been around 170 mg/dl. This is been IMMENSELY puzzling to me as my average meter readings for the past 9 months(!) have been almost entirely below 150 mg/dl and as low as 130 mg/dl.

To (attempt to) get to the bottom of my dilemma, I exported the data from my OneTouch meters to comma separated values (*.csv) file going all the way back to November 2005. I read these data into SAS and wrote a program
SAS is a statistical programming language used heavily in research and particularly in clinical trial research. I don't know exactly what time increment the authors used in the Diabetes Care paper, but I interpolated readings for each-and-every-one of the 1,440 minutes in a day. I also didn't assume that blood sugars remained constant over night like the authors did. I simply interpolated them to the next morning's blood sugar reading. I'm not sure whether these differences would bias my averages one way or the other relative to the methodolgy used in the other analysis.

to interpolate the value of blood sugar in between all my meter readings and produce 7, 14, 30, 60, and 90 day averages. I also calculated these averages based solely on the meter readings for comparison.

First, below is a graph of the average readings from November 2006:

Clearly, the interpolated averages are higher than my simple averages of meter readings by about 8 mg/dl.

And then here is a similar graph of my average readings from February 2007:

While the interpolated average is still a bit higher than my simple averages that I've been relying on, the most remarkable thing about this graph is how much lower my readings are relative to my November averages (both interpolated and simple).

What I was hoping to get out of this exercise was to find that the interpolated values were indeed higher than my meter readings (which I did learn), but also that there would be little difference between the interpolated average in November and the interpolated average in February.

Unfortunately, that is not the case. My blood sugar averages dropped significantly over the 3-month period, but my A1c stayed rock solid at 7.1.


All that, and I'm still puzzled as ever...

15 Comment(s):

Blogger cass said...

i have often wondered how much of a difference it would make if you counted the assumed values in between tests. especially for night values... i mean, if you go to sleep with a reasonable number, and wake up with a reasonable number, it would be nice to be able to count all of those values in between too. of course, that is much harder to assume that it is a straight line from your 11pm test and your 7 am test.

i don't know what to say...

i wonder though how that these averages can account for how much blood glucose is raised in between the time tested before eating, and the 2 (or 3?) hours post.

i personally, have been too terified to ever attempt testing before at least an hour and a half has past for fear of the knowledge of just how high my blood sugar was as i was eating.

i know this one non-diabetic blogger though that is obsessed with the idea of BECOMING type 2, and constantly test her blood sugar at 45 minutes after eating whatever she suspects may raise her bloodsugar, as this is (supposedly) the time when her bloodsugar is the highest.

i suppose particularly high glycemic foods may spike it before the insulin can catch it...

and then of course sleeping time...

Blogger Chrissie in Belgium said...

Kevin, I have a very simple non-mathmatical answer. Stop trying to analyze this with math and just try your very best. If you really ARE trying your best you CANNOT feel guilty. You cannot do any better! And remember, when we are weak and could perhaps be more intelligent in our choices, we are still only human beings, not machines. WTF, factors other than food, exercise and insulin also influence our bg values! Take stress for example. We know that it affects our bg levels, but we cannot accurately fit it into a mathematical calculation to determine the precise correct insulin dose or food required for a given hour!

On the flip side, you are who you are. YOU like studying statistical relationships, and b/c you are this way you have made the very best logsheet I have ever come across in my 45 years of D. So thank you for being you! Your logsheets show us what USUALLY happens. With these visible log trends we can make relatively good guesses on how to correct bad patterns. Thank you - again and again and again!

Blogger Chrissie in Belgium said...

Me again! My nice HOT shower got me thinking - about two other points. One - MAYBE our current scientific knowledge does not really know exactly how the HbA1c levels are related to blood sugar levels. Other components CAN be important. Tests have shown that some people with similar blood glucose levels have in fact different HbA1c numbers. And two - why did you eat that ice cream, Kevin? I KNOW that it passes through my brain that right after a lab my bg values will not affect my next lab HbA1c number. YES, I might be less vigilant. However I have begun to think, "Hey Chrissie, what ARE you doing?" I am NOT trying to manage my diabetes to achieve a good HbA1c number, but I am doing it for MY BODY for ME. That changes your perspectives and your your resultant behavior. It has changed mine!

Blogger Scott K. Johnson said...

Dude - there is no "equals" sign in diabetes.

That is a line that a good friend of mine says often. So many times the numbers don't add up. The "facts" are not facts at all.

It's not as clear cut as mathematical equations.

7.1 is a damn good A1C value. I bet that if you stick with your much better BG's, it will come down over time too.

Our bodies are often resistant to change of any kind, and maybe it's just being a little stubborn.

Blogger Kevin said...

cass: You're right, I too think we should get more credit when we have good blood sugars overnight. That's part of why it's important to interpolate between readings. I mean, that's a third of our day, and it's only getting one reading to contribute to our averages? Clearly that would bias our averages upward (assuming overnight blood sugars were steady and low...).

Chrissie: You're welcome, you're welcome, you're welcome. And you're right, I know I shouldn't worry too, too much about it -- but it's kind of my genetic make up, I guess. And I also know that the A1c isn't the only (or even the best) measure of success with this disease (and I'm learning that more and more, it seems). So thank you for reminding me.

Scott: What? Me? Stubborn? Naaahhh!
That's an excellent quote, too. I will surely use it myself somewhere down the road. It reminds me of two others worth sharing:

"There are three kinds of lies: lies, damned lies, and statistics."

And from the Talking Head's song "Crosseyed and Painless":

"Facts are simple and facts are straight
Facts are lazy and facts are late
Facts all come with points of view
Facts don't do what I want them to
Facts just twist the truth around
Facts are living turned inside out"

Anonymous In Search Of Balance said...

Holy Mathemetician, Batman!

Seriously, there was a reason why I picked a college with no math requirements... :)

That said, it is really odd that your A1C remained the same, and it must be wildly frustrating. Have you thought about a loaner CGMS? It seems like the only logical explaination for lower averages and a steady A1C is either fewer missed lows, or more missed highs.

Any way you slice it, diabetes sucks.

Blogger Minnesota Nice said...

OMG Kevin, these are way too many numbers for me.......................maybe the AlC isn't a true measure of the absolute average - maybe there are some other funky factors that nobody knows about.

...........I'm gonna go zone out and watch Survivor.
(It was a good number, nonetheles.)

Have a good weekend.

Blogger jill. said...

I can totally relate to being a stats nerd. My job title is "data manager" and I look at SAS tables filled with clinical data practically 8 hours a day! The A1C is a frustrating test that doesn't seem to be too well understood. (I've always wondered if a transient spike of say 300 has the same effect as a 5 hour stint in the 200s, no one can explain this to me.)

Have you thought about wearing a continuous monitor for a few days?

P.S. Once the technology improves, someone ought to do a con mon study relating averages to the A1C. Now THAT could give us some answers..

Blogger Kevin said...

jill: Yes a "con mon" study would be cool (I must admit, I had no idea what that meant at first and had to search around for a while to figure it out. For those of you as puzzled as I was: "con mon" = "continuous monitor"). In fact, even the authors of the study I reference think so too: "With the advent of new technologies that are capable of monitoring PG on a 24-h basis, it will be interesting to see how our estimate of the relationship between PG and HbA1c compares with estimates obtained using these technologies."

MN: The authors also reference such a possibility: "Several studies have suggested that, although intraindividual variation in HbA1c is minimal, there is evidence of wide fluctuations in HbA1c between individuals that are unrelated to glycemic status, suggesting that there are "low glycators" and "high glycators"".

Perhaps I'm just a high glycator. But then what does that mean with relation to my overall risk of complications???? Am I doomed from the get-go?

Blogger jill. said...

Sorry, I suppose CGMS is the appropriate shortened version. Doesn't con mon sound so much cooler though?

Anonymous reflux reluctantly flexes his brain said...

The low versus high glycator idea is an interesting if troubling concept. I ended up googling up the following link and article:

So it seems that even between individuals with similar control patterns, there can be variance in HbA1c results.

Blogger Wendy Morgan said...

I envy your dedication to finding the answers to control this disease. I can't keep up with that, however my CGM did it for me while I had it). I just do the best I can and my doctor seems to think that is good enough. I am relieved when I go see him, feeling guilty for my transgressions or lack of blood sugar readings and he tells me I am doing great. I think we are far harder on ourselves than anyone could possibly be and I am working to create more balance in my life with diabetes. Always a challenge!

Blogger Lili said...

Maybe this is a dumb question, but are you accounting for the A1c being a weighted average?

Blogger Kevin said...

Lili: Not a dumb question. I haven't explicitly accounted for the A1c being a weighted average. If I were to run a regression of averages against the A1c reading, I would certainly give different weight to each time period. But I was simply just trying to gauge whether the meter average is biased (turns out, yes it is, downward, too).

From what I've read, the previous 30 day average from when the A1c test is performed accounts for about 50% of the A1c result, and then the next 60 and 90 day average each account for about 25% (though this seems like it's a way over-simplification and that the "life-span" of your hemoglobins are what really drives the result).

Blogger Simon said...

I can't help noticing your superb spreadsheet. A friend of mine and a number of others seem to be using it and think you're the cat's whiskers for producing it.

A friend who uses it said that, if I asked you very nicely, you just might send me a copy of it.

Sooooo, very nicely please may I have a copy? Pretty please? is my general purpose e-mai address.


Post a Comment || Go Home