View source: R/apply_troiano.R
apply_troiano | R Documentation |
The Troiano algorithm detects periods of non-wear in activity data from an ActiGraph device. Such intervals are likely to represent invalid data and therefore should be excluded from downstream analysis. The algorithm formalizes a technique used to analyze the 2003-2004 NHANES data; the original SAS source code can be found at https://riskfactor.cancer.gov/tools/nhanes_pam/.
apply_troiano( agdb, activity_threshold = 0, min_period_len = 60, max_nonzero_count = Inf, spike_tolerance = 2, spike_stoplevel = 100, use_magnitude = FALSE, endat_nnz_seq = TRUE )
agdb |
A |
activity_threshold |
Highest activity level to be considered "zero"; an epoch with activity exceeding the threshold is considered a "spike". The default threshold is 0. |
min_period_len |
Minimum number of consecutive "zero" epoch to start a non-wear period. The default is 60. |
max_nonzero_count |
Epochs with activity greater than
|
spike_tolerance |
Also known as artifactual movement interval.
At most |
spike_stoplevel |
An activity spike that exceeds |
use_magnitude |
Logical. If true, the magnitude of the vector (axis1, axis2, axis3) is used to measure activity; otherwise the axis1 value is used. The default is FALSE. |
endat_nnz_seq |
Logical. If true, a non-wear period ends with a run
of nonzero epochs that is longer than |
The Troiano algorithm specifies that a non-wear period starts with
min_period_len
consecutive epochs/minutes of "zero" activity
and ends with more than spike_tolerance
epochs/minutes of
"nonzero" activity.
This implementation of the algorithm expects 60s epochs.
A summary tibble
of the detected non-wear periods.
If the activity data is grouped, then non-wear periods are detected
separately for each group.
RP Troiano, D Berrigan, KW Dodd, LC Mâsse, T Tilert and M McDowell. Physical activity in the united states measured by accelerometer. Medicine & Science in Sports & Exercise, 40(1):181–188, 2008.
ActiLife 6 User's Manual by the ActiGraph Software Department. 04/03/2012.
apply_choi()
, collapse_epochs()
library("dplyr") data("gtxplus1day") gtxplus1day %>% collapse_epochs(60) %>% apply_troiano()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.