Bedrest Marking, Youth Waist

Description

This function is for processing data obtained from Actigraph accelerometer a youth (10-18 y.o.) has worn on his or her waist. It applies an automated algorithm to mark each epoch as either bedrest or active. The function is intended as an alternative to those identifying "sleep". Tracy et al. (2014) show that the function is more accurate than the Sadeh algorithm at identifying these behaviors. The output file contains an additional (compared to input) "bedrest" column. The column has a return of "a" for activity or "br" for bedtime rest in each line (i.e. epoch). An additional option allows for a nap ("n") classification. The "n" differs from "br" only in how long the bedrest period is. The cutoff is specifiable, see below. The function is designed to be used after wear marking function in Physical Activity package.

Usage

1
markbr_y_wa(dset, TS, col, rstdr, rstfl, TH, wd, nmin, nmax, nvm)

Arguments

dset

a matrix containing the following columns:

TS

[Optional] a "timestamp" column (m)m/dd/yyyy (h)h:mm (24h) created by the timestamp function. The default is "TS".

col

[Optional] column name of Axis or Vector Magnitude used in analysis. The default is "Axis1.

rstdr

[Optional] A folder to place resulting csv files, which are supplemented with the bedrest column .The default is the working directory.

rstfl

[Optional] The name to be assigned to the csv file with the beginning and end time for each interval classified as bedtime rest. The default is "subj_bdr_sum".

TH

[Optional] A threshold for the maximum average of counts/min in each 1-hour block. In the first step of analysis, a block with the average counts/min below the threshold is classified as bedtime rest. (Fine analysis is applied to block where there are transitions.) The default value is 20 counts/min.

wd

[Optional] A threshold for the minimum number of counts/min required in the first epoch (e.g., min) to be marked as activity. The default is 500 counts/min.

nmin

[Optional]nap minimum–The minimum number of minutes to be classified as a napping interval. The default value is 60 minutes.

nmax

[Optional] nap maximum–The maximum number of minutes to be classified as napping interval. The default value is 60 minutes.

nvm

[Optional] negligible vertical movement (CP_0)– the number of counts below which movement is classified to be sleep in the fine (upstream) search of transitional periods. Further details and rationale are in Tracy et al. paper (2014). The default CP_0 value is 50 counts/min.

Details

This function is designed to be used after the "wear marking" function in the Physical Activity package is applied to identify accelerometer nonwear time intervals from the dataset. This step can be used to eliminate time intervals that the function will classify as bedtime rest. In addition to the return dataframe, the function also generates a csv file with a column for the beginning and end time points of intervals classified as bedtime rest. These files could be read and merged into batch files and reviewed for accuracy.

The default input values used were found to maximize (sensitivity * specificity) Axis1 data for youths in the study described in Tracy et al. (2014). The default values can be changed to investigator-selected values (e.g. threshold for maximum number of counts). Data in the column with counts (col) could be replaced by vector magnitude (VM) data obtained from triaxial accelerometer. Waist function differs from Wrist function in the defaults for "TH" and "Wakedelta". These functions could process data from accelerometers worn at other locations (e.g. ankle) or other populations (e.g. adults) if appropriate values for "TH" and "Wakedelta" were available.

Value

A data frame with an additional column, "BedRest". Bedrest will return "br" for bedtime rest and "a" activity in each line. Options also allow for "n" nap which only differ than "br" in being for a shorter (specifiable) time period.

Note

nmin and nmax work in tandem. Setting them equal, as is the default does returns no nap intervals. To mark naps differently than other Bedrest, nmin must be less than nmax, e.g. 60 and 120 minutes, respectively. If this is the case, time intervals below the 60 min threshold (nmin) are classified as activity ("a"), those between 60 and 120 min are classified as nap ("n"), and those greater than 120 min (nmax) are classified as bedtime rest ("br").

Author(s)

J. Dustin Tracy <jtracy2@student.gsu.edu>, Zhiyi Xu, Leena Choi, Sari Acra, Kong Y. Chen, Maciej S. Buchowski

References

Tracy JD, Xu Z, Choi L, Acra S, Chen KY and Buchowski MS(2014) Separating bedtime rest from activity using waist or wrist-worn accelerometers in youth. PLoS one DOI: 10.1371/journal.pone.0092512

See Also

PhysicalActivity.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(zPhysActBedRest)


##  Example 1:  
##  wa_sj6909_ts = read.csv("wa_sj6909_ts.csv")
    wa_sj6909_slp = markbr_y_wa(wa_sj6909_ts)

##	Example 2:   
##  Create a folder in the working director called "marked" 
##  wa_sl3611_lts = read.csv("wa_sl3611_timestamp.csv")
    wa_sl3611_sleep = markbr_y_wa(wa_sl3611_lts,
    TS = "tstmp",
    col = "cnt",
##  rstdr = "marked",
    rstfl = "wa_sl3611_bdr_sum",
    TH = 25,
    wd = 550,
    nmin = 60,
    nmax = 120,
    nvm = 25)