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
Table to bar graph. How to convert tabel data into a graph using STATA. in this exmaple, the table can easily be conve…
Is vce(cluster) option robust to cross-sectional dependence?Hi All, I recently heard that -vce(cluster)- option in -xtreg- robust to cross-sectional dependence.…
return all estimated coefficients for all regressions in the bootstrap?Dear All, Suppose that I do the following bootstrap (please ssc install reghdfe) Code: set seed 12…
Questions regarding statistical methods in a survey sampleHi All, I am doing an analysis using National Inpatient Sample which uses a complex survey design a…
Consultation on regression model with dichotomous variable taken in a longitudinal period ( 2014-2018) Good evening I am new with STATA and I have a query, If I have a dichotomous outcome, but my study …
Subscribe to:
Post Comments (Atom)
0 Response to Collapse (mean) and data ordering
Post a Comment