Statalist


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

st: RE: How to deal with the accruacy of storage type?


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How to deal with the accruacy of storage type?
Date   Mon, 28 Sep 2009 20:13:40 +0200

<>

Just evaluate what you want on the fly...

**************
count if round(x,5)==round(y,5)
**************


HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of gjhxmu@sina.com
Sent: Montag, 28. September 2009 20:09
To: statalist
Subject: st: How to deal with the accruacy of storage type?

I encountered a problem on the accuracy of storage type. 

For example, I typed the following in the stata,


clear
input       x y
    .46520616   .4652062
    .02347426   .0234743
    .01774185   .0177418
    .04014428   .0401443
    .24818808   .2481881
    .41385191   .4138519
    .27035237   .2703524
    .03764375   .0376438
    .22899382   .2289938
    .08620364   .0862036
end
l
count if x==y


The result of "count if x==y" is 0. However, in my actual matter, this
situation should be treated as equal between x and y if  the # digits (such
as four or five) after decimal are the same. 

What is the right command to express the above meaning?

Thank you a lot for any help.


Best regards,

Rose.

 

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


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index