I have a question about "collapse".
I want to create tables with the 'country' category in the row and various categorical variables ( gender education age employment) in columns.
I would like the variables in columns in the same line.
The content of tables are filled by means of 4 different types of variable (wage income cost profit)
I put the command below, but all the categorical variables are in different columns and the country variable is not in the row but in the column.
preserve
collapse (mean) wage income cost profit, by(occupation ender age employment country )
outsheet using "C:\Users\----", replace
restore
Are there any ways to make the table as I described (like below) ? I would also like to export the table into an Excel sheet.
Wage (mean)
country1 | country2 | country3 | country4 | country5 | |
Men | 0.16 | 0.19 | 0.22 | 0.42 | 0.44 |
Women | -0.16 | -0.11 | 0.00 | -0.03 | 0.26 |
Non-college education | 0.09 | 0.14 | 0.13 | 0.30 | 0.43 |
College education | -0.19 | -0.13 | 0.03 | -0.09 | 0.17 |
15-24 | -0.11 | -0.12 | 0.01 | 0.04 | 0.28 |
25-34 | -0.04 | -0.03 | 0.12 | 0.23 | 0.26 |
35-44 | 0.02 | -0.06 | 0.18 | 0.21 | 0.49 |
45-54 | 0.06 | 0.19 | 0.13 | 0.19 | 0.38 |
55-65 | 0.04 | 0.02 | 0.16 | 0.31 | 0.35 |
Self-employed | 0.05 | 0.07 | 0.18 | 0.15 | |
Wage employee | -0.05 | 0.00 | 0.04 | 0.20 | 0.35 |
Thank you so much for your support in advance!
0 Response to Collapse
Post a Comment