Error bars or confidence interval on a density plot

140 views
Skip to first unread message

Ryan Hope

unread,
Jan 25, 2013, 3:22:02 PM1/25/13
to ggp...@googlegroups.com
I have a density plot over which I would like to render a confidence interval using horizontal error bars. Is this possible or do I need to use a shaded box?

Ben Bond-Lamberty

unread,
Jan 27, 2013, 7:47:02 AM1/27/13
to ggp...@googlegroups.com
Hmm, I guess I'd precompute -- use R's density() function first on the
data, add data for error bars, and then plot it all use geom_line and
geom_errorbar.

If you can provide a reproducible example, that will help people give
more specific advice.

Ben
> --
> --
> 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+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
>
>

Ryan Hope

unread,
Jan 27, 2013, 11:09:29 AM1/27/13
to Ben Bond-Lamberty, ggp...@googlegroups.com
Ok confidence interval is probably the wrong idea, I could plot the
1st and 3rd quantile around the median though.
--
Ryan Hope, M.S.
CogWorks Lab
Cognitive Science Department
Rensselaer Polytechnic Institute
Reply all
Reply to author
Forward
0 new messages