bootstrap_parametric_linear_null: Compare nested linear models via parametric bootstrap.

View source: R/bootstrap_lm_null.R

bootstrap_parametric_linear_nullR Documentation

Compare nested linear models via parametric bootstrap.

Description

This is the workhorse for the compare_models() function when a linear model is specified without constant variance. Given two linear models, one nested within the other, the null distribution of the test statistic comparing the two models is estimated via a parametric bootstrap. This is not meant to be called by the user directly.

Usage

bootstrap_parametric_linear_null(fit1, fit0, reps)

Arguments

fit1

lm object defining the full model.

fit0

lm object defining the reduced model.

reps

scalar; number of bootstrap replications to perform.

Value

matrix with the same number of rows as coefficients in fit and reps columns. Each row contains the bootstrap estimates of the corresponding parameters.

Examples

## Not run: 
fit1 <- lm(mpg ~ hp, data = mtcars)
fit0 <- lm(mpg ~ 1, data =  mtcars)

boot_parametric_linear_null(fit1, fit0, reps = 4999)

## End(Not run)


reyesem/IntroAnalysis documentation built on March 29, 2025, 3:29 p.m.