【发布时间】:2015-10-19 16:30:13
【问题描述】:
我正在尝试为从事一项工作、从事另一项工作的人创建有关某些变量的汇总统计数据,然后将其与不从事这两种工作的人进行比较。我能够为从事任何一项工作的人获取摘要代码,但我不确定如何创建不包括这些工作的摘要。这是我目前所拥有的:
tabstat lwage educ hours exper, by(construc) stat(mean sd min max) nototal
tabstat lwage educ hours exper, by(agric) stat(mean sd min max) nototal
我认为有一种方法可以简单地通过 construc 和 agric 来汇总变量,但这不起作用。任何帮助都会很棒!
【问题讨论】:
-
您可以使用 if 语句,例如
tabstat lwage educ hours exper if construc == 0 & agric == 0, stat(mean sd min max) nototal