Dear All, For the following data,
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float id byte year float var
1 1 .293322
1 2 .205984
1 3 .137418
2 1 .023271
2 2 .018435
2 3 .032438
3 1 .018477
3 2  .01682
3 3 .023339
4 1 .007451
4 2  .00681
4 3 .012578
5 1 .008532
5 2 .007831
5 3 .015093
end
I "always" have trouble in forming pairs among different `id's (with the same years) so that I can obtain sum of `var' across different combinations of `id' over years.
I guess I should use -joinby- command to do that, any suggestions?