I have a data set in a scatterplot. I want to "overlap" graphs which include some values and not others, but all in the same data set. Essentially, comparing the correlation with n=5, n=8, and n=10. Is there a way to set my regression line for each of these using the same data?
geom_point(aes(fill = Vaccine), pch = 21, color = 'black', size = 4) +
scale_fill_manual(values = color_list3) +
geom_smooth(method='lm', se=F, color="black", size = 0.5) +
stat_poly_eq(formula = y ~ x,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE) +
theme_classic() +
theme(legend.title = element_text(face = "bold", hjust = 0.5),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black")) +
coord_capped_cart(bottom = 'both', left = 'both') +
labs(x = 'Log antibodies (GTM)', y = 'Vaccine efficacy')