Description Usage Arguments Details Value References Examples
View source: R/fragmentation.R
Fragmentation methods to study the transition between two states, e.g. sedentary v.s. active.
1 2 | fragmentation(x, w, thresh, bout.length = 1, metrics = c("mean_bout",
"TP", "Gini", "power", "hazard", "all"))
|
x |
|
w |
|
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". |
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)
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 |
Di et al. Patterns of sedentary and active time accumulation are associated with mortality in US adults: The NHANES study.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.