I am trying to generate two decade groups "2010 or earlier" and "2011 and above" for dates of CLL diagnosis and I am not getting the right answers in date and floor functions.
This code clearly does not seem right
gen timeperiod = 0 if clldate < 1/1/2011
This code clearly does not seem right
gen timeperiod = 0 if clldate < 1/1/2011
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float clldate
17209
19045
20590
20529
.
17016
20996
17532
17167
17532
19788
15857
20083
15675
17468
17532
18628
16071
19792
17532
11688
19449
17532
10227
16802
17532
17167
9132
19484
19359
15706
16802
19502
17532
18749
17167
18263
.
10958
15706
14610
16802
.
17843
10593
15522
16802
16802
.
14245
.
.
16071
16887
14976
16539
13515
16713
15264
.
14335
15341
10227
.
13515
14976
15219
13149
15111
14610
13515
12419
.
14610
13635
.
16204
20369
17714
18049
18597
17563
21608
17785
19175
21933
20675
14031
19632
19024
19237
21117
22103
21011
19715
20118
20292
16496
16802
21094
end
format %td clldate

Comment