{"id":753,"date":"2020-03-06T18:07:37","date_gmt":"2020-03-06T22:07:37","guid":{"rendered":"http:\/\/sites.nd.edu\/nethealth\/?page_id=753"},"modified":"2020-03-06T18:07:37","modified_gmt":"2020-03-06T22:07:37","slug":"fitbit-data","status":"publish","type":"page","link":"https:\/\/sites.nd.edu\/nethealth\/fitbit-data\/","title":{"rendered":"Fitbit Data"},"content":{"rendered":"<p><span style=\"font-weight: 400\">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).\u00a0 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.\u00a0 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<\/span><a href=\"https:\/\/drive.google.com\/open?id=1W-2oNwdJ3njahNyFxsUPA1Ma09owifA_\"><span style=\"font-weight: 400\"> NetHealth Fitbit Database Documentation <\/span><\/a><span style=\"font-weight: 400\">prepared by Rachel Purta.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">We have created two datafiles from the stored data &#8212; a daily activity file and a daily sleep file.\u00a0 The records in these files are pairs {<\/span><i><span style=\"font-weight: 400\">egoid<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">datadate<\/span><\/i><span style=\"font-weight: 400\">}.\u00a0 For each study participant (<\/span><i><span style=\"font-weight: 400\">egoid<\/span><\/i><span style=\"font-weight: 400\"> using non-identifying case number), there is a record for each day (<\/span><i><span style=\"font-weight: 400\"> datadate<\/span><\/i><span style=\"font-weight: 400\"> formatted \u00a0 YYYY-MM-DD) they were participating in the study.\u00a0 Some students received their Fitbits prior to arriving at ND, so there are daily records beginning in early August of 2015.\u00a0 The daily sleep file has 333,708 records, the daily activity file 357,827.\u00a0\u00a0<\/span><\/p>\n<p><b>Daily Activity Data<\/b><\/p>\n<p><span style=\"font-weight: 400\">Fitbit devices use data from two sensors to compute various measures of activity: a 3-axis accelerometer and a heart rate sensor.\u00a0 From the accelerometer data, Fitbit computes daily counts of <\/span><i><span style=\"font-weight: 400\">steps<\/span><\/i><span style=\"font-weight: 400\"> and <\/span><i><span style=\"font-weight: 400\">floors<\/span><\/i><span style=\"font-weight: 400\"> climbed.\u00a0 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:\u00a0 <\/span><i><span style=\"font-weight: 400\">sedentary, lightly active, fairly active <\/span><\/i><span style=\"font-weight: 400\">and<\/span><i><span style=\"font-weight: 400\"> very active.<\/span><\/i><span style=\"font-weight: 400\">\u00a0 Fitbit aggregates this data to compute daily minutes in each of these activity zones.\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">From the heart rate sensor data, Fitbit calculates for every non-sleeping minute whether a person is in one of four categories: <\/span><i><span style=\"font-weight: 400\">low range, fat burn, cardio, <\/span><\/i><span style=\"font-weight: 400\">or<\/span><i><span style=\"font-weight: 400\"> peak<\/span><\/i><span style=\"font-weight: 400\">.\u00a0 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.\u00a0 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).\u00a0 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.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">We use the raw minute-by-minute heart rate data (which is not being released) to compute a person\u2019s 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.\u00a0 When a person does not wear their fitbit, the heart rate is logged as zero, so subtracting the number of \u201czero\u201d 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.\u00a0\u00a0\u00a0<\/span><\/p>\n<p><b>Daily Sleep data<\/b><\/p>\n<p><span style=\"font-weight: 400\">Fitbit uses its sensors to determine when someone is asleep and when they are awake.\u00a0 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.\u00a0 We decided to combine sleep periods into 1 sleep period if the time between sleep periods is less than 30 minutes.\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">For each sleep period we know:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Date (<\/span><i><span style=\"font-weight: 400\">dataDate<\/span><\/i><span style=\"font-weight: 400\">):\u00a0 the day when the sleep period ended in YYYY-MM-DD format<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">time they went to bed (<\/span><i><span style=\"font-weight: 400\">timetobed<\/span><\/i><span style=\"font-weight: 400\">)\u00a0 in HH:MM:SS 24-hour format.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">time they got out of bed (<\/span><i><span style=\"font-weight: 400\">timeoutofbed<\/span><\/i><span style=\"font-weight: 400\">)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Minutes in bed (<\/span><i><span style=\"font-weight: 400\">bedtimeduration<\/span><\/i><span style=\"font-weight: 400\">):\u00a0 difference between <\/span><i><span style=\"font-weight: 400\">timetobed<\/span><\/i><span style=\"font-weight: 400\"> and <\/span><i><span style=\"font-weight: 400\">timeoutofbed<\/span><\/i><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Minutes to fall asleep (<\/span><i><span style=\"font-weight: 400\">minstofallasleep<\/span><\/i><span style=\"font-weight: 400\">):\u00a0 How long a person was in bed prior to falling asleep<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Minutes awake before getting out of bed (<\/span><i><span style=\"font-weight: 400\">minsafterwakeup<\/span><\/i><span style=\"font-weight: 400\">): How long a person stayed in bed after waking up.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Minutes awake (<\/span><i><span style=\"font-weight: 400\">minsawake<\/span><\/i><span style=\"font-weight: 400\">):\u00a0 The number of minutes a person was awake during the sleep period.\u00a0 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.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Minutes asleep (minsasleep):\u00a0 Minutes asleep computed as:<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">(bedtimedur &#8211; minstofallasleep &#8211; minsafterwakeup &#8211; minsawake)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Sleep Efficiency (Efficiency):\u00a0 The ratio of minutes asleep (minsasleep) to the sum of minutes asleep and minutes awake (minsawake).\u00a0 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\u00a0 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.\u00a0\u00a0<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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).\u00a0 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 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sites.nd.edu\/nethealth\/fitbit-data\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fitbit Data&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2811,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-753","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/pages\/753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/users\/2811"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/comments?post=753"}],"version-history":[{"count":1,"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/pages\/753\/revisions"}],"predecessor-version":[{"id":755,"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/pages\/753\/revisions\/755"}],"wp:attachment":[{"href":"https:\/\/sites.nd.edu\/nethealth\/wp-json\/wp\/v2\/media?parent=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}