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;
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:
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:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: