I am working with trade data, and need to generate a table of means of one variable, by two groups. I need the mean of sigma (price elasticity) for each sector within each country (variable gdp), and would like the table to have rows for each sector, columns for each country. I have used the command
Code:
sort gdp sector by gdp sector: tabstat sigma, format(%9.2fc)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(sigma gdp sector) 3 1 1 4 1 1 2 1 2 5 1 2 4 1 3 2 1 3 7 2 1 4 2 1 6 2 2 8 2 2 9 2 3 4 2 3 6 3 1 5 3 1 3 3 2 9 3 2 2 3 3 5 3 3 end
Thanks for your help,
Jack
0 Response to Generating table of means by two groups
Post a Comment