Is anyone aware of a neat way of obtaining both the total AND the stratified rows when using the "collapse, by" command?
For example:
It seems a bit long winded to have to run:
and then recall the original dataset and run:
and then append the two.
For example:
Code:
clear input float(sex death population) 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 2 1 1 2 1 1 2 1 1 2 0 1 2 0 1 2 1 1 2 1 1 2 1 1 end
Code:
collapse (sum)death=death (sum)population=population
Code:
collapse (sum)death=death (sum)population=population, by(sex)
Comment