Accepted for/Published in: Journal of Medical Internet Research
Date Submitted: Jan 24, 2025
Open Peer Review Period: Jan 25, 2025 - Mar 22, 2025
Date Accepted: Apr 23, 2025
(closed for review but you can still tweet)
Capturing Real-World Habitual Sleep Patterns with a Novel User-centric Algorithm to Pre-Process Fitbit Data in the All of Us Research Program: Retrospective observational longitudinal study.
ABSTRACT
Background:
Commercial wearables like Fitbits quantify sleep metrics using fixed calendar times as the default measurement periods, which may not adequately account for individual variations in sleep patterns. To address this, experts in sleep medicine and wearables developed a user-centric algorithm that more accurately reflects actual sleep behaviors, aiming to improve wearable-derived sleep metrics.
Objective:
The study aimed to describe the development of the new (user-centric) algorithm, and how it compares with the default (calendar-relative), and offers best practices for analyzing All of Us Fitbit sleep data on a cloud platform.
Methods:
The default and new algorithms was implemented to pre-process and then compute sleep metrics related to schedule, duration, and disturbances using high-resolution Fitbit sleep data from 8,563 participants (median age 58.1 years, 72% female) in the All of Us Research Program (v7 Controlled Tier). Variation in typical sleep patterns was computed by taking the differences in the mean number of primary sleep logs classified by each algorithm. Linear mixed-effects models were used to compare differences in sleep metrics across quartiles of variation in typical sleep patterns.
Results:
Out of 8,452,630 total sleep logs over a median of 4.2 years of Fitbit monitoring, 401,777 (5%) non-primary sleep logs identified by default algorithm were reclassified to primary sleep by the user-centric algorithm. Variation in typical sleep patterns ranged from -0.08 to 1. Among participants with the most variation in typical sleep patterns, the new algorithm identified more total sleep time (by 17.6 minutes; P<0.001), more wake after sleep onset (by 13.9 minutes; P<0.001), and lower sleep efficiency (by 2.0%; P<0.001), on average. There were only modest differences in sleep stage metrics between the two algorithms.
Conclusions:
The user-centric algorithm captures the natural variability in sleep schedules, offering an alternative way to pre-process and evaluate sleep metrics related to schedule, duration, and disturbances. R package is publicly available to facilitate the implementation of this algorithm for clinical and translational use.
Citation
Request queued. Please wait while the file is being generated. It may take some time.
Copyright
© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.