BookmarkSubscribeRSS Feed
EliseHoo
Calcite | Level 5

I need to plot some data in a scatter plot, put the y-axis on a log scale, and plot an exponential line through the data.  Any advice you have would be SO greatly appreciated.  what am i doign wrong?

thank you!

data genexpert;

input cartridges diagnosis;

cards;

11160 7.97

12420 51.3

2220  1.77

11160 7.7  

11940 103  

4270  3.6

110110      459

5200  135

11670 3

20920 69.3

19100 305

31440 409

37500 135.4

24230 30.1

1388450     109

6260  108.4

23100 29.9

15400 650

14300 170

;

run;

procgplot data=genexpert;

plot cartridges*diagnosis;

symbol I=r;

title'GeneXpert Cartridges Ordered v. Percentage Increase in MDR-TB Diagnosis';

label diagnosis='Percentage increase in MDR-TB diagnosis'
   cartridges=
'Number of GeneXpert cartridges ordered by country';

axis2 logbase=e logstyle=expand;

run;

1 REPLY 1
ballardw
Super User

You haven't told the plot statement how to associate the axis statement with the y axis and the symbol statement has been told not to display the scatter points (no Value option). Also you need to end the proc with a QUIT statement.

See if this helps:

axis2 logbase=e logstyle=expand;
symbol I=r v=dot;

proc gplot data=genexpert;
plot cartridges*diagnosis/vaxis=axis2;
title'GeneXpert Cartridges Ordered v. Percentage Increase in MDR-TB Diagnosis';
label diagnosis='Percentage increase in MDR-TB diagnosis'
   cartridges='Number of GeneXpert cartridges ordered by country';
run;
quit;

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
  • 1 reply
  • 603 views
  • 0 likes
  • 2 in conversation