BootGOFTestLM {DBModelSelect}R Documentation

Bootstrap goodness-of-fit procedure for linear models

Description

Performs a bootstrap goodness-of-fit procedure to assess the fit of a normal linear regression model

Usage

BootGOFTestLM(
  x,
  data,
  boot_iter = 1000,
  level = 0.95,
  return_dist = FALSE,
  ...
)

## S3 method for class 'BootGOFTestLM'
print(x, ...)

Arguments

x

A fitted lm object.

data

A dataframe used to fit the model given by x.

boot_iter

An integer indicating number of bootstrap iterations to perform.

level

Confidence level of the bootstrap interval used in the test.

return_dist

A logical specifying whether to optionally return the bootstrap distribution. Defaults to FALSE.

...

Additional arguments.

Value

A list containing the specification and results of the test. The hypothesis of adequate fit is rejected if the null value is not contained in the bootstrap interval.

Examples

# generate some data
set.seed(5122023)
data <- data.frame(s = rnorm(200), t = rnorm(200))
data$y <- data$s + rnorm(200)
# determine whether candidate model shows lack of fit
model <- lm(y~s+t, data = data)
BootGOFTestLM(model, data = data, booot_iter = 100)


[Package DBModelSelect version 0.2.0 Index]