Learn R Programming

TwoRegression (version 1.1.1)

DualCP_LOSO: Perform leave-one-participant-out-cross-validation on a two-regression algorithm

Description

Perform leave-one-participant-out-cross-validation on a two-regression algorithm

Usage

DualCP_LOSO(
  subject_var = "id",
  data,
  model,
  MET_var = "MET_RMR",
  activity_var = "Behavior",
  verbose = FALSE,
  trace = FALSE
)

fold(x, subject_var, data, model, MET_var, activity_var, trace)

get_cv_predictions(model, fold_data, cv_data)

get_fold_model(formula_string, fold_data, level = c("walkrun", "intermittent"))

get_classifications( data, model, numeric = TRUE, labels = c("SB", "walkrun", "intermittent") )

Value

A data frame with predictions obtained from leave-one-participant-out-cross-validation

Arguments

subject_var

character. Variable name that distinguishes between participants

data

the full data set to cross-validate

model

a TwoRegression object formed with fit_2rm on which to perform the cross-validation

MET_var

character. The outcome variable name (in metabolic equivalents)

activity_var

character. The variable name for the activity being performed

verbose

logical. Print updates?

trace

logical. Print information about each iteration?

x

character. The id to hold out

fold_data

the validation data set

cv_data

the holdout (i.e., cross-validation) data set

formula_string

character. Formula to apply in call to lm

level

character. Classification subset to include in call to lm