It's hard to determine the relationship between these variables, so I'd like to bin them. I've found advice explaining how to bin two variables, but not seven. I'm also not sure how to tailor it to my dataset. Is there a way to alter this to bin multiple variables?
Mine (Note that the data in my photo is the transformed version of the dataset I have below):
diabetes = read.csv('https://github.com/bandcar/Examples/raw/main/diabetes.csv')
pairs(diabetes)
Advice:
set.seed(42)
x <- runif(1e4)
y <- x^2 + x + 4 * rnorm(1e4)
df <- data.frame(x=x, y=y)
library(ggplot2)
(ggplot(df, aes(x=x,y=y)) +
geom_point(alpha = 0.4) +
stat_summary_bin(fun.y='mean', bins=20,
color='orange', size=2, geom='point'))