bootLM: Nonparametric bootstrap linear model

bootLMR Documentation

Nonparametric bootstrap linear model

Description

Nonparametric bootstrap (sampling cases with replacement) method for parameter estimation and confidence interval of a linear model.

Usage

bootLM(formula, data = NULL, R = 10000, alpha = 0.05) 

Arguments

formula

a formula of type y ~ x for the linear model.

data

an optional data frame, list or environment containing the variables in the model.

R

number of bootstrap samples.

alpha

the α-level to use as the threshold border.

Details

For all (x_i, y_i) datapoints, linear models are created by sampling R times - with replacement - from n \in \{1 … N\} and building models Y_n = X_nβ + \varepsilon. This is also known as the .632-bootstrap, because the samples will, on average, contain 1 - e^{-1} = 0.632 unique elements. Parameter estimates are obtained from each sampling, from which the average \overline{P_{n}} and standard error \frac{σ}{√ n} is calculated as well as a quantile based confidence interval. p-values are calculated through inversion of the confidence interval (boot.pval).

Value

A dataframe containing the estimated coefficients, their standard error, lower an upper confidence values and p-values.

Author(s)

Andrej-Nikolai Spiess

References

An Introduction to the Bootstrap.
Efron B, Tibshirani R.
Chapman & Hall (1993).

The Bootstrap and Edgeworth Expansion.
Hall P.
Springer, New York (1992).

Modern Statistics with R.
Thulin M.
Eos Chasma Press, Uppsala (2021).

Examples

## Example #1 with single influencers and insignificant model (p = 0.115).
## Jackknife estimates are robust w.r.t. outlier #18.
set.seed(123)
a <- 1:20
b <- 5 + 0.08 * a + rnorm(20, 0, 1)
LM1 <- lm(b ~ a)
bootLM(LM1, R = 1000)

anspiess/reverseR documentation built on May 14, 2022, 9:43 a.m.