Skip to content

Instantly share code, notes, and snippets.

@erykml
Created June 3, 2019 16:48
Show Gist options
  • Select an option

  • Save erykml/d047b54a670a6a03330658fd7d83aa1f to your computer and use it in GitHub Desktop.

Select an option

Save erykml/d047b54a670a6a03330658fd7d83aa1f to your computer and use it in GitHub Desktop.
%%R
library(lmtest)
par(mfrow=c(2,2)) # set 2 rows and 2 column plot layout
plot(lin_reg)
# Breusch-Pagan test
print(bptest(lin_reg, data = X, studentize = TRUE))
# Goldfeld-Quandt
print(gqtest(lin_reg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment