I am planning to use R
for 9 plots on residual vs 9 prediction variables from multiple linear regression. I know that I can write 9 lines of plot function for each of the 9 variables, but I believe there is an elegant way to plot them with a short loop. (let's say y
and x1
... x9
)
Naive way:
plot(x1, residual); plot(x2, residual).....
Is there a better way of doing this?