Hi Stata Users,
I have a dataset with date variables as shown below and would like to loop through the dates to flag any inconsistencies in other words
Thanks in advance!
I have a dataset with date variables as shown below and would like to loop through the dates to flag any inconsistencies in other words
- ActualDate1590 being after ActualDate1600, ActualDate1615, and ActualDate1620
- ActualDate1600 being after ActualDate1615 ActualDate1620
- ActualDate1615 being after ActualDate1620
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float id int(ActualDate1590 ActualDate1600 ActualDate1615 ActualDate1620) 1 21830 21837 . . 2 22333 22354 . . 3 21858 21775 . . 4 20997 20994 22153 . 5 . 20746 22197 . 6 . 20248 . . 7 . 20830 . . 8 21973 21975 . . 9 22434 22501 . . 10 22517 22510 . . 11 21771 21062 . . 12 21172 21180 22589 . 13 21664 21703 22211 . 14 22396 22424 . . 15 22386 22356 . . 16 22617 . . . 17 . 20966 . . 18 22537 22436 . . 19 21951 21977 . 22333 20 21951 21979 22221 . end format %tdnn/dd/CCYY ActualDate1590 format %tdnn/dd/CCYY ActualDate1600 format %tdnn/dd/CCYY ActualDate1615 format %tdnn/dd/CCYY ActualDate1620
Comment