## Histogram Limited To Subset of Data?

Solved
Regular Contributor
Posts: 238

# Histogram Limited To Subset of Data?

I'd like to cut off really long tails from a histogram.  There are a few outliers at either side.  Histogram shows everything bunched up in the very middle, as a result.

SAS instructions are sorta crazy.  A zillion options.  But I can't find the option for this need.

I'd like to ONLY histogram data between, say, 100 and 300.

I could create a new dataset, as needed.  But I'm hoping there is a more direct approach, by using some option on the histogram line, or in the univariate line.  Or maybe some other ingenious way?

Thanks!

Nicholas Kormanik

Accepted Solutions
Solution
‎07-09-2016 05:47 AM
Valued Guide
Posts: 533

## Re: Histogram Limited To Subset of Data?

Easiest way out would be to add

``where N between 100 and 300;``

Hope this helps,

- Jan.

All Replies
Valued Guide
Posts: 533

## Re: Histogram Limited To Subset of Data?

Usually you can control the number and values of your midpoints. If you'd like to share your data and your current attempt and results we may be better able to help you.

Regards, Jan.

Regular Contributor
Posts: 238

## Re: Histogram Limited To Subset of Data?

``````proc univariate data=have;
var N;
histogram;
run;
``````

Data range from 1 to 4000.  Mean=200.  Total rows=A million.

The early numbers are bogus, as are the high numbers.  I'd like to cut those off, and just see a histogram of the stuff in the middle.

Best would be to cut off via standard deviation, + or - one sd.

But it would be okay to use actual values, histogram values between 100 and 300.

Solution
‎07-09-2016 05:47 AM
Valued Guide
Posts: 533

## Re: Histogram Limited To Subset of Data?

Easiest way out would be to add

``where N between 100 and 300;``

Hope this helps,

- Jan.

Regular Contributor
Posts: 238

## Re: Histogram Limited To Subset of Data?

Thanks Jan!  Wow, was that easy, or what?!  Beautiful!

☑ This topic is solved.