Skip to content

Need Help Plotting "Line" for multiple linear regression

3 messages · Craig O'Connell, PIKAL Petr, Greg Snow

#
Hi
This is not an interaction, you just multiply vis and den and plot entrance on x axis and vis*den on y axis, so basically you want to model vis*den by entrance.
This model is oposite of what you plotted.
You seem to not understand how the multiple regression output and abline works.

Based on what you want you can do

plot(vis*den, entrance)
model6 <- lm(entrance~I(vis*den))
abline(model6)

however your model will have only intercept and one coefficient for variable x=vis*den

If you want to have separate coefficients for vis ***and*** den and their interaction you can use 

model6=lm(entrance~vis*den)

but in this case resulting coefficients are Intercept, vis, den and interaction between vis and den. In that case beside of other procedures for model evaluation you can do.

plot(entrance, fitted(model6))
abline(0,1)

Regards
Petr