Statalist


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

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


From   [email protected]
To   statalist<[email protected]>
Subject   st: How to deal with the accruacy of storage type?
Date   Tue, 29 Sep 2009 02:09:23 +0800

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/



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