Regression - Diagnostic - Test Residual Heteroscedasticity
Test for heteroscedasticity (non-constant variance) in the residuals of linear regression models. Also known as the Breusch-Pagan test. The null hypothesis of the test is homoscedasticity. You must select an output from Regression - Linear Regression to use this feature. See this blog post for an introduction to heteroscedasticity.
Example
The following table shows the output from running this QScript on an output from Regression - Linear Regression .
Acknowledgements
Uses the ncvTest function from the car package.
References
Breusch, T. S. and Pagan, A. R. (1979) A simple test for heteroscedasticity and random coefficient variation. Econometrica 47, 1287--1294.
Bock, T. (2018, August 9). What is heteroscedasticity? [Blog post]. Retrieved from https://www.displayr.com/what-is-heteroscedasticity/.
Code
includeWeb("QScript R Output Functions");
const menu_location = "Regression > Diagnostic > Test Residual Heteroscedasticity";
createDiagnosticROutputFromSelection(menu_location);
Displayr - Regression
Q Technical Reference
Q Technical Reference
Q Technical Reference > Multivariate Statistics
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Updating and Automation > Automation Online Library
Q Technical Reference > Updating and Automation > JavaScript > QScript > QScript Examples Library > QScript Online Library
R Online Library
User Interface > Create Regression
User Interface > Regression