| apply_oakley | R Documentation |
The Oakley sleep scoring algorithm classifies each epoch as asleep or awake from wrist activity counts. It was developed for the Actiwatch activity monitoring system.
apply_oakley(agdb, threshold = 40)
agdb |
A |
threshold |
Numeric wake threshold, or |
Oakley's weighted activity score is the sum of activity counts in a window
centred on the epoch, multiplied by epoch-length-specific weights. For
60-second data, the score at epoch t is
0.04 * count[t - 2] + 0.20 * count[t - 1] + count[t] + 0.20 * count[t + 1] + 0.04 * count[t + 2]
The method uses the axis1 count directly. The weights for 15-, 30-, and
120-second epochs are those specified in the Actiwatch software manual.
Counts outside the observed series are treated as zero when scoring the
first and last epochs.
With threshold = "automatic", the wake threshold is calculated separately
for each group as 0.88888 * sum(count) / mobile_time_minutes. An epoch is
mobile when its count is at least the number of 15-second intervals in that
epoch. mobile_time_minutes is the number of mobile epochs multiplied by
the epoch length in minutes.
A tibble of activity data. A new column sleep indicates whether
each epoch is scored as asleep ("S") or awake ("W").
Oakley NR. Validation with Polysomnography of the Sleepwatch Sleep/Wake Scoring Algorithm Used by the Actiwatch Activity Monitoring System. Technical Report. Mini-Mitter; 1997.
Actiwatch Communication and Sleep Analysis Software instruction manual. Respironics, Inc. Available at https://fccid.io/JIAAWR1/Users-Manual/USERS-MANUAL-1-920937.
The implementation and weights were cross-checked against the
pyActigraphy Oakley documentation.
Its source implementation
was also consulted.
apply_sadeh(), apply_cole_kripke()
library("dplyr")
data("gtxplus1day")
gtxplus1day %>%
collapse_epochs(60) %>%
apply_oakley()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.