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

Hi,

I got the below message when used SGPLOT with Series statement to create PK graph. 

NOTE: The log axis cannot support zero or negative values for the axis from plot data or due to default or

      assigned BASELINEINTERCEPT value. The axis type will be changed to LINEAR.

it is not creating the y-axis in log scale. 

 

Below is the code I used.

proc sgplot data=pkmean dattrmap=test noborder ;

   series x = pktime1 y =meancmax/ group=column attrid=X markers;

   xaxis label = 'Time (hr)' values = (0 to 60 by 10) minor MINORCOUNT=1;

   yaxis label = 'Concentration (ng/mL)' values = ( 1 10 100 1000 10000)  type=log logbase=10 logstyle=logexpand ;*   minor MINORCOUNT=8 ;

   keylegend / title="Concentration Vs. Time" location=inside position=TOPRIGHT across=1 down=2 noborder;

run;

 

Please let me know if you are aware of resolving this issue.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

This is a data issue. One of your observations have meancmax=0.

You can use

WHERE meancmax > 0;

to plot only the valid values, or change the scaling on your Y axis.

 

To illustrate, run the following program. The NOTE appears. However, change the first DO loop to "do group=1 to 3" and the NOTE will no longer appear.

 

data A;
do group = 0 to 3; /* change to 1 to 3 to make NOTE go away */
do x=1 to 60;
y = group*x**2;
output;
end;
end;
run;

proc sgplot data=A noborder;
series x=x y=y / group=group markers;
xaxis label = 'Time (hr)' values = (0 to 60 by 10) minor MINORCOUNT=1;
yaxis label = 'Concentration (ng/mL)' values = ( 1 10 100 1000 10000)
type=log logbase=10 logstyle=logexpand ;* minor MINORCOUNT=8 ;
keylegend / title="Concentration Vs. Time" location=inside position=TOPRIGHT across=1 down=2 noborder;
run;

 

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

Haven't seen your data, so I can't tell you if this is the only problem..

 

But when you use values = (0 to 60 by 10) in the XAXIS Statement and also use type=log in the YAXIS Statement you are effectively asking SAS to take log10(0), which is not defined.

Rick_SAS
SAS Super FREQ

This is a data issue. One of your observations have meancmax=0.

You can use

WHERE meancmax > 0;

to plot only the valid values, or change the scaling on your Y axis.

 

To illustrate, run the following program. The NOTE appears. However, change the first DO loop to "do group=1 to 3" and the NOTE will no longer appear.

 

data A;
do group = 0 to 3; /* change to 1 to 3 to make NOTE go away */
do x=1 to 60;
y = group*x**2;
output;
end;
end;
run;

proc sgplot data=A noborder;
series x=x y=y / group=group markers;
xaxis label = 'Time (hr)' values = (0 to 60 by 10) minor MINORCOUNT=1;
yaxis label = 'Concentration (ng/mL)' values = ( 1 10 100 1000 10000)
type=log logbase=10 logstyle=logexpand ;* minor MINORCOUNT=8 ;
keylegend / title="Concentration Vs. Time" location=inside position=TOPRIGHT across=1 down=2 noborder;
run;

 

shampras
Calcite | Level 5
Hi Rick,
It worked. I appreciate your timely help.

Thanks,
Syam

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 5454 views
  • 1 like
  • 3 in conversation