Add correlation coefficient, R^2,P value and regression line on graph in R software

preview_player
Показать описание
# Simple scatter plot with correlation coefficient, R^2,P value and regression line
library(ggplot2)
library(ggpubr)
stat_cor(label.x = 3, label.y = 34) +
stat_regline_equation(label.x = 3, label.y = 32)
# Use R^2 instead of R
stat_cor(label.y = 34,
stat_regline_equation(label.y = 32)
# Groupped scatter plot
ggscatter(wak, x = "PH", y = "GY",
color = "TRT", palette = "jco",
) +
facet_wrap(~TRT) +
stat_cor(label.y = 4.4) +
stat_regline_equation(label.y = 4.2)
# saving final graph
Рекомендации по теме
Комментарии
Автор

keep up the good work man the generation will learn so much from you, and we expect so much more from you and don't get off the path!

FB_Entertainment
Автор

Keep it up we know something because of u

kalititesfaye
Автор

Thank you for the VDO. the correlation value, is based on what model? Pearson cor or other?

jean-yvesberisse
Автор

Dear Professor! I highly appreciate your efforts for providing free knowledge. Can you please share your email as I have a query regarding a technique in R? Thank you

muhammadzubairchishti
Автор

Hi, great video ! However, ggpubr is not working for me. Could you please help me with this error
Error: package or namespace load failed for ‘ggpubr’ in library.dynam(lib, package, package.lib):
DLL ‘tidyr’ not found: maybe not installed for this architecture?

jacquelinmontoyahidalgo