3-D barplot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

3-D barplot

Rice, Terri
Hi,

I would like to create a 3 dimensional barplot of 16 odds ratios that demonstrate an interaction between two variables (CD14 and CD23).

Here is an example of what the graph I would like to produce (http://www.xfy.com/manual/dev/developer/1.4/spec/image/chart/type_3d.gif):

Here is are the odds ratios I would like to graph:

Odds ratios     CD14-1  CD14-2  CD14-3  CD14-4
CD23-1  1       0.61    2.1     6.1
CD23-2  1.5     1.3     3.5     11.9
CD23-3  1.8     1.5     4.4     10.6
CD23-4  8.2     4.6     5.5     16.8

Thanks!

Terri


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: 3-D barplot

Greg Snow-2
Install the fortunes package, then do:

> library(fortunes)
> fortune(197)

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[hidden email]
801.408.8111


> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of Rice, Terri
> Sent: Tuesday, December 22, 2009 11:38 AM
> To: [hidden email]
> Subject: [R] 3-D barplot
>
> Hi,
>
> I would like to create a 3 dimensional barplot of 16 odds ratios that
> demonstrate an interaction between two variables (CD14 and CD23).
>
> Here is an example of what the graph I would like to produce
> (http://www.xfy.com/manual/dev/developer/1.4/spec/image/chart/type_3d.g
> if):
>
> Here is are the odds ratios I would like to graph:
>
> Odds ratios     CD14-1  CD14-2  CD14-3  CD14-4
> CD23-1  1       0.61    2.1     6.1
> CD23-2  1.5     1.3     3.5     11.9
> CD23-3  1.8     1.5     4.4     10.6
> CD23-4  8.2     4.6     5.5     16.8
>
> Thanks!
>
> Terri

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: 3-D barplot

Therneau, Terry M., Ph.D.
In reply to this post by Rice, Terri
> I would like to create a 3 dimensional barplot of 16 odds ratios that
> demonstrate an interaction between two variables (CD14 and CD23).

odds<- matrix( c(1, 0.61, 2.1,     6.1,
                          1.5 ,    1.3,     3.5,     11.9,
                          1.8 ,    1.5,     4.4,     10.6,
                          8.2 ,    4.6,     5.5,     16.8),
              4,4, byrow=T)

matplot(1:4, odds, type='b', log='y', xaxt='n',
        xlab='CD23', ylab='Odds Ratio')
axis(1, 1:4, 1:4)

  No, this did not create a 3-d bar plot, it created something far more
useful.  In this plot you can see that most of the data fits an additive
model and how well it does so.  It is much better than what you
requested -- which isn't hard as a 3-d barplot is one of the worst tools
ever made for information conveyance.  

Terry Therneau

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.