Quantcast
Channel: How do I display a correlation coefficient in a scatterplot? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Image may be NSFW.
Clik here to view.

Answer by AlexB for How do I display a correlation coefficient in a scatterplot?

Another way:round(cor(height, salary, method = c("pearson")), 4) -> corrand then using geom_text to display the correlation coefficient:r + geom_smooth(method = lm, formula = y ~ x, se = FALSE) +...

View Article



Image may be NSFW.
Clik here to view.

Answer by jay.sf for How do I display a correlation coefficient in a...

Here a base R way. Define a formula fo, calculate regression, and define an eqation.corr <- cor(height, salary, method = c("pearson"))fo <- salary ~ heightfit <- lm(fo, fakenumbers)(eq <-...

View Article

Image may be NSFW.
Clik here to view.

Answer by TarJae for How do I display a correlation coefficient in a...

We could do it with ggpubr package, adding stat_cor(p.accuracy = 0.001, r.accuracy = 0.01) to your code:library(ggpubr)library(tidyverse)r <- ggplot(fakenumbers, aes(x = height, y = salary)) +...

View Article

How do I display a correlation coefficient in a scatterplot?

In a scatterplot, I would like to display both the correlation coefficient along an equation describing the relationship between x and y.I have created my datamaterial, here is my code so...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>