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.
Related Posts with Collapse (mean) and data ordering
Filter specific oservationsHello, everyone I have an employer-employee database and need to keep only the individuals that hav…
Bland Altman plotHello, I have read a paper which provides the following results: The Bland and Altman-plot (Figure)…
Descriptive Table Using MataDear Statalist, I am trying to create a simple descriptive table using mata for the first time. My…
Panel data setup & modelHello, I'm struggling to figure out the right setup and model for my data, as this is my first time…
Generating missing values for a event studyDear Statalist, Let's suppose I have the following database, an event study panel with time window …
Subscribe to:
Post Comments (Atom)
0 Response to Collapse (mean) and data ordering
Post a Comment