fragmentation: Fragmentation Metrics

Description Usage Arguments Details Value References Examples

View source: R/fragmentation.R

Description

Fragmentation methods to study the transition between two states, e.g. sedentary v.s. active.

Usage

1
2
fragmentation(x, w, thresh, bout.length = 1, metrics = c("mean_bout",
  "TP", "Gini", "power", "hazard", "all"))

Arguments

x

integer vector of activity data.

w

vector of wear flag data with same dimension as x.

thresh

threshold to binarize the data.

bout.length

minimum duration of defining an active bout; defaults to 1.

metrics

What is the fragmentation metrics to exract. Can be "mean_bout","TP","Gini","power","hazard",or all the above metrics "all".

Details

Metrics include mean_bout (mean bout duration), TP (between states transition probability), Gini (gini index), power (alapha parameter for power law distribution) hazard (average hazard function)

Value

A list with elements

mean_r

mean sedentary bout duration

mean_a

mean active bout duration

SATP

sedentary to active transition probability

ASTP

bactive to sedentary transition probability

Gini_r

Gini index for active bout

Gini_a

Gini index for sedentary bout

h_r

hazard function for sedentary bout

h_a

hazard function for active bout

alpha_r

power law parameter for sedentary bout

alpha_a

power law parameter for active bout

References

Di et al. Patterns of sedentary and active time accumulation are associated with mortality in US adults: The NHANES study.

Examples

1
2
3
4
data(example_activity_data)
count1 = c(t(example_activity_data$count[1,-c(1,2)]))
wear1 = c(t(example_activity_data$wear[1,-c(1,2)]))
frag = fragmentation(x = count1, w = wear1, thresh = 100, bout.length = 1, metrics = "mean_bout")

junruidi/actigraphy documentation built on Sept. 25, 2019, 7:48 a.m.