Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Reporting proper format of numbers in a graph


From   "Steichen, Thomas J." <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Reporting proper format of numbers in a graph
Date   Fri, 20 Mar 2009 14:40:32 -0400

local cxy : di %6.3f r(rho)


-----------------------------------
Thomas J. Steichen
[email protected]
-----------------------------------

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Benjamin Villena Roldan
Sent: Friday, March 20, 2009 2:29 PM
To: [email protected]
Subject: st: Reporting proper format of numbers in a graph

Hello Statalist,
I'm currently including some correlations in the notes of a graph. I want
the format of this correlation to include just 3 decimals. So far, my
approach is to compute the reported correlation in the following way

-
corr x y
local cxy=round(1000*r(rho))/1000
twoway(line x y), note("corr(x,y)= `cxy' ")
-

For most of the graphs I'm doing this procedure works fine, but in a few
cases the graph note reports correlations that look like 0.6750000000000001
. This rounding error is killing the aesthetic of my graph!
Does anyone know another way to handle this problem so that I can always
report three-decimal correlations?

Thanks,

Benjamin

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

CONFIDENTIALITY  NOTE:  This e-mail message, including any attachment(s), contains information that may be confidential, protected by the attorney-client or other legal privileges, and/or proprietary non-public information. If you are not an intended recipient of this message or an authorized assistant to an intended recipient, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution, or reproduction of this message and/or any of its attachments (if any) by unintended recipients is not authorized and may be unlawful.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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