Skip to contents

A simple parametric bootstrap algorithm for location-scale regression models from the lmls() function.

Usage

boot(m, num_samples = 1000, seed = NULL)

Arguments

m

A location-scale regression model from the lmls() function.

num_samples

The number of bootstrap samples to draw.

seed

Either NULL or an integer that will be used in a call to set.seed() before simulating the response vectors.

Value

An lmls S3 object, see lmls(). The entry boot with the matrices of bootstrap samples is added to the object as a list with the names location and scale.

Examples

library(lmls)
m <- lmls(y ~ poly(x, 2), ~ x, data = abdom, light = FALSE)
m <- boot(m)
summary(m, type = "boot")
#> 
#> Call:
#> lmls(location = y ~ poly(x, 2), scale = ~x, data = abdom, light = FALSE)
#> 
#> Deviance residuals:
#>      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
#> -3.363000 -0.701400 -0.048870 -0.000149  0.623200  4.066000 
#> 
#> Location coefficients (identity link):
#>                Mean    2.5%     50%   97.5%
#> (Intercept)  226.73  225.61  226.74  227.80
#> poly(x, 2)1 2160.38 2128.34 2160.70 2190.49
#> poly(x, 2)2  -99.44 -124.54  -99.13  -75.79
#> 
#> Scale coefficients (log link):
#>                Mean    2.5%     50% 97.5%
#> (Intercept) 1.35639 1.16229 1.35777 1.545
#> x           0.04217 0.03563 0.04216 0.049
#> 
#> Residual degrees of freedom: 605
#> Log-likelihood: -2396.41
#> AIC: 4802.82
#> BIC: 4824.89
#> 
hist(m$boot$scale[, 2])