[R] Help with ooplot(gplots) and error bars

Frank E Harrell Jr f.harrell at vanderbilt.edu
Sun Nov 21 13:48:58 CET 2004


Jean-Louis Abitbol wrote:
> Dear All
> 
> I am trying to graph a proportion and CI95% by a factor with ooplot (any
> other better solution ?)
> 
> It works well until I try to add the confidence interval.
> 
> this is the error message and and a description of the data:
>   
>  > dat1
>         PointEst
> TT1   1      3.6
> TT2   2      5.0
> TT3   3      5.8
> TT4   4     11.5
> TT5   5      7.5
> TT5   6      8.7
> TT7   7     17.4
> 
>>dat2
> 
>         Lower
> TT1   1   1.0
> TT2   2   2.2
> TT3   3   2.7
> TT4   4   6.7
> TT5   5   3.9
> TT5   6   4.6
> TT7   7  11.5
> 
>>dat3
> 
>         Upper
> TT1   1  12.3
> TT2   2  11.2
> TT3   3  12.1
> TT4   4  19.1
> TT5   5  14.2
> TT5   6  15.6
> TT7   7  25.6
> 
>>ooplot(dat1,type="barplot",col=rich.colors(7,"temperature"),names.arg=c("X","Y","Z","A","B","C","D"),plot.ci=T,
> 
> + ci.l=dat2,ci.u=dat3, xlab="Treatment", ylab="Percent Normalized
> Patients")
> Error in ooplot.default(dat1, type = "barplot", col = rich.colors(7,
> "temperature"),  : 
>         'height' and 'ci.u' must have the same dimensions.
> 
> I have tried various ways of supplying ci.l and ci.u (including a
> vector)
> 
> 
> Thanks for the help that anyone can bring,
> 
> Regards, JL

One way is to look at the examples for Dotplot in the Hmisc package. 
Those examples display bootstrap percentile confidence intervals for a mean.

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list