lack_of_fit: Conduct the F Test for Lack of Fit

View source: R/operations.R

lack_of_fitR Documentation

Conduct the F Test for Lack of Fit

Description

Conduct the F Test for Lack of Fit

Usage

lack_of_fit(
  X,
  Y,
  Y_hat,
  resid = sum_square(Y, Y_hat),
  n = NROW(Y),
  p = NCOL(X),
  alpha = 0.05
)

Arguments

X

An n \times m design matrix, optionally with an intercept column present.

Y

An n-length vector or n \times 1 matrix representing the response.

Y_hat

Vector of fitted values

resid

Vector of residuals

n

Number of rows in the design matrix. Computed if not provided.

p

Number of columns in the design matrix. Computed if not provided.

alpha

Alpha level for the significance test.

Details

This function carries out the F test for lack of fit, which essentially compares the model estimates to the local means of the response at each distinct observation. The test requires duplicate observations.

Value

Computed F statistic for the test.


ryan-heslin/RegLesson documentation built on Aug. 5, 2022, 9:03 p.m.