Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Precision and ordering issue in histograms titles


From   "MA V" <[email protected]>
To   [email protected]
Subject   st: Precision and ordering issue in histograms titles
Date   Wed, 24 Jan 2007 00:14:14 +0000

Hi--
I am trying to plot several histograms in one plot using:
twoway histogram mpg, by(X)

My question is the following: My X variable is numeric, so I am having some precision issues with the titles of the individual histograms. For example, if X=-0.2 the title for the corresponding histogram will come out as being "-0.2000000029802322" which is not a very pretty title... So, after reading some of the previous posts on the precision issues in Stata I concluded that one way to achieve nice titles would be to create a string variable, i.e. gen Xstring=string(X). Now the titles of the plot come out fine when I replace <by(X)> with <by(Xstring)>. The only problem is that the plots do not come out ordered by X (i.e. from the smallest X to the largest X) anymore...
Is there any way of getting around the precision issue without losing the ordering of the histograms?
Thanks for your help.
Best.
MA

_________________________________________________________________
Type your favorite song.� Get a customized station.� Try MSN Radio powered by Pandora. http://radio.msn.com/?icid=T002MSN03A07001

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index