求各位大人帮忙看下,我想把下面的数据合并成2个,single 和 married。
single包括了(single,never married; dicorced; widowed) married包括(married,living with husband/wife; married, separated from husband/wife)
我弄了很久,还是出错,不知道该怎么办了,各位大人帮帮手!感谢不尽!!
. tab marstt
marital status | Freq. Percent Cum.
-------------------------------------+-----------------------------------
single, never married | 2,900 30.37 30.37
married, living with husband/wife | 5,406 56.61 86.97
married, separated from husband/wife | 303 3.17 90.15
divorced | 815 8.53 98.68
widowed | 126 1.32 100.00
-------------------------------------+-----------------------------------
Total | 9,550 100.00
下面是我使用的命令:
.tabulate marstt, gen(marital)
.gen single= marital1 & marital4 & marital5
.gen married= marital2 & marital3
叩谢~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!