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