Description Usage Arguments Details Value Author(s)
Modified Breusch-Godfrey Statistic \frac{n * R^2}{n}.
1 | breuschGodfrey(y, x, order = FALSE, fill = 0)
|
y |
A numeric vector. |
x |
A numeric vector. |
order |
Order to which residuals are lagged. Defaults to |
fill |
Defaults to |
NOTE: This function is a (very slightly) modified version
of bgtest from the lmtest package (available at
https://github.com/cran/lmtest/blob/master/R/bgtest.R).
We have stripped it down to minimal functionality for our purposes.
All development credit goes to the authors of lmtest.
This function is a dependency for rankLocReg where it is
used to calculate bgN (Breusch-Godfrey Statistic) divided by the number
of observations \frac{n * R^2}{n}. For the purposes of rankLocReg,
only the relative variance explained by the fitted values from the
auxiliary regression and the residuals of the original regression is of
interest. Calculating \frac{n * R^2}{n} preserves this information, while
avoiding the introduction of strong covariance between bgN and n; an
undesirable behaviour for the linearity metric L. If desired, users can
reproduce a standard Breusch-Godfrey Chi-squared test of significance
by running qchisq with the output bgN and df.
However, we would recommend using the function bgtest from the
package lmtest, as it is specifically designed for this purpose.
A list with: the standard BG statistic (bg), BG/n (bgN), and d.f. (df).
Colin Olito.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.