Fit a new model to data created using resample(model).
relm(model, ..., envir = environment(formula(model)))a linear model object produced using lm().
additional arguments passed through to resample().
an environment in which to (re)evaluate the linear model.
mod <- lm(length ~ width, data = KidsFeet)
do(1) * mod
#> Intercept width sigma r.squared F numdf dendf .row .index
#> 1 9.817212 1.657624 1.024769 0.4110041 25.81878 1 37 1 1
do(3) * relm(mod)
#> Intercept width sigma r.squared F numdf dendf .row .index
#> 1 12.33530 1.416479 0.8256297 0.4397726 29.04461 1 37 1 1
#> 2 11.33455 1.482402 1.0740143 0.3369019 18.79868 1 37 1 2
#> 3 11.62397 1.467124 1.1671387 0.2964721 15.59208 1 37 1 3
# use residual resampling to estimate standard error (very crude because so few replications)
Boot <- do(100) * relm(mod)
sd(~ width, data = Boot)
#> [1] 0.3057475
# standard error as produced by summary() for comparison
mod |> summary() |> coef()
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 9.817212 2.9381078 3.341338 1.915251e-03
#> width 1.657624 0.3262257 5.081218 1.097225e-05