simreg: Simulate (repeated) regression calculations In gamclass: Functions and Data for a Course on Modern Regression and Classification

Description

Derive parameter estimates and standard errors by simulation, or by bootstrap resampling.

Usage

 ```1 2``` ```simreg(formula, data, nsim = 1000) bootreg(formula, data, nboot = 1000) ```

Arguments

 `formula` Model formula `data` Data frame from which names in formula can be taken `nsim` Number of repeats of the simulation (`simreg`) `nboot` Number of bootstrap resamples (`bootreg`)

Value

Matrix of coefficients from repeated simulations, or from bootstrap resamples. For `simreg` there is one row for each repeat of the simulation. For `bootreg` there is one row for each resample.

Note

Note that `bootreg` uses the simplest possible form of bootstrap. For any except very large datasets, standard errors may be substantial under-estimates

John Maindonald

Examples

 ```1 2 3``` ```xy <- data.frame(x=rnorm(100), y=rnorm(100)) simcoef <- simreg(formula = y~x, data = xy, nsim = 100) bootcoef <- bootreg(formula = y~x, data = xy, nboot = 100) ```

Example output

```
```

gamclass documentation built on Nov. 14, 2020, 1:07 a.m.