i would like to fit a regression line on grouped data in the graph provided to kind of like see the trend or model with the increase in concentration/dose. Some equation seem to be displaying but no actual line on the graph to show the regression line. I have used the code below and getting error message . I would like to display the equation of the different varieties and the R square thereof
formula1 <- avg_AB ~ Dose
ggplot(data = MeanSE_AB, aes(x = Dose, y = avg_AB)) +
geom_smooth(method = "lm", se = FALSE, formula = formula1) +
stat_poly_eq(aes(label = paste0("atop(", ..eq.label.., ",", ..rr.label.., ")")),
formula = formula1,
parse = TRUE) +
theme_bw(base_size = 16)
1: Not enough data to perform fit for group 1; computing mean instead.
2: Not enough data to perform fit for group 2; computing mean instead.
3: Not enough data to perform fit for group 3; computing mean instead.