第一个问题,参见 Stata 初级视频,A2_data.do :
*-2.9.3.3 多层次分组统计量
*-基本架构:table var1 var2 var3, by(var4) contents(...)
sysuse nlsw88, clear
table race married union, ///
by(collgrad) c(mean wage) format(%4.2f)
-------------------------------------------------------
| union worker and married
college graduate | --- nonunion --- ----- union ----
and race | single married single married
-----------------+-------------------------------------
not college grad |
white | 7.10 6.62 8.23 7.56
black | 5.34 5.32 7.95 7.90
other | 7.25 6.74 5.29 8.49
-----------------+-------------------------------------
college grad |
white | 10.74 9.85 11.70 9.89
black | 10.10 8.81 10.78 10.68
other | 15.15 15.16 7.92
-------------------------------------------------------
table race married union, ///
by(collgrad) c(mean wage freq) format(%4.2f)
-------------------------------------------------------
| union worker and married
college graduate | --- nonunion --- ----- union ----
and race | single married single married
-----------------+-------------------------------------
not college grad |
white | 7.10 6.62 8.23 7.56
| 215.00 577.00 63.00 131.00
|
black | 5.34 5.32 7.95 7.90
| 143.00 155.00 66.00 48.00
|
other | 7.25 6.74 5.29 8.49
| 3.00 8.00 2.00 3.00
-----------------+-------------------------------------
college grad |
white | 10.74 9.85 11.70 9.89
| 80.00 179.00 34.00 74.00
|
black | 10.10 8.81 10.78 10.68
| 32.00 20.00 16.00 21.00
|
other | 15.15 15.16 7.92
| 2.00 3.00 3.00
-------------------------------------------------------
第二个问题,参见 Stata 初级视频:
*------------------------------
*-1.10.1 统计表格、矩阵的输出 -logout-
你可以使用 logout 命令把上述结果输出到 Excel 中。
第三个问题,请说明一下你的数据形态和所使用的具体命令,尽量详细一些。
|