markDelivery: Classify Mail Delivery and Non-Delivery Days for...

Description Usage Arguments Value Author(s) Examples

View source: R/markDelivery.R

Description

This function adds an indicator variable for accelerometer delivery days based on a delivery classification algorithm. The algorithm classifies each day as delivery or non-delivery day within each participant data using summary statistics of accelerometer counts for each day. As the summary statistics, the 95th percentile, mean and standard deviation (sd) of accelerometer counts can be used. Using the summary statistics for each day, the algorithm defines a set of days that are used to estimate the 95% confidence interval (CI) based on t-distribution (default) or normal distribution. The lower bound of the 95% CI is used to classify delivery days; if the summary statistics for a day is below the lower bound of the 95% CI, this day is classified as delivery day. Three methods for defining a set of days are available: trim (default), consecutive, and valid.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
markDelivery(
  data,
  cts = getOption("pa.cts"),
  markingString = "w",
  window = c("trim", "consecutive", "valid"),
  method = c("95", "mean", "sd"),
  validCut = getOption("pa.validCut"),
  wearThreshold = 300,
  dist = c("t", "normal")
)

Arguments

data

Data with classified wear (nonwear) status by wearingMarking.

cts

The name of the counts column. The default is “axis1”.

markingString

Option for summarizing wear (markingString = “w”) or nonwear time (markingString = “nw”).

window

A character. It should be one of ‘trim’, ‘consecutive’, or ‘valid’.

method

A character. It should be one of ‘95’, ‘mean’ or ‘sd’.

validCut

A cutoff for the total minutes of classified monitor wear time per day to be considered as a valid monitor day.

wearThreshold

A numeric value specifying a pseudo-valid day cutoff similar to “validCut”, which is used to define a set of days to estimate the 95% CI.

dist

Option for distribution used to calculate the 95% CI.

Value

A data frame with summary information about daily counts.

Author(s)

Cole Beck cole.beck@vumc.org, Leena Choi leena.choi@Vanderbilt.Edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(deliveryData)

options(pa.cts = "vm")
wm <- wearingMarking(dataset = deliveryData)

markDelivery(wm)
plotData(data=wm) # days 1, 2, 10 - 15 are delivery or invalid days based on the result above
markDelivery(wm, window='valid', method='mean')
markDelivery(wm, method='mean')
markDelivery(wm, method='sd')

PhysicalActivity documentation built on Jan. 23, 2021, 1:06 a.m.