library(ggplot2)
varY<-c(0,10,20,30,40,50,20,30,43,28,5,32,23,1)
varX1<-c(0,11,22,31,44,50,24,34,12,45,5,1,5,2)
varX2<-c("A","B","A","B","C","C","A","B","C","A","B","C","C","B")
data<-data.frame(varY,varX1,varX2)
theme_set(theme_bw())
m3 <- glm(
varY ~ varX1 + varX2,
data = data
)
pre<-cbind(data,predict(m3,interval="confidence"))
gg <- ggplot(pre, aes(x = varX1, y = varY, group = varX2, color = factor(varX2))) +
geom_point() + geom_smooth(method=glm, se=FALSE) + #geom_line()+
labs(subtitle="Unknow data", title="Example plot", y="Categorical Y-Var", x="Categorical X-Var1") +
scale_x_continuous(limits=c(0,55))
gg
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.