A Million Heartbeats
Topics
heart rate / cardiovascular
Crt Ahlin
Crt Ahlin is from Slovenia and he studies statistics at the University of Ljubljana. He is also a fan of life logging. Crt became interested in the Quantified Self movement about three years ago when he had some health issues. In this video, he talks about visualizing heart rate data and a possible way to measure daily values with a curve that could also be used as a baseline for comparisons.
Tools
Fitbit | Polar Loop
Links
Slides
Transcript
Show
My name is Crt Ahlin, I come from Slovenia where I study statistics at the University of Ljubljana. I’m also a fan of life logging.
So what do I do? So in my research I’m dealing with continuous heart rate data. One part of it is representing daily heart rate with a typical curve, with a typical best curve to the data points, and there are many possible curves that can achieve this.
I became interested in Quantified Self about three years ago when I had some health issues. I think the Quantified Self movement is very important and it will become mainstream soon and it has the potential to transform health care.
At the moment I’m using Fitbit and Polar Loop to track my activity and Bluetooth for logging my heart rate data, and also some android apps for logging my runs as an electronic diary.
So what is the problem of visualizing heart rate data?
Basically it is difficult to visualize more than just a couple of days since we run out of space onscreen. Let’s look at an example.
These are seven days that I captured, time is on the horizontal axis and heartrate is on the vertical, and we can see this is also a bit condensed; also note the missing data is day two and other days. But basically the heartrate follows a cycle of one day.
So we could merge the data from several days into one interval and use a curve to represent the data.
To make sense of course, the curve has to meet at the start and the end. We could represent this horizontal axis with starting at midnight and ending again at midnight with noon in the middle.
So let’s look at an example of one day of data, so this is how it would look like. This is not problematic it gets more difficult when we add more days of data. So for example with two days of data, we would already need some kind of typical curve to see what is happening. We’ll get back to this later and talk about my data logging first.
I decided to track my own heartrate to get some personal datasets for my research. I use the Zappy Bluetooth together with the (Erous?) android app running on an android phone. I wanted 24 hour continuous recording, so I wore the tracker day and night, and I found this a bit problematic for several reasons.
Firstly the belt rubbed my skin so I got blisters, especially when the belt was wet after exercise. Secondly, I had trouble wearing the belt during the night because it has to be tight enough to measure, and after a couple of days I got this suffocating feeling wearing it. also during the night sometimes the phone would restart and I would lose logging until the morning.
At one point the chest belt malfunctioned probably due to continuous use and it started logging double the heartrate values, and I also found wearing a radio source on my chest while carrying my baby problematic, so had to take it off during those times and this of course was impractical.
So this is example data that I recorded, so these are 1.7 million data points which is about 20 days of data. I already removed some outliers but we can see the problems I mentioned. These are due to a faulty chest belt and a bug in the recording app, and the spikes I guess are due to moving chest belt.
So this is a kind of curve that, the blue curve is that we can draw ere, and you can see the cycle it captured the basic idea of the data. It has a low during the night and a high during the day. And another type of curve, this red curve shows a little bit more detail with two peaks during the day around 09:30AM and 7:30PM.
So basically I have two modes of operation; the night low and the day high with some periods of dropping and lowering of heartrates, and also some minor extremes.
For the visualization I used the iLanguage together with some extra packages and my own code.
It recently became rather straightforward to build web application to using (R?) as the backend, inspired by the conference, I build a simple app to demonstrate the concept. On the left you can chose plotting parameters and upload the data, and on the right you can see the output of the curve.
This particular data is a newer and cleaner dataset and also the curve is a different one, and you can see this one has a lot of detail with a high about lunchtime. We can also plot the data by week days, so these are Friday, Saturday, and Sunday and so on.
Unfortunately I have far too much missing data to really compare the curves between each other but basically they are roughly the same.
I also have some Fitbit data available, so I thought I would put the activity information on the graphs to see if activity gets reflected on the curve. So next will be plots of daily heartrates, and this is just one day and no aggregation. And unfortunately in this case I have too much missing data to even make the curves make sense. But we can find a couple of curves that have enough data and a couple of days that have enough data to plot the curves.
And these two days were quite active with my Fitbit step count, and we can see here the daily high is a bit tired to the other curves.
So what have I learned or the bottom line. I’m looking for a better way to track my heartrate hopefully some emergent technology that offer a more reliable and comfortable option. I think an average curve might be an interesting option to represent a typical heartrate.
I’d like to get your thought on visualizing heartrate data with this kind of typical curve. Also if anyone is interested in the same field then perhaps has some of his own heartrate data to visualize and share please contact me.
Next, I would like to thank the European Social Fund for co-financing my studies, and I would like to thank the organizers for having me here and the audience for your attention. Also this is the link to the app and you can try out and my email here.