Skip to contents

This function adds several columns to a dataset that contains accelerometer counts data. These columns concern respectively sedentary time (SED), light physical activity time (LPA), moderate physical activity time (MPA), vigorous physical activity time (VPA), metabolic equivalent of task (METs), kilocalories (kcal), and MET-hours when time is spent in moderate-to-vigorous physical activity. For the SED, LPA, MPA, and VPA columns, the function provides, for each epoch, the numeric value 1 when the value of the configured counts variable respectively fulfills the criteria of the SED, LPA, MPA, and VPA category (e.g., for the SED column, 1 may be provided if VM counts are <150 counts/min); otherwise 0 is provided. METs are computed using the compute_mets function. METs are computed using a published equation from one of the following scientific articles: Sasaki et al. (2011; doi:10.1016/j.jsams.2011.04.003); Santos-Lozano et al. (2013; 10.1055/s-0033-1337945); Freedson et al. (1998; doi: 10.1097/00005768-199805000-00021). Kilocalories are computed as follows. For non-SED epochs, MET values are multiplied by BMR expressed in kcal/min when using the Santos-Lozano et al. (2013) equations since, in that study, METs were multiples of the measured (not standard) resting metabolic rate. When using the Sasaki et al. (2011) and Freedson et al. (1998) equations, the MET values are multiplied by weight and 1/60 since, in those studies, METs were multiples of standard resting metabolic rate (i.e., 3.5 mLO2/min/kg) and a standard MET is approximately equivalent to 1 kcal/kg/h (Butte et al., 2012; doi: 10.1249/MSS.0b013e3182399c0e). For SED epochs, BMR expressed in kcal/min is directly used. BMR is computed using the compute_bmr function that uses sex, age, and weight inputs, and one of the equations retrieved from the paper by Henry et al. (2005; doi: 10.1079/PHN2005801). MET-hours are obtained by multiplying METs by time related to each epoch (e.g., 1/60e of an hour for 1-min epochs), only when the MET value is >=3. Of note, kilocalories and MET-hours are initially computed on a 1-min basis, and are then adjusted using a correction factor to correspond to the epoch duration chosen to analyse the accelerometer dataset.

Usage

mark_intensity(
  data,
  col_axis = c("vm", "axis1"),
  col_time = "time",
  col_nonwear = "non_wearing_count",
  col_wear = "wearing_count",
  sed_cutpoint = 200,
  mpa_cutpoint = 2690,
  vpa_cutpoint = 6167,
  equation = c("Sasaki et al. (2011) [Adults]", "Santos-Lozano et al. (2013) [Adults]",
    "Freedson et al. (1998) [Adults]", "Santos-Lozano et al. (2013) [Older adults]"),
  age = 40,
  weight = 70,
  sex = c("male", "female", "intersex", "undefined", "prefer not to say"),
  dates = NULL
)

Arguments

data

A dataframe obtained using the prepare_dataset and then the mark_wear_time functions.

col_axis

A character value to indicate the name of the variable to be used for determining intensity categories.

col_time

A character value to indicate the name of the variable related to time data.

col_nonwear

A character value to indicate the name of the variable used to count nonwear time.

col_wear

A character value to indicate the name of the variable used to count wear time.

sed_cutpoint

A numeric value below which time is considered as spent in sedentary behavior (in counts/min). In the case where the epoch of the dataset would be shorter than 60 s, the function will divide the cut-point value so that it corresponds to the epoch length used.

mpa_cutpoint

A numeric value at and above which time is considered as spent in moderate physical activity (in counts/min). In the case where the epoch of the dataset would be shorter than 60 s, the function will divide the cut-point value so that it corresponds to the epoch length used.

vpa_cutpoint

A numeric value at and above which time is considered as spent in vigorous physical activity (in counts/min). In the case where the epoch of the dataset would be shorter than 60 s, the function will divide the cut-point value so that it corresponds to the epoch length used.

equation

A character string to indicate the equation to be used for estimating METs.

age

A numeric value in yr.

weight

A numeric value in kg.

sex

A character value.

dates

A character vector containing the dates to be retained for analysis. The dates must be with the "YYYY-MM-DD" format.

Value

A dataframe.

Examples

file <- system.file("extdata", "acc.agd", package = "activAnalyzer")
mydata <- prepare_dataset(data = file)
mydata_with_wear_marks <- mark_wear_time(
    dataset = mydata, 
    TS = "TimeStamp", 
    to_epoch = 60,
    cts  = "vm",
    frame = 90, 
    allowanceFrame = 2, 
    streamFrame = 30
    )
#> frame is 90
#> streamFrame is 30
#> allowanceFrame is 2
mydata_with_intensity_marks <- mark_intensity(
    data = mydata_with_wear_marks, 
    col_axis = "vm", 
    equation = "Sasaki et al. (2011) [Adults]",
    sed_cutpoint = 200, 
    mpa_cutpoint = 2690, 
    vpa_cutpoint = 6167, 
    age = 32,
    weight = 67,
    sex = "male",
    )
#> You have computed intensity metrics with the mark_intensity() function using the following inputs: 
#>     axis = vm
#>     sed_cutpoint = 200 counts/min
#>     mpa_cutpoint = 2690 counts/min
#>     vpa_cutpoint = 6167 counts/min
#>     equation = Sasaki et al. (2011) [Adults]
#>     age = 32
#>     weight = 67
#>     sex = male
head(mydata_with_intensity_marks)
#>             timestamp       date     time axis1 axis2 axis3 steps lux
#> 1 2021-04-07 06:00:00 2021-04-07 06:00:00     0     0     0     0   0
#> 2 2021-04-07 06:01:00 2021-04-07 06:01:00     0     0     0     0   0
#> 3 2021-04-07 06:02:00 2021-04-07 06:02:00     0     0     0     0   0
#> 4 2021-04-07 06:03:00 2021-04-07 06:03:00     0     0     0     0   0
#> 5 2021-04-07 06:04:00 2021-04-07 06:04:00     0     0     0     0   0
#> 6 2021-04-07 06:05:00 2021-04-07 06:05:00     0     0     0     0   0
#>   inclineoff inclinestanding inclinesitting inclinelying vm wearing   weekday
#> 1         60               0              0            0  0      nw Wednesday
#> 2         60               0              0            0  0      nw Wednesday
#> 3         60               0              0            0  0      nw Wednesday
#> 4         60               0              0            0  0      nw Wednesday
#> 5         60               0              0            0  0      nw Wednesday
#> 6         60               0              0            0  0      nw Wednesday
#>   days non_wearing_count wearing_count SED LPA MPA VPA     METS   kcal
#> 1    1                 1             0   1   0   0   0 0.668876 1.0725
#> 2    1                 1             0   1   0   0   0 0.668876 1.0725
#> 3    1                 1             0   1   0   0   0 0.668876 1.0725
#> 4    1                 1             0   1   0   0   0 0.668876 1.0725
#> 5    1                 1             0   1   0   0   0 0.668876 1.0725
#> 6    1                 1             0   1   0   0   0 0.668876 1.0725
#>   mets_hours_mvpa intensity_category intensity_category_num bout
#> 1               0            Nonwear                      0    1
#> 2               0            Nonwear                      0    1
#> 3               0            Nonwear                      0    1
#> 4               0            Nonwear                      0    1
#> 5               0            Nonwear                      0    1
#> 6               0            Nonwear                      0    1