robust_regression function

Robust regression (bootstrapped regression)

Robust regression (bootstrapped regression)

Estimate coefficients in a multiple regression model by bootstrapping.

robust_regression( data = NULL, formula = NULL, sigfigs = NULL, round_digits_after_decimal = NULL, iterations = 1000 )

Arguments

  • data: a data object (a data frame or a data.table)
  • formula: a formula object for the regression equation
  • sigfigs: number of significant digits to round to
  • round_digits_after_decimal: round to nth digit after decimal (alternative to sigfigs)
  • iterations: number of bootstrap samples. The default is set at 1000, but consider increasing the number of samples to 5000, 10000, or an even larger number, if slower handling time is not an issue.

Details

The following package(s) must be installed prior to running this function: Package 'boot' v1.3-26 (or possibly a higher version) by Canty & Ripley (2021), https://cran.r-project.org/package=boot

Examples

## Not run: robust_regression( data = mtcars, formula = mpg ~ cyl * hp, iterations = 100 ) ## End(Not run)