g.part5: Merge output from physical activity and sleep analysis into...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/g.part5.R

Description

Function to merge the output from g.part2 and g.part4 into one report enhanced with profiling of sleep and physical activity stratified across intensity levels and based on bouted periods as well as non-bouted periods.

Usage

1
2
3
4
5
6
7
8
9
g.part5(datadir=c(),metadatadir=c(),f0=c(),f1=c(),strategy=1,maxdur=7,
hrs.del.start=0,hrs.del.end =0,
loglocation= c(),excludefirstlast.part5=FALSE,windowsizes=c(5,900,3600), 
acc.metric="ENMO",boutcriter.mvpa=0.8,boutcriter.in=0.9,boutcriter.lig=0.8,
storefolderstructure=FALSE,threshold.lig = c(40),threshold.mod = c(100),
threshold.vig = c(400),timewindow=c("MM","WW"),boutdur.mvpa = c(1,5,10),
boutdur.in = c(10,20,30),boutdur.lig = c(1,5,10),winhr = 5,
M5L5res = 10,overwrite=FALSE,desiredtz="Europe/London",bout.metric=4,dayborder=0,
save_ms5rawlevels=FALSE)

Arguments

datadir

Directory where the accelerometer files are stored or list of accelerometer filenames and directories

metadatadir

Directory that holds a folders 'meta' and inside this a folder 'basic' which contains the milestone data produced by g.part1. The folderstructure is normally created by g.part1 and g.shell.GGIR will recognise what the value of metadatadir is.

f0

File index to start with (default = 1). Index refers to the filenames sorted in increasing order

f1

File index to finish with (defaults to number of files available)

strategy

how to deal with knowledge about study protocol. value = 1 means select data based on hrs.del.start, hrs.del.end, and maxdur. Value = 2 makes that only the data between the first midnight and the last midnight is used for imputation, see g.impute

maxdur

how many DAYS after start of experiment did experiment definitely stop? (set to zero if unknown = default), see g.impute

hrs.del.start

how many HOURS after start of experiment did wearing of monitor start?, see g.impute

hrs.del.end

how many HOURS before the end of the experiment did wearing of monitor definitely end?, see g.impute

loglocation

Location of the spreadsheet (csv) with sleep log information. The spreadsheet needs to have the following structure: one column for participant id, and then followed by alternatingly one column for onset time and one column for waking time. Timestamps are to be stored without date as in 18:20:00. If onset corresponds to lights out or intention to fall asleep, then it is the end-users responsibility to account for this in the interpretation of the results.

excludefirstlast.part5

If TRUE then the first and last night of the measurement are ignored for the sleep assessment.

windowsizes

see g.getmeta

acc.metric

Which one of the metrics do you want to consider to describe behaviour. The metric of interest need to be calculated in M (see g.part1)

boutcriter.mvpa

A number between 0 and 1 and defines what fraction of a bout needs to be above the mvpathreshold

boutcriter.in

A number between 0 and 1 and defines what fraction of a bout needs to be below the light threshold

boutcriter.lig

A number between 0 and 1 and defines what fraction of a bout needs to be between the light and moderage threshold

storefolderstructure

Store folder structure of the accelerometer data

threshold.lig

Threshold for light physical activity to separate inactivity from light. Value can be one number or an array of multiple numbers, e.g. threshold.lig =c(30,40). If multiple numbers are entered then analysis will be repliced for each combination of threshold values. Threshold is applied to the first metric in the milestone data, so if you have only specified do.ENMO == TRUE then it will be applied to ENMO.

threshold.mod

Threshold for moderate physical activity to separate light from moderate. Value can be one number or an array of multiple numbers, e.g. threshold.mod =c(100,110). If multiple numbers are entered then analysis will be repliced for each ombination of threshold values. Threshold is applied to the first metric in the milestone data, so if you have only specified do.ENMO == TRUE then it will be applied to ENMO.

