Hi! I have a really basic question here, it's so strange, can someone help to identify where the problem lies?


For example, a variable, recording the tv watching time, float, and unit is hour.
(I cannot copy the result or syntax since the data is protected)
so the data is something like:

Code:
tab tv, missing
----------------------------------------------------
tv freq. percent cum.
----------------------------------------------------
0 550
0.1 330
0.2 150
0.3 45
0.4 457
0.5 238
0.6 451
0.7 345
0.8 254
0.9 548
1.0 667
1.1 545
.......

5.9 255
6 334
. 50
----------------------------------------------------

So, the following results I got is pretty strange to me.

Code:
count if tv<0.1 & tv!=.
count if tv<=0.1 & tv!=.
These two commands both gave me the same result back

550


or any other value that I could try, but similar situation
Code:
count if tv<0.5 & tv!=.
count if tv<=0.5 & tv!=.
shoudn't it be different between <= and <? I tried other variables or like in other dataset, it works as normal not like this.

it doesnt matter if I remove the tv!=. part, since missing value is by default as infinite large
but the problem didnt show if I use > or >=

The only reason that I can think of is previous when dealing this variable, I used round command to round it to 0.1
Code:
gen tv=.
replace tv=round(tvoriginal, 0.1) if tvoriginal!=.
Will this cause the problem here?

Does anyone know what may cause this problem?
Thanks!!!