Fragmentation methods to study the transition between two states, e.g.
sedentary v.s. active.This function is a whole dataset wrapper for fragmentation
fragmentation_long2(
count.data,
weartime,
thresh,
bout.length = 1,
metrics = c("mean_bout", "TP", "Gini", "power", "hazard", "all"),
by = c("day", "subject")
)
data.frame
of dimension n*1442 containing the 1440 minutes of activity data for all n subject days.
The first two columns have to be ID and Day. ID can be either character
or numeric
. Day has to be numeric
indicating
the sequency of days within each subject.
data.frame
with dimension of count.data
.
The first two columns have to be ID and Day.ID can be either character
or numeric
. Day has to be numeric
indicating
the sequencey of days within each subject.
threshold to define the two states.
minimum duration of defining an active bout; defaults to 1.
What is the fragmentation metrics to exract. Can be "mean_bout","TP","Gini","power","hazard",or all the above metrics "all".
Determine whether fragmentation is calcualted by day or by subjects (i.e. aggregate bouts across days). by-subject is recommended to gain more power.
A dataframe with some of the following columns
identifier of the person
numeric
vector indicating the sequencey of days within each subject.
mean sedentary bout duration
mean active bout duration
sedentary to active transition probability
bactive to sedentary transition probability
Gini index for active bout
Gini index for sedentary bout
hazard function for sedentary bout
hazard function for active bout
power law parameter for sedentary bout
power law parameter for active bout
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)