Fitbit Data

NetHealth participants were given a Fitbit HR upon joining the study and asked to wear it all the time (except when it could get wet).  We updated the Fitbit devices in the Winter of 2018 to Charge 2s for those who were continuing in the study. Each study participant was given a password that they had to use to activate their account and which we needed to know in order to automate retrieval of Fitbit data from the Fitbit Cloud through an API.  An enormous amount of data was retrieved and stored. Full documentation of all the data collected and the various data tables is available in the document NetHealth Fitbit Database Documentation prepared by Rachel Purta. 

We have created two datafiles from the stored data — a daily activity file and a daily sleep file.  The records in these files are pairs {egoid, datadate}.  For each study participant (egoid using non-identifying case number), there is a record for each day ( datadate formatted   YYYY-MM-DD) they were participating in the study.  Some students received their Fitbits prior to arriving at ND, so there are daily records beginning in early August of 2015.  The daily sleep file has 333,708 records, the daily activity file 357,827.  

Daily Activity Data

Fitbit devices use data from two sensors to compute various measures of activity: a 3-axis accelerometer and a heart rate sensor.  From the accelerometer data, Fitbit computes daily counts of steps and floors climbed.  It also calculates for every non-sleeping minute of the day whether a person is in one of four states based on the accelerometer reading:  sedentary, lightly active, fairly active and very active.  Fitbit aggregates this data to compute daily minutes in each of these activity zones.  

From the heart rate sensor data, Fitbit calculates for every non-sleeping minute whether a person is in one of four categories: low range, fat burn, cardio, or peak.  Fitbit aggregates this data to compute daily minutes in each of these heart rate zones. Fitbit also converts minutes in each heart-rate zone into calories burned in each zone.  Fitbit does this conversion by first converting a minute in each zone into METs (metabolic equivalent of task, where 1 MET is how much energy a person uses up while at rest) and then converting METs into calories burnt based on a persons BMR (Basal Metabolic Rate, the number of calories required to keep a body functioning at rest, which is based on a persons age, sex, and BMI).  While we include in the data file the Fitbit computed measures of number of calories burned in each zone, we recommend using the measures of the minutes in each zone. 

We use the raw minute-by-minute heart rate data (which is not being released) to compute a person’s daily mean heart rate, its standard deviation, and our Fitbit compliance score which indicates the percentage of each day that a person was wearing a Fitbit.  When a person does not wear their fitbit, the heart rate is logged as zero, so subtracting the number of “zero” minutes from 1440 minutes in a day and dividing by 1440 givens us the percentage of minutes in that day the person wore their Fitbit.   

Daily Sleep data

Fitbit uses its sensors to determine when someone is asleep and when they are awake.  Persons are able to have multiple sleep periods in a day. We examined the distribution of times between consecutive sleep periods and found that while most were fairly long, some were short.  We decided to combine sleep periods into 1 sleep period if the time between sleep periods is less than 30 minutes.  

For each sleep period we know:

    • Date (dataDate):  the day when the sleep period ended in YYYY-MM-DD format
    • time they went to bed (timetobed)  in HH:MM:SS 24-hour format.  
    • time they got out of bed (timeoutofbed)
    • Minutes in bed (bedtimeduration):  difference between timetobed and timeoutofbed
    • Minutes to fall asleep (minstofallasleep):  How long a person was in bed prior to falling asleep
    • Minutes awake before getting out of bed (minsafterwakeup): How long a person stayed in bed after waking up.
    • Minutes awake (minsawake):  The number of minutes a person was awake during the sleep period.  In the case of combined sleep periods, the number of minutes between the two sleep periods is added to the sum of the number of minutes awake during each time period.
    • Minutes asleep (minsasleep):  Minutes asleep computed as:
      (bedtimedur – minstofallasleep – minsafterwakeup – minsawake)
    • Sleep Efficiency (Efficiency):  The ratio of minutes asleep (minsasleep) to the sum of minutes asleep and minutes awake (minsawake).  Because minsasleep deducts from total duration in bed the amounts of time it took a person to fall asleep and/or get out of bed, efficiency is calculated on the period from when an in-bed  person falls asleep to when they wake up and excludes the period when awake and in bed, and when awake before getting out of bed.