ggplot GLM fitted curve without interaction
问题 I want to add the fitted function from GLM on a ggplot . By default, it automatically create the plot with interaction. I am wondering, if I can plot the fitted function from the model without interaction. For example, dta <- read.csv("http://www.ats.ucla.edu/stat/data/poisson_sim.csv") dta <- within(dta, { prog <- factor(prog, levels=1:3, labels=c("General", "Academic", "Vocational")) id <- factor(id) }) plt <- ggplot(dta, aes(math, num_awards, col = prog)) + geom_point(size = 2) + geom