fit_model2: Linear model fitting with optional best subset selection,...

Description Usage Arguments

View source: R/fit_model2.R

Description

This function allows you to fit a model between dependend and independend variables and calculate various selection routines.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
fit_model2(
  predictors,
  response,
  method = "lm",
  ctrl = caret::trainControl(),
  subset = "full",
  preProc = c("center", "scale"),
  metric = ifelse(is.factor(response), "Accuracy", "RMSE"),
  maximize = ifelse(metric == "RMSE", FALSE, TRUE),
  tuneLength = 3,
  tuneGrid = NULL,
  verbose = T,
  withinSE = FALSE,
  minVar = 2,
  ...
)

Arguments

predictors

a data.frame with the predictor variables as columns

response

a vector with the response variable

method

string, type of statistical model for more details see caret::train()

ctrl

trainControl object

subset

string, subset selection routine that should be carried out. One of full, best, rfe or ffs

preProc

string or vector, pre processing routines that should be applied to predictors

metric

string, performance metric that is used to select the best model, defaults to RMSE for numeric and Accuracy for factor response

maximize

string, should metric be maximized?

tuneLength

numeric, see caret::train() for more details

tuneGrid

see caret::train() for more details

withinSE

Logical Models are only selected if they are better than the currently best models Standard error

minVar

Numeric. Number of variables to combine for the first selection

...

further arguments passed on to caret::train()


sitscholl/rebecka_package documentation built on Aug. 25, 2020, 4:20 a.m.