Statalist The Stata Listserver


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

RE: st: Precision and ordering issue in histograms titles


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   RE: st: Precision and ordering issue in histograms titles
Date   Wed, 24 Jan 2007 10:05:24 +0100

MA wrote:

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...
-----------------------------------------------

This is a precision problem. Try to declare X double precision:

   sysuse auto
   gen double X=0.8-foreign
   twoway histogram mpg , by(X)

Hope this helps
Svend
__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796
Email: [email protected]
__________________________________________ 

*
*   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