TwoRegression-Function | R Documentation |
Acts as a generic function that dispatches to specific implementation
functions (crouter_2006
, crouter_2010
,
crouter_2012
, or hibbing_2018
)
TwoRegression( AG, method = c("Crouter 2006", "Crouter 2010", "Crouter 2012", "Hibbing 2018"), verbose = FALSE, ... ) crouter_2006(AG, movement_var, time_var, ...) crouter_2010(AG, movement_var, time_var, ...) crouter_2012(AG, movement_var, time_var, model, check = TRUE, ...) hibbing_2018( AG, accel_var = "ENMO", gyro_var = "GVM", direction_var = "Direction", time_var = "Timestamp", site = c("Hip", "Left Wrist", "Right Wrist", "Left Ankle", "Right Ankle"), algorithm = 1:3, smooth = FALSE, verbose = FALSE, ... )
AG |
data frame of ActiGraph data |
method |
character scalar telling which model to apply to the data.
Currently supported selections are |
verbose |
logical. Print updates to console? |
... |
arguments passed to the implementation function indicated by
|
movement_var |
character scalar. Name of the movement variable (default
is |
time_var |
character scalar. Name of the timestamp variable (required to verify that input epoch length is 10 seconds) |
model |
character scalar. One of |
check |
Logical. Should a warning be issued that will prompt you to check that the selected model matches the selected movement variable? |
accel_var |
Character scalar. Name of accelerometer variable to operate on (expected format is Euclidian Norm Minus One, in milli-gravitational units) |
gyro_var |
character scalar. Name of gyroscope variable to operate on (expected format is gyroscope vector magnitude, in degrees per second) |
direction_var |
character scalar. Name of magnetometer variable to
operate on (expected format is a vector of directions, likely produced by
|
site |
character scalar or vector of attachment sites (more than one may be desired, e.g., if results are to be compared from running both of the wrist-specific algorithms) |
algorithm |
An integer/numeric scalar or vector giving the algorithm(s)
to apply to the data from the primary accelerometer and (if applicable)
IMU. Must be |
smooth |
logical. Should data be averaged over a longer time period after processing? |
The original data appended with columns giving activity classification (sedentary, ambulatory, or intermittent) and energy expenditure (i.e, METs)
Crouter et al. (2006, J Appl Physiol) Crouter et al. (2010, Med Sci Sports Exerc) Crouter et al. (2012, Med Sci Sports Exerc) Hibbing et al. (2018, Med Sci Sports Exerc)
apply_two_regression_hibbing18
smooth_2rm
## Datasets data(count_data, package = "TwoRegression") data(all_data, package = "TwoRegression") ## Crouter 2006-2012 models TwoRegression( count_data, "Crouter 2006", movement_var = "Axis1", time_var = "time" ) TwoRegression( count_data, "Crouter 2010", movement_var = "Axis1", time_var = "time" ) TwoRegression( count_data, "Crouter 2012", movement_var = "Axis1", time_var = "time", model = "VA", check = FALSE ) TwoRegression( count_data, "Crouter 2012", movement_var = "Vector.Magnitude", time_var = "time", model = "VM", check = FALSE ) ## Hibbing 2018 models (can be vectorized) all_data$ENMO_CV10s <- NULL all_data$GVM_CV10s <- NULL all_data$Direction <- NULL result <- TwoRegression( all_data, "Hibbing 2018", gyro_var = "Gyroscope_VM_DegPerS", direction_var = "mean_magnetometer_direction", site = c("Left Ankle", "Right Ankle"), algorithm = 1:2 ) utils::head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.