BookmarkSubscribeRSS Feed
EJ2020
Calcite | Level 5

Hello all, I am new to SAS. I am trying to use the proc sg plot codes for my data. However, after year 2000, I see a straight line. Even though the values are not the same from 2000 to 2008.  All the columns and rows are complete. The date format is the same though out as well. 

 

Here are the codes:

title "Plot of NCS Data";
proc sgplot data=x1;
series x=date y=NCS /MARKERS;
format date MONYY.;
xaxis values=('1jan97'd to '1jan08'd by qtr);
run;


Somebody suggested I fix it using the codes below. However, I am still getting the same incomplete graph.

proc sgplot data=x1;
series x=date y=NCS /MARKERS;
format date MONYY.;
xaxis values=('1jan97'd to '1jan08'd by qtr);
yaxis valueattrs=(size=8);
ods graphics/width=500px height=800px;
run;

 

Please help!

 

4 REPLIES 4
ballardw
Super User

Tick marks have been thinned does not mean any data was removed. What that means is that the tick mark value labels have been reduced because otherwise the values would have displayed over each each other or with no space between text such as

Jan17Feb17Mar17

so thinning might display

Jan17       Mar17

From the code you show the data removed would have an x axis value less than 01Jan97 or after 01Jan08

EJ2020
Calcite | Level 5

Okay maybe I should not say removed. The data is showing as a straight line after 2000. The values after that year are not the same. so I should not see a straight line. The data should go up and down like it did before 2000.

PGStats
Opal | Level 21

What the strait line is showing is that there is no data (either date or NCS is missing) for that date interval.

PG
ballardw
Super User

Almost certainly data dependent. No markers on that line segment indicates there are no values in that range of X axis values.The line is apparently attempting to connect to some value that may be just past 01Jan08 but the XAXSIS range may be suppressing it from appearing.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the <> icon or attached as text to show exactly what you have and that we can test code against.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 525 views
  • 2 likes
  • 3 in conversation