Hi i tried to generate an age variable by subtracting (datecycle2) from dob = date of birth
I end up getting long numbers that don't make sense
I suspect it's because perhaps by dob is not in the correct format?
However i can't spot the mistake
It automatically got generated in the right way why I imported excel file into stata - it was imported as a %td format as a integer rather than float
meanwhile for the datecycle2 - this is a converted stata date which i did with the -date-command, which is correct.
Not sure about the dob.
What am I doing wrong?
I end up getting long numbers that don't make sense
I suspect it's because perhaps by dob is not in the correct format?
However i can't spot the mistake
It automatically got generated in the right way why I imported excel file into stata - it was imported as a %td format as a integer rather than float
meanwhile for the datecycle2 - this is a converted stata date which i did with the -date-command, which is correct.
Not sure about the dob.
What am I doing wrong?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int dob float(datecyle2 age) 7034 22719 15685 8189 23261 15072 5548 23222 17674 10323 23232 12909 9352 23248 13896 2403 22384 19981 -3435 22475 25910 1050 23247 22197 end format %td dob format %td datecyle2
Comment