breusch_pagan: Conduct the Breusch-Pagan Test of Heteroscedascity

View source: R/operations.R

breusch_paganR Documentation

Conduct the Breusch-Pagan Test of Heteroscedascity

Description

Conduct the Breusch-Pagan Test of Heteroscedascity

Usage

breusch_pagan(
  X,
  resid,
  SSE,
  n = NROW(X),
  q = seq_len(NCOL(X)),
  alpha = 0.05,
  has_intercept = TRUE
)

Arguments

X

Design matrix of a linear model.

resid

Vector of residuals from the fitted model.

SSE

Sum of squared errors of the fitted model.

n

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

q

Number of parameters in the model.

alpha

Alpha level of the significance test.

has_intercept

Logical. Was the model fitted with an intercept?

Details

This function carries out the Breusch-Pagan test, which conducts a chi-squared test to assess whether the residuals have constant variance.

Value

Value of the Breusch-Pagan statistic.


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