apply_choi: Apply the Choi algorithm

View source: R/apply_choi.R

apply_choiR Documentation

Apply the Choi algorithm

Description

The Choi 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.

Usage

apply_choi(
  agdb,
  min_period_len = 90,
  min_window_len = 30,
  spike_tolerance = 2,
  use_magnitude = FALSE
)

Arguments

agdb

A tibble of activity data with an epochlength attribute. The epoch length must be 60 seconds.

min_period_len

Minimum number of consecutive "zero" epochs to start a non-wear period. The default is 90.

min_window_len

The minimum number of consecutive "zero" epochs immediately preceding and following a spike of artifactual movement. The default is 30.

spike_tolerance

Also known as artifactual movement interval. At most spike_tolerance "nonzero" epochs can occur in sequence during a non-wear period without interrupting it. The default is 2.

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.

Details

The Choi algorithm extends the Troiano algorithm by requiring that short spikes of artifactual movement during a non-wear period are preceded and followed by min_window_len consecutive "zero" epochs.

This implementation of the algorithm expects that the epochs are 60 second long.

Value

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.

References

L Choi, Z Liu, CE Matthews and MS Buchowski. Validation of accelerometer wear and nonwear time classification algorithm. Medicine & Science in Sports & Exercise, 43(2):357–364, 2011.

ActiLife 6 User's Manual by the ActiGraph Software Department. 04/03/2012.

See Also

apply_troiano(), collapse_epochs()

Examples

library("dplyr")
data("gtxplus1day")

gtxplus1day %>%
  collapse_epochs(60) %>%
  apply_choi()

dipetkov/actigraph.sleepr documentation built on March 25, 2022, 2:33 a.m.