bootR2: Bootstrap R-squared

Description Usage Arguments Value

Description

A package for computing fast Rcpp-based predictive R-squares, via the nonparametric bootstrap. Heavy use is made of RcppEigen. Predictive R-squared statistics use two different samples, one for training a linear model and one for validating it. The bootR2 package draws two nonparametric bootstrap samples to be used as training and validation data for calculating a predictive R-squared. Such a bootstrap distribution provides a better assessment of the proportion of variation that the fitted model could explain in other samples from the population. NOTE: the adjusted R-squared does *not* provide this assessment.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
bootR2(object, ...)

## Default S3 method:
bootR2(object, ...)

## S3 method for class 'lm'
bootR2(object, nBoot = 1, predictive = TRUE, ...)

## S3 method for class 'matrix'
bootR2(object, y, nBoot = 1, predictive = TRUE, ...)

## S3 method for class 'numeric'
bootR2(object, X, nBoot = 1, predictive = TRUE, ...)

bootR2pred(X, y, nBoot)

bootR2samp(X, y, nBoot)

Arguments

object

Object for calculating R-squared

...

Not currently used

nBoot

Number of bootstrap samples

predictive

Should the predictive (i.e. double) bootstrap be used? If TRUE, each of the nBoot bootstrap samples actually consists of two samples: one for training the linear model and one for validating it. Therefore, in this case, the bootstrap distribution may be negative when out-of-sample predictions generate too much variance relative to the bias they avoid. If FALSE, the same sample is used for both training and validation.

X

model matrix

y

model response

Value

Vector of R-squared bootstrap samples


stevencarlislewalker/bootR2 documentation built on May 30, 2019, 4:42 p.m.