Learn R Programming

BootValidation (version 0.1.65)

vboot.lm: Internal bootstraping validation linear model

Description

Validate linear regression using bootstrap.

Usage

# S3 method for lm
vboot(fit, x = NULL, y = NULL, s = NULL, nfolds = NULL,
  B = 200, cv_replicates = NULL, lambda = NULL, n_cores = max(1,
  parallel::detectCores() - 1))

Arguments

fit

Object from lm fit

x

A matrix of the predictors, each row is an observation vector.

y

A vector of response variable. It should be quantitative for lineal regression, a factor with two levels for logistic regression or a two-column matrix with columns named 'time' and 'status' for cox regression.

s

Value of the penalty parameter "lambda" selected from the original 'cv.glmnet'.

nfolds

Number of folds for cross validation as in 'cv.glmnet'.

B

Number of bootsrap samples

cv_replicates

Number of replicates for the cross-validation step

lambda

By default, the validation is adjusted using 'lambda.1se' which has error within 1 standard error of the best model. If 'FALSE' the 'lambda.min' referered to the lowest CV error will be used.

n_cores

number of cores to use in parallel. Default detectCores()-1