LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 28 Jan 2011 09:53:04 -0500
Reply-To:   "Feyerharm,Robert W" <RFEYERHA@TRAVELERS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Feyerharm,Robert W" <RFEYERHA@TRAVELERS.COM>
Subject:   Re: histogram troubles
Comments:   To: Nat Wooding <nathani@VERIZON.NET>
In-Reply-To:   <C07A1A97636A406FB26E1D88EA496E8B@D1871RB1>
Content-Type:   text/plain; charset=us-ascii

Thanks Nat!

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Nat Wooding Sent: Friday, January 28, 2011 9:35 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: histogram troubles

Robert

I don't have time to do any testing this morning but you could try using a format to relabel the x value on the right. Something like

Proc Format; Value Fakeit 100010 = '< 100,000'; Run;

If you have 9.2 SAS/GRAPH you should be able to use Proc SGPLOT as shown in the example

http://support.sas.com/documentation/cdl/en/grstatproc/62603/HTML/default/vi ewer.htm#a003155747.htm

Nat Wooding

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Feyerharm,Robert W Sent: Friday, January 28, 2011 8:59 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: histogram troubles

A brilliant idea - the correct frequency %s are preserved, although there is a spike on the right hand side of the x-axis where all the values in excess of 100,000 are binned.

I'd like to use a histogram with a density plot overlay to compare the fit of various probability distributions with the data.

I thought about using R. Alas, in my current job in the private sector, my employer has imposed restrictions on which R packages we can download. Given R's advantages in the graphics dept, I think I can make a case for allowing access to the various graphing packages.

Robert

-----Original Message----- From: Peter Flom [mailto:peterflomconsulting@mindspring.com] Sent: Friday, January 28, 2011 8:46 AM To: Feyerharm,Robert W; 'Sterling Paramore'; SAS-L@LISTSERV.UGA.EDU Subject: RE: histogram troubles

Hi Robert

Nat just made the same suggestion I was about to; but you would then want to relabel the x-axis and I am not sure this is possible in SAS (although it may be).

It would be easy in R ....

Are you wedded to a histogram?

Peter

-----Original Message----- From: Feyerharm,Robert W [mailto:RFEYERHA@travelers.com] Sent: Friday, January 28, 2011 8:33 AM To: 'Peter Flom'; 'Sterling Paramore'; 'SAS-L@LISTSERV.UGA.EDU' Subject: RE: histogram troubles

Thank you for the suggestions.

Right, I thought about using the "where x<100000" statement to "crop" the range of the x-axis in the histogram. But the problem here is that SAS removes all observations where x>=100,000 and then recalculates the frequencies of the histogram so that the % freq.'s of the bins sum up to 100%.

proc univariate data=test1; where x < 100000; var x; histogram / endpoints=0 to 100000 by 1000; run;

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Peter Flom Sent: Thursday, January 27, 2011 6:36 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: histogram troubles

Sterling Paramore wrote

<< Of course, this doesn't quite work if you're more interested in the probability distribution than the absolute count. >>

Indeed. What graph to choose depends on what you are looking for. There isn't one "right" graph.

I'm not a big fan of histograms, I prefer density plots. Often with several different smooths. Boxplots can be good too, if you are interested in the probability distribution, as can quantile plots against various theoretical distributions

Peter

=========================================================================== == This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.

=========================================================================== == This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.

============================================================================= This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.


Back to: Top of message | Previous page | Main SAS-L page