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!=.
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!=.
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!=.
Does anyone know what may cause this problem?
Thanks!!!
0 Response to A really basic thing for <= and <, why returning the same result?
Post a Comment