bootstrap_residual: Perform (optionally wild) residual bootstrap for linear...

View source: R/bootstrap_lm.R

bootstrap_residualR Documentation

Perform (optionally wild) residual bootstrap for linear model.

Description

This is the workhorse for the estimate_parameters() function when a linear model is specified. Given a linear model fit, performs a residual bootstrap (or optionally wild bootstrap) to estimate the standard error of and compute confidence intervals for each of the parameters in the model. This is not meant to be called by the user directly.

Usage

bootstrap_residual(fit, reps, wild, construct)

Arguments

fit

lm object defining the model for which the parameters are estimated.

reps

scalar; number of bootstrap replications to perform.

wild

boolean; if TRUE, a wild bootstrap is performed. If FALSE a traditional residual bootstrap is performed.

construct

string defining the type of construct to use when generating from the distribution for the wild bootstrap (see rmammen). If wild = FALSE, this is ignored.

Value

matrix with the same number of rows as coefficients in fit and reps columns. Each row contains the bootstrap estimates of the corresponding parameters.


reyesem/IntroAnalysis documentation built on March 29, 2025, 3:29 p.m.