[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: collapse panel data for each year
it might worth you the time to check out the command -egen-?
say you trying to calculate the profit mean of each country:
bys country year: egen meanprofit=mean(profit)
Now you can have the mean / sum / sd / whatever by country in your original data
sarah smith wrote:
Dear Stata users:
I have panel data for several industries in 40 countries for 20 years.
For each year, I am trying to collapse the data by country. I tried to
use foreach and forvalues commands, but could not work it out. I would
appreciate if you can help me.
* For searches and help try: