boot function

Bootstrap covariance matrix for least squares estimates of linear regression

Bootstrap covariance matrix for least squares estimates of linear regression

This function calculates bootstrapped covariance matrix for least squares estimates of linear regression. The estimates should be obtained via lm function.

boot(model, iter = 100)

Arguments

  • model: object of class lm.
  • iter: positive integer representing the number of bootstrap iterations.

Returns

This function returns a bootstrapped covariance matrix of the least squares estimator.

Details

Calculations may take long time for high iter value.

Examples

set.seed(123) # Generate data according to linear regression n <- 20 eps <- rnorm(n) x <- runif(n) y <- x + eps # Estimate the model model <- lm(y ~ x) # Calculate bootstrap covariance matrix boot(model, iter = 50)
  • Maintainer: Bogdan Potanin
  • License: GPL (>= 2)
  • Last published: 2024-09-26

Useful links