simreg: Simulate (repeated) regression calculations

View source: R/simreg.R

simregR Documentation

Simulate (repeated) regression calculations

Description

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

Usage

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

Author(s)

John Maindonald

References

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

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)

gamclass documentation built on Aug. 21, 2023, 5:07 p.m.