Data visualization with SAS programming

sgplot, histogrma on log(10) scale

Reply
Occasional Contributor Tz
Occasional Contributor
Posts: 5

sgplot, histogrma on log(10) scale


Hi all.

I am trying to use Sgplot to create a histogram on the log scale.

My variable is positive.

Syntax and sample file attached.

I get an error message that the scale includes zeoro or negative values.

What am I doing wrong?

Thanks

Attachment
Attachment
Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: sgplot, histogrma on log(10) scale

Cant see your code, the queue seems to be blocked.  Anyways, you are sure the data you are using has no number of 0 or less?  If you have a zero, then maybe consider adding 0.0001 to it so it looks on the output like 0, however behind the scenes its really just over. 

Occasional Contributor Tz
Occasional Contributor
Posts: 5

Re: sgplot, histogrma on log(10) scale

The variable is positive - no zeros.

This is the code:

prog sgplot;

       histogram dmp / scale=count;

       xaxis type=log base=10 logstyle=linear;

run;

thanks


Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: sgplot, histogrma on log(10) scale

Couldn't see anything directly wrong with that, maybe try changing base to be 2 or E though I don't think it would have any effect, I would still say its in the data though I can't see as the Queue has broken here so files are not available.

Grand Advisor
Posts: 9,743

Re: sgplot, histogrma on log(10) scale

Please show output of the variable from Proc Means or similar showing at least the min value.

SAS Super FREQ
Posts: 1,044

Re: sgplot, histogrma on log(10) scale

Since your data and program zip files are still under scan, it is hard to figure out what may be going on.  Can you provide a simple case to illustrate the problem using one of the SASHELP data sets like Cars or Heart, along with the full program?

SAS Employee
Posts: 232

Re: sgplot, histogrma on log(10) scale

I'm checking on the virus scan with our IT department - thank you for your patience

Valued Guide
Posts: 3,206

Re: sgplot, histogrma on log(10) scale

The problem is there are automatic created intervals with a count of zero.  A value of zero cannot be positioned logaritmic.
There must be an other way of scaling 0-1-10-100-1000  (that is 10log like based) a try for that with the binning. Do not see how to influence the binning on that.

---->-- ja karman --<-----
SAS Super FREQ
Posts: 1,044

Re: sgplot, histogrma on log(10) scale

Post a Question
Discussion Stats
  • 8 replies
  • 672 views
  • 0 likes
  • 6 in conversation