BookmarkSubscribeRSS Feed
JohnW_
Calcite | Level 5
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!
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
JohnW_
Calcite | Level 5
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!
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
JohnW_
Calcite | Level 5
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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1218 views
  • 0 likes
  • 2 in conversation