Reputation: 747
I would like to draw 2 time-series line within 1 graph where there is a variable that classifies which series the data belongs to. For example, there would be 3 variables: DATE, GROUP, and VALUE. the GROUP variable would have 2 values: 0 and 1. Thus, I would like to draw 2 lines, one for group 0 and one for group 1. In the PROC GPLOT, I would use something like this:
proc gplot data=inefficiencyTimeSeries;
plot VALUE*DATE=GROUP /
legend vaxis=axis2 haxis=axis1 href='02jun08'd cframe=CXFFFFFF caxis=CX000000;
run;
How do I do something similar using PROC SGPLOT?
Upvotes: 0
Views: 359
Reputation: 21274
SGPLOT is pretty straight forward once you give it a shot. A line plot is SERIES and you can specify the x/y which is easier than remembering the order required for the PLOT statement. GROUP is still GROUP. The documentation has many examples.
proc sgplot data=inefficiencyTimeSeries;
series x=date y=VALUE/group=GROUP
run;quit;
Upvotes: 1