Data visualization with SAS programming

SAS graph suggestion needed

Reply
Regular Contributor
Posts: 236

SAS graph suggestion needed

Hello everyone,

 

SAS can draw different kinds of graphics,I need your suggestion for what kind of SAS graph is the best for my project.

 

In my project, I need to compare two groups of data for 12 months,new_plan and old_plan

, the data values are production. new_plan has better value than old .I want to know how good in graphics by monthly.

Would you please give me advice on what kind of graph can best discript this comparasion?(value of new group is better in percentage than old.)

 

data compare;
input month new_plan old_plan;
cards;
1	131	115
2	130	114
3	129	113
4	128	112
5	126	110
6	125	109
7	124	108
8	122	107
9	121	106
10	120	104
11	118	103
12	117	102
;
run;

Thanks!

 

Super User
Posts: 19,080

Re: SAS graph suggestion needed

KISS - Keep it simple.

 

Use a line chart with two lines. 

 

Super User
Posts: 11,118

Re: SAS graph suggestion needed

The data would likely work "best" as

Month Plan Value

1         New  131

1         Old    114

etc.

 

Then

Proc sgplot data=modifiedcompare;

    series x=month y=value / group=plan;

run;

A Group variable allows the procedure to produce multiple lines with different colors and possibly line type depending on your current ods style and legend that will indicate, for example, the blue line represent New and the red line is Old plan data.

Super User
Posts: 19,080

Re: SAS graph suggestion needed

You can use multiple SERIES statement with the data in the current form.

 

Proc sgplot data=modifiedcompare;
    series x=month y=old_value ;
    series x=month y=new_value
run;

 

Regular Contributor
Posts: 236

Re: SAS graph suggestion needed

Other than two lines, is there a better visual effect graph that can compare them in percentage?

Thanks!
SAS Super FREQ
Posts: 1,139

Re: SAS graph suggestion needed

You can overlay two bar charts, one for New, one for Old.  You can keep them coincident (reduce bar width for one of them), or put them side by side using DiscreteOffset.  If you change data structure to "Grouped" like suggested by BallardW, you can use GROUP role.  If the slope of change is important, it is better to use a series plot.

Super User
Posts: 19,080

Re: SAS graph suggestion needed


GeorgeSAS wrote:
Other than two lines, is there a better visual effect graph that can compare them in percentage?

Thanks!

What does that mean?

 

Other plot suggestions are:

1. Plot the difference rather than the values

2. Plot it as a band, with the area between coloured to highlight the differences

3. Plot bars instead of line

 

All of these can be accomplished with SGPLOT. 

Ask a Question
Discussion stats
  • 6 replies
  • 239 views
  • 4 likes
  • 4 in conversation