Learn R Programming

gamclass (version 0.62.5)

simreg: 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)

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.

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)

Author

John Maindonald

References

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

Examples

Run this code
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)

Run the code above in your browser using DataLab