BookmarkSubscribeRSS Feed
newtriks
Obsidian | Level 7

Here's the code -

PROC SGPLOT data=STAN.cardata;
scatter x=year y=age_adjusted_rate;
series x=year y=age_adjusted_rate;
RUN;

 

What I get is a straight line from lower left to upper right, with the y-axis values aligning with the year of the observation, rather than the value of the 'age adjusted rate'. 

 

From the graph, here's a sample of the values of  'age adjusted rate' values on the y-axis from top to bottom:

2.81

2.52

2.48

2.65

3.09

3.43

.(10 additional values, also in improper order)

6.73

6.59

6.55

 

What am I missing?

 

Thanks-

2 REPLIES 2
PaigeMiller
Diamond | Level 26

It seems to me the most likely explanation is that age_adjusted_rate is a character variable. Is it?

 

Can you show us the plot? (Use the "Insert Photos" icon to include your screen capture in your reply)

--
Paige Miller
newtriks
Obsidian | Level 7

Yes, that's the answer. Thank you!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 594 views
  • 0 likes
  • 2 in conversation