Hi Statalist members,
I have a dataset with the same variable from different sources. I want to verify if values from the two sources are the same for all variables. How can I use a loop to avoid repeating the code several times?
bys date: assert mai2==mai1
I would like to check the same for ric1==ric2, rop1==rop2 and so on. Please help and thank you in advance.
I have a dataset with the same variable from different sources. I want to verify if values from the two sources are the same for all variables. How can I use a loop to avoid repeating the code several times?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int date double(mai2 ric2 rop2 be2 so2 fm2 pet2 di2 wor2 mai1 ric1 rop1 be1 so1 fm1 pet1 di1 wor1) 16102 25957 54761 22445 39870 29685 . 809.561403508772 745.469298245614 249.16165107692305 25957 54761 22445 39870 29685 . 809.561403508772 745.469298245614 249.16165107692305 16131 25816 56008 21248 36824 27664 . 811.975 756.3421052631579 271.0426618461538 25816 56008 21248 36824 27664 . 811.975 756.3421052631579 271.0426618461538 16162 21154 58360 20769 34420 26467 . 824.4333333333332 756.3421052631579 290.6060310769231 21154 58360 20769 34420 26467 . 824.4333333333332 756.3421052631579 290.6060310769231 16192 15855 54855 20411 32007 28150 . 901.2833333333332 752.1296296296296 326.8213704615384 15855 54855 20411 32007 28150 . 901.2833333333332 752.1296296296296 326.8213704615384 16223 13400 44663 21666 33848 22582 . 904.5125 785.6041666666667 299.77003 13400 44663 21666 33848 22582 . 904.5125 785.6041666666667 299.77003 end format %tdMon-YY date
I would like to check the same for ric1==ric2, rop1==rop2 and so on. Please help and thank you in advance.
Comment