BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Dinurik
Fluorite | Level 6

Could you please help me with this problem?
I am making a scatterplot between ln-transformed levels of testosterone and score on a certain scale. But I need the axis for testosterone to reflect its actual values before transformation. How can I do it?

So far I have been using proc gplot, but as far as I understood from reading proc gplot syntax on support.sas.com I cannot do this in the axis statement. Here is my current code:

symbol1 color=red value=dot height=2 interpol=rl ;
symbol2 color=blue value=square height=2 interpol = rl;
axis1 label=("Testosterone (ng/g)");
axis2 label=(a=90 "Raw Score") order = (0 to 150 by 20);

proc gplot data=model;
plot score*ln_testosterone=sex / haxis=axis1 vaxis=axis2;
run; quit;

 

I would really appreciate any input!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I suspect you want to use LOGSTYLE=LOGEXPAND on the XAXIS statement, but maybe you want to use LOGSTYLE=LINEAR.

Here is a program that shows both so you can choose.

 

DATA have;
call streaminit(1);
cnt = 0;
do i = -1 to 3 by 0.4;
   testosterone = 10**i;
   Sex = ifc( mod(cnt,2), 'F', 'M' );
   cnt + 1;
   Score = i + rand("Normal");
   output;
end;
run;

ods graphics / attrpriority=NONE;
proc sgplot data=Have;
series x=testosterone y=Score / group=Sex markers;
xaxis type=log logstyle=logexpand;
run;

proc sgplot data=Have;
series x=testosterone y=Score / group=Sex markers;
xaxis type=log logstyle=linear  label="Testosterone (ng/g)";
yaxis label="Raw Score";
run;

 

And here's a link to the documentation for the XAXIS statement.

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

I suspect you want to use LOGSTYLE=LOGEXPAND on the XAXIS statement, but maybe you want to use LOGSTYLE=LINEAR.

Here is a program that shows both so you can choose.

 

DATA have;
call streaminit(1);
cnt = 0;
do i = -1 to 3 by 0.4;
   testosterone = 10**i;
   Sex = ifc( mod(cnt,2), 'F', 'M' );
   cnt + 1;
   Score = i + rand("Normal");
   output;
end;
run;

ods graphics / attrpriority=NONE;
proc sgplot data=Have;
series x=testosterone y=Score / group=Sex markers;
xaxis type=log logstyle=logexpand;
run;

proc sgplot data=Have;
series x=testosterone y=Score / group=Sex markers;
xaxis type=log logstyle=linear  label="Testosterone (ng/g)";
yaxis label="Raw Score";
run;

 

And here's a link to the documentation for the XAXIS statement.

Dinurik
Fluorite | Level 6

Thank you!

 

I tried this with scatter statement instead of series, and removes "markers" option. It worked. Thank you so much!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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