2

So, is there a way to see the geom_smooth parameters like R, R², Fit Expression?

  • 1
    Take a look at `ggplot_build()` – Duck Sep 23 '20 at 12:47
  • It doesn't show me the R, R-squared or the fit formula.. – Matheus Barreto Alves Sep 23 '20 at 12:51
  • Does this help https://stackoverflow.com/questions/7549694/add-regression-line-equation-and-r2-on-graph – user438383 Sep 23 '20 at 13:02
  • Alternatively [ggstatsplot](https://indrajeetpatil.github.io/ggstatsplot/) has some more advanced visualizations, with added information although I'm uncertain how flexible the package is when it comes to smoother choice. – Oliver Sep 23 '20 at 13:03
  • 1
    Does this answer your question? [ggplot2: how to get values for the regression line equation, r^2 and p value?](https://stackoverflow.com/questions/37365724/ggplot2-how-to-get-values-for-the-regression-line-equation-r2-and-p-value) – erc Sep 23 '20 at 13:35
  • OP, [check here for the answer to your question](https://stackoverflow.com/questions/37365724/ggplot2-how-to-get-values-for-the-regression-line-equation-r2-and-p-value). `geom_smooth()` uses `method` as an argument to create that line. If you specify `method="lm"`, then the parameters should be the same as those you would get using the `lm()` function to create a model. You can then use `summary()` of that model to see the relevant parameters. If you can share dataset and code, you might get a more descriptive answer. – chemdork123 Sep 23 '20 at 18:53

0 Answers0