geom_lm | R Documentation |
ggplot2
Function for Linear Regression PlottingThis function is an exact duplication of ggplot2::geom_smooth()
with defaults more appropriate for statistics and econometrics. By default, geom_lm()
plots with method = "lm"
for a linear trend line and with se = FALSE
because plotting standard errors around a linear trend confuses the viewer more than it demonstrates statistical uncertainty.
geom_lm(method = "lm", se = FALSE, formula = y ~ x, ...)
method |
Smoothing method (function) to use, accepts either
For If you have fewer than 1,000 observations but want to use the same |
se |
Display confidence interval around smooth? ( |
formula |
Formula to use in smoothing function, eg. |
... |
Other arguments passed on to |
ggplot(mpg, aes(displ, hwy)) + ggplot2::geom_point() + geom_lm()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.