Using geom_smooth for fitting a glm to fractions
问题 This post is somewhat related to this post. Here I have xy grouped data where y are fractions: library(dplyr) library(ggplot2) library(ggpmisc) set.seed(1) df1 <- data.frame(value = c(0.8,0.5,0.4,0.2,0.5,0.6,0.5,0.48,0.52), age = rep(c("d2","d4","d45"),3), group = c("A","A","A","B","B","B","C","C","C")) %>% dplyr::mutate(time = as.integer(age)) %>% dplyr::arrange(group,time) %>% dplyr::mutate(group_age=paste0(group,"_",age)) df1$group_age <- factor(df1$group_age,levels=unique(df1$group_age))