McVeighFcn: McVeighFcn

Description Usage Arguments Value Author(s) References Examples

View source: R/McVeighFcn_v5.r

Description

McVeighFcn is used to process minute-level accelerometer data from devices worn over 24 hours with the McVeigh algorithm to identify instances of in-bed versus sleep time. The McVeigh specification for determining non-wear time can be used or a non-wear vector calculated via some other methodology can be input.

Usage

1
2
3
4
5
6
7
McVeighFcn(timevec, cpmvec, nwvec= NULL, rollwin = 30,
slthresh = 88, slperiod = 180, wkperiod = 10,
prslthresh1 = 89, prslthresh2 = 50, prslcount = 4,
prwkthresh1 = 91, prwkthresh2 = 200, prwkcount = 3,
spurthresh = 2.5*60, nwperiod = 90, nwctsgt0 = 3,
nwmaxct = 50,    vhighpct = 0.9, highpct = 0.8,
modpct = 0.5,fairtime = 14*60,  validday = 10*60)

Arguments

timevec

vector detailing the time of each observation. Must be minute-level data. The specified format is <e2><80><9c>POSIX<e2><80><9d>. When timevec is a <e2><80><9c>POSIX<e2><80><9d> variable, an error will be returned if successive measurements are not separated by one minute. If timevec is not a <e2><80><9c>POSIX<e2><80><9d> variable, rows will be assumed to spaced one-minute apart and the calculation of validday and validinbed variables will not be possible.

cpmvec

vector summarizing activity level in cpm at each observation point. Must be same length as timevec.

nwvec

optional vector specifying non-wear observations. If left as NULL, nonwear observations will be calculated via McVeigh<e2><80><99>s algorithm.

rollwin

number of minutes on either side of an observation to be used to calculate moving/rolling average. If the entire size of rollwin is not available (e.g., observation 2, with rollwin = 5), the number number of measurements available are used (e.g, observations 1:8 in the example above).

slthresh

threshold defining low versus high activity.

slperiod

consecutive time (in minutes) of rolling average low activity require to define approximate into-bed times.

wkperiod

consecutive time (in minutes) of rolling average high activity require to define approximate out-of-bed times.

prslthresh1

threshold for individual cpm measurements when calculating precise into-bed times.

prslthresh2

along with prslcount, used to assess 10-minute intervals to calculate precise into-bed times.

prslcount

threshold for number of cpm observations below prslthresh2 when calculating precise into-bed times.

prwkthresh1

threshold for individual cpm measurements when calculating precise out-of-bed times.

prwkthresh2

Along with prwkcount, used to assess 10-minute intervals to calculate precise out-of-bed times.

prwkcount

threshold for number of cpm observations below prwkthresh2 when calculating precise out-of-bed times.

spurthresh

time in minutes between consecutive in-bed periods used to classify spurious data. When the interval between 2 in-bed periods < spurthresh, a new in-bed period corresponding to this interval is created.

nwperiod

length of interval in minutes considered for non-wear calculations.

nwctsgt0

number non-zero measurements within nwperiod allowed for non-wear classification.

nwmaxct

threshold for maximum value allowed when classifying non-wear intervals.

vhighpct

in-bed period with a proportion <e2><89><a5> vhighpct of non-wear measurements is considered a non-wear in-bed period.

highpct

in-bed period with a proportion <e2><89><a5> highpct of non-wear measurements and remaining proportion <e2><89><a4> slperiod is considered a non-wear in-bed period.

modpct

in-bed period with a proportion <e2><89><a4> modpct of non-wear measurements that is less than <e2><89><a4> fairtime is considered a wear in-bed period.

fairtime

maximum time allowed for wear in-bed period.

validday

number of minutes of waking wear required for a day to be considered valid.

Value

McVeighFcn returns a data frame with the following variables:

time

the input timevec vector.

cpm

the input cpmvec vector.

nw

either the input nwvec vector or the calculated non-wear vector.

inbed

binary variable indicating whether observation is an in-bed observation.

wakingwear

binary variable indicating whether observation is a waking wear observation.

validday

binary variable indicating whether observation occurred on a valid day. If timevec is not of type <e2><80><9c>POSIX<e2><80><9d>, NA will be returned for this variable.

validinbed

binary variable indicating whether observation is an inbed observation from a valid day. If timevec is not of type <e2><80><9c>POSIX<e2><80><9d>, NA will be returned for this variable.

Author(s)

Vincent Berarardi,Assistant Professor, Chapman University, Department of Psychology; John Bellettiere, Post Doctoral Research Fellow, University of California San Diego

References

McVeigh, J. A., Winkler, E. A., Healy, G. N., Slater, J., Eastwood, P. R., & Straker, L. M. (2016). Validity of an automated algorithm to identify waking and in-bed wear time in hip-worn accelerometer data collected with a 24 h wear protocol in young adults. Physiological Measurement, 37(10), 1636.

Examples

1
2
3
4
5
6
7
8
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x)
{
  }

vancebee/McVeighFcn documentation built on May 24, 2019, 7:50 a.m.