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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 936 views
  • 2 likes
  • 3 in conversation