simreg: Simulate (repeated) regression calculations

Description Usage Arguments Value Note Author(s) References Examples

View source: R/simreg.R

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

Author(s)

John Maindonald

References

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

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.