How to add shaded confidence intervals to line plot with specified values

前端 未结 2 1268
暗喜
暗喜 2020-12-05 08:07

I have a small table of summary data with the odds ratio, upper and lower confidence limits for four categories, with six levels within each category. I\'d like to produce

2条回答
  •  青春惊慌失措
    2020-12-05 08:33

    You need the following lines:

    p<-ggplot(data=data, aes(x=interval, y=OR, colour=Drug)) + geom_point() + geom_line()
    p<-p+geom_ribbon(aes(ymin=data$lower, ymax=data$upper), linetype=2, alpha=0.1)
    

    enter image description here

提交回复
热议问题