Dear Statalist,
I want to display a correlation on a graph, rounded to 2 decimal places. A new, temporary variable, generated as follows, does not produce the rounded correlation I expect (r = 0.71).
. corr wandurav wanrate
(obs=177)
| wandurav wanrate
-------------+------------------
wandurav | 1.0000
wanrate | 0.7085 1.0000
. display `r(rho)'
.70846375
. tempvar wcorr
. gen `wcorr' = round(`r(rho)', .01)
. display `wcorr'
.70999998
There must be a simple way to do this.
Thanks for your help.
Cathy
*
* 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/