boston_quad <- lm(medv ~ . + (rm + tax + lstat)^2 + poly(rm, 2) +
poly(tax, 2) + poly(lstat, 2), Boston)
dboston_quad <- drop_term(boston_quad, k = "bic")
plot(dboston_quad)
plot(dboston_quad, horiz = FALSE)
Run the code above in your browser using DataLab