Date: Wed, 3 Oct 2007 12:05:33 -0400
Reply-To: Jean-Jacques Dubois <jjbdubois@MINDSPRING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jean-Jacques Dubois <jjbdubois@MINDSPRING.COM>
Subject: Specify HREF values from a variable, with BY-processing
Hello all,
I am producing a slew of graph using some BY-groups of interest, and for
each of those graphs, I would like to display a reference line at the value
of some other variable.
The following sample:
<http://support.sas.com/ctx/samples/index.jsp?sid=396&tab=code> shows how to
accomplish this for a single graph. How could this be accomplished when BY
processing is present?
More details: 1) the by-group is defined by multiple variables, as in:
proc gplot;by z1 z2 z3;
plot y*x;
run;
and 2) the value of the variable that supplies the reference line is
constant for each by-group, as in:
data one;
input x y z1 ref;
datalines;
1 2 A 6.3
2 4 A 6.3
3 5 A 6.3
4 3 A 6.3
5 2 A 6.3
6 4 A 6.3
7 6 A 6.3
8 2 A 6.3
9 2 A 6.3
10 5 A 6.3
1 3 B 5.2
2 5 B 5.2
3 7 B 5.2
4 2 B 5.2
5 2 B 5.2
6 5 B 5.2
7 3 B 5.2
8 3 B 5.2
9 7 B 5.2
10 6 B 5.2
;
I have thought of a workaround, where the vertical reference line would be
created using an axis definition and an overlaid plot of y1*x, with the
value y1 taking on 2 values at the minimum and maximum of the axis range,
and the corresponding x set at the relevant value. But I am sure that there
must be a more elegant solution.
Thank you for weighing in
Jean-Jacques
|