BookmarkSubscribeRSS Feed
Arimitra
Calcite | Level 5

Hi Experts,

I have a data which has 48 rows, (at times it may go higher than 48). These 48 rows are basically months of last 4 years. When I try to plot them in SAS it is not plotting more than 36 months. I could group by years and plot 12 months on x axis, but the trend needs to be continious and all months need to come in a line.

Any help would be much appreciated.

Thanks!

Arimitra Maiti

4 REPLIES 4
DanH_sas
SAS Super FREQ

Can you show us a code snippet of your current approach? What version of SAS are you using?

Arimitra
Calcite | Level 5

SAS 4.3.

proc gplot data=trend_months;

plot fpm * month_number = yearnum_c/ overlay 

cframe=white haxis=axis1 vaxis=axis2 annotate=anno_all

autovref LVREF=1 CVREF=bgr wvref=1;

format month_number dataord.
FPM &s_format;

run;

quit; The dataset month_number has all distinct month numbers from 1 to 48. It is showing fine till 36, as I am using the first letter of evcery month and then annotating. Did I confuse you? Apologies.

DanH_sas
SAS Super FREQ

You might need to force 1 through 48 to appear on the axis by using the ORDER= option on the AXIS statement:

axis1 order=(1 to 48);

proc gplot data=trend_months;

plot fpm * month_number = yearnum_c/ overlay

cframe=white haxis=axis1 vaxis=axis2 annotate=anno_all

autovref LVREF=1 CVREF=bgr wvref=1;

format month_number dataord.
FPM &s_format;

run;

Arimitra
Calcite | Level 5

Many Thanks Dan. I am able to create what I intended. All my best wishes and many thanks for helping and enhancing me.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 907 views
  • 4 likes
  • 2 in conversation