Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

r how to remove trendlines from model diagnostic plot ()

I am running a simple linear regression model

lm.SR <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)

This is my diagnostic plot using the default plot() function

 plot(lm.SR)

I like to remove the red trend line from the diagnostic plots. Not sure how to do that. Any help is highly appreciated. Thanks.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>Solution :

Try:

plot(lm.SR, add.smooth = FALSE)

When you plot an object of class lm you are using plot.lm, so you can use ?plot.lm to see the available options.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading