Hi statalist,

I'm working with a data set that resembles the following:

ID Income
1 50
1 40
1 20
2 10
2 40
2 50
3 60
3 20
3 10

I used collapse (mean) Income, by (ID)

now after collapsing the data is appearing in the following form
ID Income
2 Mean(2)
3 Mean(3)
1 Mean (1)

I need the output in the same order as before, i.e, in the form of
ID Income
1 Mean(1)
2 Mean(2)
3 Mean(3)
what should I do to obtain the means in the same order as the original data?

Thanks.