I am using stata 15.1
a general thing: I have realized that when I use the following command to create a difference between two dates of months I get wrong results:
gen FU_mt=(DatumLetzterBesuchimRDI-OPDate)/12
I do get the right days when calculating date difference in days:
gen FU_d=(DatumLetzterBesuchimRDI-OPDate)
For example (12sep2016-12aug2016)/12 gives me 2.583 months
12sep2016-12aug2016 correctly gives me 31 days
I have checked stata forum and google and I dont get to the solution. What am I doing wrong?
0 Response to Calculating months between two dates issues wrong values
Post a Comment