# Display Equation on plot

4 messages
Open this post in threaded view
|

## Display Equation on plot

 Hello, I am using the lm to fit a linear model to data, I was wondering if there is a way to display the equation on a plot using the extracted lm coefficients?  I am using the plot() function to create the plot/.png. Example: lm_mod <- lm(data1~data2) intercept = 48.54 slope = 0.4856 I want to display equation on a plot as y=0.4856x+48.54 Any thoughts or suggestions are appreciated. Thanks, Doug -- --------------------------------- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: [hidden email] web: http://www.metstat.com______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Display Equation on plot

 Douglas M. Hultstrand wrote: > Hello, > > I am using the lm to fit a linear model to data, I was wondering if > there is a way to display the equation on a plot using the extracted lm > coefficients?  I am using the plot() function to create the plot/.png. > > Example: > lm_mod <- lm(data1~data2) > > intercept = 48.54 > slope = 0.4856 > > I want to display equation on a plot as y=0.4856x+48.54 > > Any thoughts or suggestions are appreciated. See ?abline: abline(lm_mod) Uwe Ligges > Thanks, > Doug > ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.