Hi everyone
After 10 years of using stata, I really thought I mastered handling comparisons with missing values at ease. I was proven wrong today.
Can anyone explain me this behaviour? I would honestly have expected test_inrange to have been = 0, assuming the logic from test_two_if. When I then tested the condition stated in the inrange helpfile (= test_one_if), I was very surprised to see there's a difference between test_one_if and test_two_if
Thanks so much!
After 10 years of using stata, I really thought I mastered handling comparisons with missing values at ease. I was proven wrong today.
Can anyone explain me this behaviour? I would honestly have expected test_inrange to have been = 0, assuming the logic from test_two_if. When I then tested the condition stated in the inrange helpfile (= test_one_if), I was very surprised to see there's a difference between test_one_if and test_two_if
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str20 nacpno double date_visit long a long b long "test_subject" 22610 . . end format %d date_visit gen test_a = a <= date_visit gen test_b= date_visit <= b gen test_one_if = a<= date_visit<= b gen test_two_if = a<= date_visit & date_visit<= b gen test_inrange=inrange( date_visit, a, b)
Comment