boot | R Documentation |
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)
model |
object of class |
iter |
positive integer representing the number of bootstrap iterations. |
Calculations may take long time for high iter
value.
This function returns a bootstrapped covariance matrix of the least squares estimator.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.