threshold.vig

Threshold for vigorous physical activity to separate moderate from vigorous. Value can be one number or an array of multiple numbers, e.g. threshold.mod =c(400,500). If multiple numbers are entered then analysis will be repliced for each combination of threshold values. Threshold is applied to the first metric in the milestone data, so if you have only specified do.ENMO == TRUE then it will be applied to ENMO.

timewindow

Timewindow over which summary statistics are derived. Value can be "MM" (midnight to midnight), "WW" (waking time to waking time), or both c("MM","WW").

boutdur.mvpa

Durations of mvpa bouts in minutes to be extracted. The default values is c(1,5,10) and will start with the identification of 10 minute bouts, followed by 5 minute bouts in the rest of the data, and followed by 1 minute bouts in the rest of the data.

boutdur.in

Durations of inactivty bouts in minutes to be extracted. Inactivity bouts are detected in the segments of the data which were not labelled as sleep or MVPA bouts. The default duration values is c(10,20,30), this will start with the identification of 30 minute bouts, followed by 20 minute bouts in the rest of the data, and followed by 10 minute bouts in the rest of the data.

boutdur.lig

Durations of light activty bouts in minutes to be extracted. Light activity bouts are detected in the segments of the data which were not labelled as sleep, MVPA, or inactivity bouts. The default duration values is c(1,5,10), this will start with the identification of 10 minute bouts, followed by 5 minute bouts in the rest of the data, and followed by 1 minute bouts in the rest of the data.

M5L5res

resoltion of L5 and M5 analysis in minutes (default: 10 minutes)

overwrite

Overwrite previously generated milestone data by this function for this particular dataset. If FALSE then it will skip the previously processed files (default = FALSE).

desiredtz

see g.getmeta

bout.metric

See documnetion in g.getbout and

dayborder

Hour at which days start and end (default = 0), value = 4 would mean 4am

winhr

see g.getmeta

save_ms5rawlevels

boolean, whether to save the time series classification (levels) as a csv files

Details

This function writes all its output to an RData file The value output is a dataframe and comes with a large range of variables which hopefully are sufficiently intuitive or are already explained elsewhere in the package tutorial. When g.part5 is called from g.shell.GGIR with argument do.report = 5 then the output of g.part5 is conventiently stored in a csv spreadsheet. Therefore, you may not want/need to work with part5 directly.

Explaination of general terminology in the output of g.part5:

Example variable explanations: dur_day_OIN30_min is the time spent in minutes in other inactiivty during the day with a threshold of 30 mg not part of inactivity bouts, dur_day_MOD100_400_min is the time spent in moderate activity defined between 100 and 400mg but not part of an MVPA bout, dur_MVPA_D1T100_min is time spent in MVPA bouts defined as 100 mg or higher and lasting at least 1 minute and with no upper boundary if there is no other variable that starts with dur_MVPA_D, the existence of dur_INB_D10T30_min and dur_INB_D30T30_min indicates that dur_INB_D10T30_min corresponds to inactivity bouts lasting between 10 and 30 minutes and are defined by the threshold 30mg.

Motivation for default bout criteria for inactivity 0.9: Ssomewhat arbitrary decision, but the idea is that if you allow for bouts of 30 minutes it would not make sense to allow for breaks of 20 percent (6 minutes!) this is why I used a more stringent criteria for the highest category. Please note that you can change these criteria via arguments boutcriter.mvpa, boutcriter.in, and boutcriter.lig

Value

The function provides no values, it only ensures that other functions are called and that their output is stored in .RData files. See details.

Author(s)

Vincent T van Hees <vincentvanhees@gmail.com>

References

Examples

1
2
3
4
5
## Not run: 
metadatadir = "C:/myfolder/meta"
g.part5(metadatadir=metadatadir)

## End(Not run)

PeteJWatson/ggircal documentation built on Nov. 24, 2021, 11:14 a.m.