BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
yuwentaiwan
Calcite | Level 5

EXCEL.png

This photo is plot by excel.

How can I make like this by sas?

I try many times but failed!

thanks!

 

data a17;
input  year a1-a9;
cards;
104 4 2 3	2 11 7 3 0 1
105 2 0 4	1 12 6 3 0 0
106 5 2 5	2 8 4 5 1 0
107 3 2 3	1 20 6 3 1 0
;
proc print;run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

See if you can use this as a template

 

data a17;
input  year a1-a9;
cards;
104 4 2 3	2 11 7 3 0 1
105 2 0 4	1 12 6 3 0 0
106 5 2 5	2 8 4 5 1 0
107 3 2 3	1 20 6 3 1 0
;

proc transpose data=a17 out=plot(rename = (col1=a _NAME_=n));
   by year;
run;

proc sgplot data = plot;
   series x = n y = a / group= year lineattrs=(thickness=3);
   styleattrs datacontrastcolors=(blue orange grey gold);
   yaxis min = 0 max = 25 grid display=(nolabel);
   xaxis display=(nolabel);
run;

 

Result:

 

SGPlot10.png

 

View solution in original post

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

See if you can use this as a template

 

data a17;
input  year a1-a9;
cards;
104 4 2 3	2 11 7 3 0 1
105 2 0 4	1 12 6 3 0 0
106 5 2 5	2 8 4 5 1 0
107 3 2 3	1 20 6 3 1 0
;

proc transpose data=a17 out=plot(rename = (col1=a _NAME_=n));
   by year;
run;

proc sgplot data = plot;
   series x = n y = a / group= year lineattrs=(thickness=3);
   styleattrs datacontrastcolors=(blue orange grey gold);
   yaxis min = 0 max = 25 grid display=(nolabel);
   xaxis display=(nolabel);
run;

 

Result:

 

SGPlot10.png

 

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 790 views
  • 1 like
  • 2 in conversation