【发布时间】:2021-01-19 01:43:32
【问题描述】:
【问题讨论】:
-
最好显示图片,而不是链接。
-
在statalist.org/forums/forum/general-stata-discussion/general/… 交叉发布和回答最好告诉人们交叉发布。
【问题讨论】:
Stata Journal 中的groups 命令将帮助您完成大部分工作。这个可重现的例子并没有穷尽可能性。
. webuse nlswork, clear
(National Longitudinal Survey. Young Women 14-26 years of age in 1968)
. groups union race , show(f F p P) sepby(union)
+--------------------------------------------------+
| union race Freq. #<= Percent %<= |
|--------------------------------------------------|
| 0 white 10777 10777 56.02 56.02 |
| 0 black 3784 14561 19.67 75.69 |
| 0 other 167 14728 0.87 76.56 |
|--------------------------------------------------|
| 1 white 2817 17545 14.64 91.20 |
| 1 black 1649 19194 8.57 99.77 |
| 1 other 44 19238 0.23 100.00 |
+--------------------------------------------------+
必须先安装该命令,然后才能使用它。 groups 是一个糟糕的搜索词,但这个 search 会找到 2017 年的文章和以后的软件更新(在撰写本文时,只有 2018 年的一个)。
. search st0496, entry
Search of official help files, FAQs, Examples, and Stata Journals
SJ-18-1 st0496_1 . . . . . . . . . . . . . . . . . Software update for groups
(help groups if installed) . . . . . . . . . . . . . . . . N. J. Cox
Q1/18 SJ 18(1):291
groups exited with an error message if weights were specified;
this has been corrected
SJ-17-3 st0496 . . . . . Speaking Stata: Tables as lists: The groups command
(help groups if installed) . . . . . . . . . . . . . . . . N. J. Cox
Q3/17 SJ 17(3):760--773
presents command for listing group frequencies and percents and
cumulations thereof; for various subsetting and ordering by
frequencies, percents, and so on; for reordering of columns;
and for saving tabulated data to new datasets
【讨论】: