Dear all, I have the following dataset
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str12 id float(adnt from_date to_date)
"AEDFXA0M6V00"  .4769231 21477 21483
"AEDFXA0M6V00"  .4769231 21442 21448
"AEDFXA0M6V00"  .4769231 21414 21420
"AEDFXA0M6V00"  .4769231 21540 21546
"AEDFXA0M6V00"  .4769231 21512 21518
"AEDFXA0M6V00"  .4769231 21449 21455
"AEDFXA0M6V00"  .4769231 21484 21490
"AEDFXA0M6V00"  .4769231 21547 21553
"AEDFXA0M6V00"  .4769231 21519 21525
"AEDFXA0M6V00"  .4769231 21498 21504
"AEDFXA0M6V00"  .4769231 21435 21441
"AEDFXA0M6V00"  .4769231 21400 21406
"AEDFXA0M6V00"  .4769231 21463 21469
"AEDFXA0M6V00"  .4769231 21526 21532
"AEDFXA0M6V00"  .4769231 21456 21462
"AEDFXA0M6V00"  .4769231 21491 21497
"AEDFXA0M6V00"  .4769231 21393 21399
"AEDFXA0M6V00"  .4769231 21407 21413
"AEDFXA0M6V00"  .4769231 21428 21434
"AEDFXA0M6V00"  .4769231 21421 21427
"AEDFXA0M6V00"  .4769231 21505 21511
"AEDFXA1EN018" 35.990826 21400 21406
"AEDFXA1EN018" 35.990826 21498 21504
"AEDFXA1EN018" 35.990826 21512 21518
"AEDFXA1EN018" 35.990826 21547 21553
"AEDFXA1EN018" 35.990826 21435 21441
"AEDFXA1EN018" 35.990826 21519 21525
"AEDFXA1EN018" 35.990826 21526 21532
"AEDFXA1EN018" 35.990826 21477 21483
"AEDFXA1EN018" 35.990826 21407 21413
"AEDFXA1EN018" 35.990826 21540 21546
"AEDFXA1EN018" 35.990826 21393 21399
"AEDFXA1EN018" 35.990826 21442 21448
"AEDFXA1EN018" 35.990826 21463 21469
"AEDFXA1EN018" 35.990826 21505 21511
"AEDFXA1EN018" 35.990826 21491 21497
"AEDFXA1EN018" 35.990826 21449 21455
"AEDFXA1EN018" 35.990826 21484 21490
"AEDFXA1EN018" 35.990826 21456 21462
"AEDFXA1EN018" 35.990826 21421 21427
"AEDFXA1EN018" 35.990826 21428 21434
"AEDFXA1EN018" 35.990826 21414 21420
"AGP8696W1045"  .3333333 21547 21553
"AGP8696W1045"  .3333333 21484 21490
"AGP8696W1045"  .3333333 21540 21546
"AGP8696W1045"  .3333333 21526 21532
"AGP8696W1045"  .3333333 21498 21504
"AGP8696W1045"  .3333333 21421 21427
"AGP8696W1045"  .3333333 21428 21434
"AGP8696W1045"  .3333333 21463 21469
"AGP8696W1045"  .3333333 21491 21497
"AGP8696W1045"  .3333333 21512 21518
"AGP8696W1045"  .3333333 21477 21483
"AGP8696W1045"  .3333333 21505 21511
"AGP8696W1045"  .3333333 21414 21420
"AGP8696W1045"  .3333333 21456 21462
"AGP8696W1045"  .3333333 21519 21525
"AGP8696W1045"  .3333333 21400 21406
"AGP8696W1045"  .3333333 21435 21441
"AGP8696W1045"  .3333333 21407 21413
"AGP8696W1045"  .3333333 21393 21399
"AGP8696W1045"  .3333333 21442 21448
"AGP8696W1045"  .3333333 21449 21455
"AN8068571086" 112.14214 21540 21546
"AN8068571086" 112.14214 21526 21532
"AN8068571086" 112.14214 21393 21399
"AN8068571086" 112.14214 21519 21525
"AN8068571086" 112.14214 21512 21518
"AN8068571086" 112.14214 21407 21413
"AN8068571086" 112.14214 21421 21427
"AN8068571086" 112.14214 21414 21420
"AN8068571086" 112.14214 21428 21434
"AN8068571086" 112.14214 21505 21511
"AN8068571086" 112.14214 21442 21448
"AN8068571086" 112.14214 21498 21504
"AN8068571086" 112.14214 21456 21462
"AN8068571086" 112.14214 21477 21483
"AN8068571086" 112.14214 21400 21406
"AN8068571086" 112.14214 21491 21497
"AN8068571086" 112.14214 21547 21553
"AN8068571086" 112.14214 21484 21490
"AN8068571086" 112.14214 21435 21441
"AN8068571086" 112.14214 21449 21455
"AN8068571086" 112.14214 21463 21469
"ANN4327C1220"  88.98477 21421 21427
"ANN4327C1220"  88.98477 21456 21462
"ANN4327C1220"  88.98477 21540 21546
"ANN4327C1220"  88.98477 21393 21399
"ANN4327C1220"  88.98477 21547 21553
"ANN4327C1220"  88.98477 21519 21525
"ANN4327C1220"  88.98477 21442 21448
"ANN4327C1220"  88.98477 21463 21469
"ANN4327C1220"  88.98477 21400 21406
"ANN4327C1220"  88.98477 21428 21434
"ANN4327C1220"  88.98477 21498 21504
"ANN4327C1220"  88.98477 21449 21455
"ANN4327C1220"  88.98477 21491 21497
"ANN4327C1220"  88.98477 21414 21420
"ANN4327C1220"  88.98477 21512 21518
"ANN4327C1220"  88.98477 21526 21532
end
format %td from_date
format %td to_date
I would like to see how many distinct id have changes in variables adnt.
In principle each id should have same adnt along the file, but there might be some changes and I would isolate them, for instance creating and indicator equals to 1 if the id has changes in adnt.

Many thanks in advance for your time and assistance