We can answer her question with statistics! https://t.co/cJ5ADaLXDj pic.twitter.com/zCA9mghCGF
— 🔥 Kareem Carr 🔥 (@kareem_carr) September 27, 2023
One step further discussion… 45 degrees is the limit of what’s possible here… blah blah blah stats nerds keep the discussion going!
library(tidyverse)
set.seed(124)
n = 100
data.frame(x = rnorm(n), y = rnorm(n)) %>%
mutate(cutoff = x) %>%
mutate(above = y > cutoff ) %>%
ggplot() +
aes(x = x, y = y) +
coord_fixed(ratio = 1) +
geom_point(shape = 21, size = 6, stroke = 2)
last_plot() +
geom_line(aes(y = cutoff),
linetype = "dashed") +
aes(alpha = above)
## Warning: Using alpha for a discrete variable is not advised.
last_plot() +
geom_smooth(data = . %>% filter(above),
method = lm,
se = FALSE) +
geom_smooth(method = lm,
se = FALSE,
color = alpha("blue", .25),
aes(alpha = NULL))
## Warning: Using alpha for a discrete variable is not advised.
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'