title: Calculation of confidence intervals of the median in ggplot
body: <p>I have a dataset consisting of a virtual population with multiple observations per ID. This population is categorized into two groups. I would like to plot the observations vs. time for each group. I could successfully calculate the mean and the confidence interval of the mean using <code>stat_summary</code>. However, in a second plot, I would like to do the same for the median. <code>stat_summary(fun.y=median)</code> does work but I could not find a solution to calculate the proper confidence intervals for the median. Do I have to calculate them separately?</p>
  
  <p>Here's the relevant part of the <code>ggplot</code>code:</p>
  
  <pre><code>my.labels &lt;- c("1250 mg/m²\nwith dose\nadjustments",
             "1250 mg/m²\nwithout dose\nadjustments")
  ggplot(data, aes(x=TIME, y=P2X))+ 
        stat_summary(geom="ribbon", fun.data=mean_cl_boot, 
      fun.args=list(conf.int=0.95), 
                    aes(fill=factor(GROUP),color=NA), alpha = .55)+
        stat_summary(geom="line", fun.y=mean, aes(linetype=factor(GROUP)))+
        scale_fill_manual("dose",labels=my.labels,values=c("#999999", "lightblue"))+
        scale_linetype_manual("dose",labels=my.labels,values = c("solid","dashed"))+
        scale_color_manual("dose",values=c("black", "black"))+labs(x="Time [cycle]",y="Probability [%]")+
        scale_x_continuous(breaks = c(0,1,2,3,4,5,6))+ theme(legend.title=element_blank())+
        scale_y_continuous(labels = function(x) paste0(x*100))
  </code></pre>
  
  <p>Thank you in advance!</p>