[R] bar plot with non-zero starting level
jim at bitwrit.com.au
Sun May 19 13:17:43 CEST 2013
On 05/19/2013 09:19 AM, Xianwen Chen wrote:
> I want to plot grouped bars to compare 95% confidence interval estimates
> from two models. Each bar represents a 95% confidence interval estimate
> of a coefficient from one of the two models. Each group represents
> confidence interval estimates of the same coefficient from the two models.
> I think such a bar plot will nicely present whether 95% confidence
> interval estimates of the same coefficient from the two models overlap.
> All these confidence intervals do not start from the x axis.
> I searched bar plot examples on Google. I found methods to plot bars in
> groups by barplot(). I could only specify one offset for all confidence
> interval estimates of the same model. I could not individually specify
> an offset for each confidence interval estimate. Can someone please help
> me on how I may proceed with individual offset for each of the bar in
> the plot?
It seems that you want to line up either one or both of the estimates
for each coefficient and then display the confidence intervals as bars
around the estimates. If so, your ordinate (y-axis) won't be very
interpretable unless you add one for each pair of coefficients. What I
would initially suggest is that you display the coefficient values along
a horizontal line and use "error bars" to show the confidence intervals.
Here is an example:
xlab="Coefficients",ylab="95% confidence intervals",xaxt="n")
More information about the R-help