DATA Step, Macro, Functions and more

Histograms

Reply
Contributor
Posts: 26

Histograms

Hello,

I am trying to make a simple histogram with counts on the vertical axis but I am getting very weird looking graphs...

I do have 76000 ID's in my data with each having a count:

ID          count

1               89

2              126   

3               569

.               .

.               .

.               .

.               .

.               .

.               .

76000     176

I want each of the IDs to have a column and the column to be as tall as the count.

Thanks Smiley Happy

Super User
Posts: 19,877

Re: Histograms

What code/proc are you using now that is giving you weird answers?

Contributor
Posts: 26

Re: Histograms

I'm using a proc univariate

Super User
Posts: 11,343

Re: Histograms

Trying to create 76000 columns in a single chart is probably not ever going to work, especially with univariate.

Try either proc gplot or sgplot,maybe with a needle plot. Though you aren't going to have much luck associating any specific ID with it's count.

Super User
Posts: 19,877

Re: Histograms

Usually you can use weight for a variable when you have the counts already pre-processed, however the histogram statement does not support this in proc univariate.

I'll agree with BallardW suggestion of a Needle Plot.

Ask a Question
Discussion stats
  • 4 replies
  • 180 views
  • 0 likes
  • 3 in conversation