simreg function

Simulate (repeated) regression calculations

Simulate (repeated) regression calculations

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

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)

Returns

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.

References

https://maths-people.anu.edu.au/~johnm/nzsr/taws.html

Author(s)

John Maindonald

Note

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

Examples

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)
  • Maintainer: John Maindonald
  • License: GPL (>= 2)
  • Last published: 2023-08-21

Useful links