Description Usage Arguments Details Value Author(s) See Also Examples

Bootstrapping of linear model fits (using `lm`

). Bootstrapping
can be done by either resampling rows of the original data frame or
resampling residuals from the original model fit.

1 2 |

`lm.object` |
A linear model fit, produced by |

`R` |
The number of bootstrap replicates to use. |

`rows` |
Should we resample rows? Setting |

`new.xpts` |
Values at which you wish to make new predictions. If specified, fitted values from each bootstrap sample will be stored. |

`ngrid` |
If |

`weights` |
Reseampling weights; a vector of length equal to the number of observations. |

Currently, `"lm.simpleboot"`

objects have a simple `print`

method (which shows the original fit), a `summary`

method and a
`plot`

method.

An object of class `"lm.simpleboot"`

(which is a list) containing the
elements:

`method` |
Which method of bootstrapping was used (rows or residuals). |

`boot.list` |
A list containing values from each of the bootstrap samples. Currently, bootstrapped values are model coefficients, residual sum of squares, R-square, and fitted values for predictions. |

`orig.lm` |
The original model fit. |

`new.xpts` |
The locations where predictions were made. |

`weights` |
The resampling weights. If none were used, this
component is |

Roger D. Peng

The `plot.lm.simpleboot`

method.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
data(airquality)
attach(airquality)
set.seed(30)
lmodel <- lm(Ozone ~ Wind)
lboot <- lm.boot(lmodel, R = 1000)
summary(lboot)
## With weighting
w <- runif(nrow(model.frame(lmodel)))
lbootw <- lm.boot(lmodel, R = 1000, weights = w)
summary(lbootw)
## Resample residuals
lboot2 <- lm.boot(lmodel, R = 1000, rows = FALSE)
summary(lboot2)
``` |

```
Loading required package: boot
Simple Bootstrap Routines (1.1-3 2008-04-30)
BOOTSTRAP OF LINEAR MODEL (method = rows)
Original Model Fit
------------------
Call:
lm(formula = Ozone ~ Wind)
Coefficients:
(Intercept) Wind
96.873 -5.551
Bootstrap SD's:
(Intercept) Wind
9.1083683 0.8142714
BOOTSTRAP OF LINEAR MODEL (method = rows)
Original Model Fit
------------------
Call:
lm(formula = Ozone ~ Wind)
Coefficients:
(Intercept) Wind
96.873 -5.551
Bootstrap SD's:
(Intercept) Wind
9.3130444 0.7848792
BOOTSTRAP OF LINEAR MODEL (method = residuals)
Original Model Fit
------------------
Call:
lm(formula = Ozone ~ Wind)
Coefficients:
(Intercept) Wind
96.873 -5.551
Bootstrap SD's:
(Intercept) Wind
7.3278953 0.6832981
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.