Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Proc Univariate Histograms...can I look at a subse...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-17-2008 11:20 AM

Hello all,

I am trying to plot a histogram of some data in proc univariate. The data values range from 1 to 1,500,000, but most of them are less than 100,000. I want to only look at the range from 1 to 100,000 so my graphs are readable.

Using a where statement won't do, because I would like the end bin of the histogram to peak to represent those that have been truncated.

The MIDPOINTS = option doesn't work...I get the following error:

WARNING: The MIDPOINTS= list was extended to accommodate the data.

Any suggestions? Can this automatic "fix" for the MIDPOINTS option be overwritten?

Thanks so much!

I am trying to plot a histogram of some data in proc univariate. The data values range from 1 to 1,500,000, but most of them are less than 100,000. I want to only look at the range from 1 to 100,000 so my graphs are readable.

Using a where statement won't do, because I would like the end bin of the histogram to peak to represent those that have been truncated.

The MIDPOINTS = option doesn't work...I get the following error:

WARNING: The MIDPOINTS= list was extended to accommodate the data.

Any suggestions? Can this automatic "fix" for the MIDPOINTS option be overwritten?

Thanks so much!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-17-2008 12:14 PM

You might want to share your SAS code. Also, you can list the MIDPOINTS= values to be used, rather than specifying the parameter as a value-range.

Scott Barry

SBBWorks, Inc.

PROC UNIVARIATE - Volume 3, DOC on HISTOGRAM and MIDPOINTS= parameter:

http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/base_proc_8977.pdf

Scott Barry

SBBWorks, Inc.

PROC UNIVARIATE - Volume 3, DOC on HISTOGRAM and MIDPOINTS= parameter:

http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/base_proc_8977.pdf

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-17-2008 12:57 PM

My code follows:

/* The variable ranges from 1 to 1,592,250, with most values less than 100,000 */

proc univariate noprint data = analysis_AE;

var analysis_var;

histogram analysis_var / midpoints = 0 to 25000 by 5000;

run;

Specifying individual midpoints doesn't work either, I get the same error. However the goal is to write a macro for this so eventually that would not work (different variables input would have different ranges, etc.), but I just want it to work on a hard coded level first.

Thanks a lot for your interest and any further help!

/* The variable ranges from 1 to 1,592,250, with most values less than 100,000 */

proc univariate noprint data = analysis_AE;

var analysis_var;

histogram analysis_var / midpoints = 0 to 25000 by 5000;

run;

Specifying individual midpoints doesn't work either, I get the same error. However the goal is to write a macro for this so eventually that would not work (different variables input would have different ranges, etc.), but I just want it to work on a hard coded level first.

Thanks a lot for your interest and any further help!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-17-2008 01:04 PM

Honestly, you may want to share code that gets a "hard" SAS error, where you have coded explicit MIDPOINTS= values showing how you cannot code a low to high set of values, with intermediate midpoint values more frequent at the lower range. The DOC appears to contradict what you indicate is your experience.

Scott Barry

SBBWorks, Inc.

Scott Barry

SBBWorks, Inc.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-17-2008 01:16 PM

Nevermind I just realized that I can code records beyond my bounds as equal to the bounds, creating the effect that I want. Any computed stats from univariate won't be correct, but I don't want any here so that's great.

Thanks for trying to help me, sorry to waste your time.

Thanks for trying to help me, sorry to waste your time.