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!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 815 views
  • 0 likes
  • 2 in conversation