Discussion:
Multiple boxplots on one page in SAS Graph
(too old to reply)
Peter Flom
2007-04-24 13:44:33 UTC
Permalink
I am just learning SAS Graph.....I've gotten several sites from various people (THANKS) but one problem is finding the graph I want....or close to it.

I want to plot multiple box plots on one page

I found a start at the SAS support site. http://support.sas.com/ctx/samples/index.jsp?sid=1150&tab=code

But I would like to plot multiple pairs of box plots, all next to each other, across one page. I have 1 classification variable, which has two possible values. I have MANY variables on which I'd like to compare them. If I can fit 10 or 15 pairs on a page, I would have a start.

Any hints?

Thanks

Peter
data _null_;
2007-04-24 14:00:10 UTC
Permalink
Have you considered using PROC BOXPLOT? A SAS/STAT procedure. I'm
not sure how it would address multiple plots per page.
Post by Peter Flom
I am just learning SAS Graph.....I've gotten several sites from various people (THANKS) but one problem is finding the graph I want....or close to it.
I want to plot multiple box plots on one page
I found a start at the SAS support site. http://support.sas.com/ctx/samples/index.jsp?sid=1150&tab=code
But I would like to plot multiple pairs of box plots, all next to each other, across one page. I have 1 classification variable, which has two possible values. I have MANY variables on which I'd like to compare them. If I can fit 10 or 15 pairs on a page, I would have a start.
Any hints?
Thanks
Peter
Ron Manley
2007-04-24 14:13:51 UTC
Permalink
HI Peter.
I have used this to get multiple boxplots on a page.

plot c_resn*trtbox (visitnum)
The visitnum is the third level. two boxplots by treatment then at each
visit.

proc boxplot data=box1;
plot c_resn*trtbox (visitnum) /
cframe = white
cboxes=black
cboxfill=white
npanelpos=30
hminor=0
blockpos=4
continuous
boxstyle=schematic;
format visitnum $visit.;
label c_resn="Change from Baseline Result"
trtbox="Post-Baseline";
run;
quit;

Ron.
Post by Peter Flom
I am just learning SAS Graph.....I've gotten several sites from various
people (THANKS) but one problem is finding the graph I want....or close to
it.
I want to plot multiple box plots on one page
I found a start at the SAS support site.
http://support.sas.com/ctx/samples/index.jsp?sid=1150&tab=code
But I would like to plot multiple pairs of box plots, all next to each
other, across one page. I have 1 classification variable, which has two
possible values. I have MANY variables on which I'd like to compare
them. If I can fit 10 or 15 pairs on a page, I would have a start.
Any hints?
Thanks
Peter
Richard A. DeVenezia
2007-04-24 15:55:36 UTC
Permalink
Post by Peter Flom
I am just learning SAS Graph.....I've gotten several sites from
various people (THANKS) but one problem is finding the graph I
want....or close to it.
I want to plot multiple box plots on one page
I found a start at the SAS support site.
http://support.sas.com/ctx/samples/index.jsp?sid=1150&tab=code
But I would like to plot multiple pairs of box plots, all next to
each other, across one page. I have 1 classification variable, which
has two possible values. I have MANY variables on which I'd like to
compare them. If I can fit 10 or 15 pairs on a page, I would have a
start.
Any hints?
Do you plan on using Proc GPLOT or BOXPLOT ?

New techniques would use ODS LAYOUT, time proven techniques would use
GPLOT/BOXPLOT and PROC GREPLAY { TDEF TREPLAY }.
--
Richard A. DeVenezia
http://www.devenezia.com/
David L Cassell
2007-04-25 04:53:14 UTC
Permalink
Post by Ron Manley
Post by Peter Flom
I am just learning SAS Graph.....I've gotten several sites from various
people (THANKS) but one problem is finding the graph I want....or close to
it.
I want to plot multiple box plots on one page
I found a start at the SAS support site.
http://support.sas.com/ctx/samples/index.jsp?sid=1150&tab=code
But I would like to plot multiple pairs of box plots, all next to each
other, across one page. I have 1 classification variable, which has two
possible values. I have MANY variables on which I'd like to compare
them. If I can fit 10 or 15 pairs on a page, I would have a start.
Any hints?
Thanks
Peter
HI Peter.
I have used this to get multiple boxplots on a page.
plot c_resn*trtbox (visitnum)
The visitnum is the third level. two boxplots by treatment then at each
visit.
proc boxplot data=box1;
plot c_resn*trtbox (visitnum) /
cframe = white
cboxes=black
cboxfill=white
npanelpos=30
hminor=0
blockpos=4
continuous
boxstyle=schematic;
format visitnum $visit.;
label c_resn="Change from Baseline Result"
trtbox="Post-Baseline";
run;
quit;
Ron.
This is the approach I would recommend. Just use PROC TRANSPOSE to
transpose your list of y-variables into a single column with _NAME_ as what
you'll use for your group-variable (in the parentheses). Then you'll have
all your variables in the same (wide) boxplot.

Obviously, this will fail miserably when at least one of the variables is of
a
very different scale than at least one other, because you'll end up with
some (or maybe almost all) of the boxplots crushed down so flat that they'll
be unreadable. But I'll bet you already thought about that.

HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330

_________________________________________________________________
Need a break? Find your escape route with Live Search Maps.
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Park&cp=33.832922~-117.915659&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=1118863&encType=1&FORM=MGAC01
Peter Flom
2007-04-25 09:53:10 UTC
Permalink
Thanks to both of you.

Luckily for me, this approach will work, as all the variables are on the same scale.

Peter

-----Original Message-----
Sent: Apr 25, 2007 12:53 AM
Subject: Re: Multiple boxplots on one page in SAS Graph
Post by Ron Manley
Post by Peter Flom
I am just learning SAS Graph.....I've gotten several sites from various
people (THANKS) but one problem is finding the graph I want....or close to
it.
I want to plot multiple box plots on one page
I found a start at the SAS support site.
http://support.sas.com/ctx/samples/index.jsp?sid=1150&tab=code
But I would like to plot multiple pairs of box plots, all next to each
other, across one page. I have 1 classification variable, which has two
possible values. I have MANY variables on which I'd like to compare
them. If I can fit 10 or 15 pairs on a page, I would have a start.
Any hints?
Thanks
Peter
HI Peter.
I have used this to get multiple boxplots on a page.
plot c_resn*trtbox (visitnum)
The visitnum is the third level. two boxplots by treatment then at each
visit.
proc boxplot data=box1;
plot c_resn*trtbox (visitnum) /
cframe = white
cboxes=black
cboxfill=white
npanelpos=30
hminor=0
blockpos=4
continuous
boxstyle=schematic;
format visitnum $visit.;
label c_resn="Change from Baseline Result"
trtbox="Post-Baseline";
run;
quit;
Ron.
This is the approach I would recommend. Just use PROC TRANSPOSE to
transpose your list of y-variables into a single column with _NAME_ as what
you'll use for your group-variable (in the parentheses). Then you'll have
all your variables in the same (wide) boxplot.
Obviously, this will fail miserably when at least one of the variables is of
a
very different scale than at least one other, because you'll end up with
some (or maybe almost all) of the boxplots crushed down so flat that they'll
be unreadable. But I'll bet you already thought about that.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Need a break? Find your escape route with Live Search Maps.
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Park&cp=33.832922~-117.915659&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=1118863&encType=1&FORM=MGAC01
Loading...