Hi, I have balanced panel data with ID and Time (and some other variables), and I want the unique ID-pairs, while preserving the time order. The suggestions I've found seem to offer much more complicated combinations. The simplest example I can think of (while still being clear) has 3 individuals and 3 time periods. In general, if the original data set is n*T obs, the transformed data set should be (n*n-1)/2*T) obs. I can do this with loops, but I'm guessing there is a clever way to do it w/out loops. Thanks for your help.

ID1 t1
ID1 t2
ID1 t3
ID2 t1
ID2 t2
ID2 t3
ID3 t1
ID3 t2
ID3 t3

I would like the resulting data to look like:
ID1-ID2 t1
ID1-ID2 t2
ID1-ID2 t3
ID1-ID3 t1
ID1-ID3 t2
ID1-ID3 t3
ID2-ID3 t1
ID2-ID3 t2
ID2-ID3 t3

If it helps, my transformed data could be as simple as the difference in the values of a variable for the different IDs for each time period.