I'm currently trying to generate a output table of the mean values of accumulated labour market outcome variables (e.g. hours worked, earnings, ...) by gender and number of children.
My data looks like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long pid float(sex kids60 ua60 uahours60 uapt60) 12 0 2 1294450 68906.8 7 14 0 1 2212595 74337.445 4 26 1 2 32382.14 8911.512 11 45 1 2 294620.97 37067.605 19 end
So far my approach is the following:
Code:
egen group = group(sex kids60), label tabstat ua60 uahours60 uapt60,by(group) nototal
group | ua60 | uahou~60 | uapt60 |
0 0 | 1636200 | 76362.2 | 5.988542 |
0 1 | 1723762 | 81408.5 | 5.496689 |
0 2 | 1743293 | 80053.23 | 5.456633 |
0 3 | 1747682 | 78724.33 | 5.571429 |
1 0 | 1171638 | 69613.64 | 8.661247 |
1 1 | 844645.4 | 52772.38 | 16.691 |
1 2 | 643536.9 | 42055.47 | 19.06852 |
1 3 | 524320.7 | 35648.4 | 19.35022 |
is there a more elegant way to do it? For example get a quality table (in Latex?) where for example "Men" and "Women" are the "top" titles of the columns and then the "women"-columns is divided into for columns each column presenting the means for childless women, women with one child, two children or three children respectively.
Any help would be appreciated. Thank you very much in advance.
0 Response to Mean Table by two subgroups and transfer to latex
Post a Comment