get_cv: Coefficient of variation for two-regression models

get_cvR Documentation

Coefficient of variation for two-regression models

Description

Calculates coefficient of variation using static or sliding methods, with potential for custom methods as well

Usage

cv_2rm(
  x,
  window_size = 10,
  approach = c("sliding", "static", "custom"),
  verbose = FALSE,
  ...
)

static_cv(x, window_size)

sliding_cv(x, window_size)

custom_cv(x, window_size, pad_size = window_size - 1, ...)

Arguments

x

a numeric vector on which to perform the calculation

window_size

width of the sliding window, in data points

approach

character scalar naming the desired calculation approach to use. Can be "sliding" (the default; see Crouter et al., 2010), "static" (see Crouter et al., 2006), or "custom" (see details below)

verbose

logical. Print progress updates?

...

arguments passed to functions in the RcppRoll package

pad_size

The number of NA values to append at the start and end of x (when approach == "custom") before executing the rolling minimum step.

Details

For approach == "sliding", the value for each epoch represents the lowest CV value of all the sliding windows that overlap with that epoch. For aproach == "static", a truncated vector of CV values is given, which reflects CV values from a non-overlapping sliding window. For approach == "custom", users can pass arguments into RcppRoll functions and create a variation on the sliding approach. Behavior of this feature is not well documented and subject to change if people start using it and requesting specific behavior.

Value

a numeric vector of values, giving the desired coefficient of variation

See Also

Crouter et al. (2010, Med Sci Sports Exerc) Crouter et al. (2006, J Appl Physiol)

Examples

data(raw_for_cv)
cv_2rm(raw_for_cv$ENMO)


paulhibbing/TwoRegression documentation built on July 9, 2023, 2:57 a.m.