请看下面:这是原数据
----------------------- copy starting from the next line -----------------------
- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input str7 fid16 long pid double pid_s
- "100051" 100051501 100051502
- "100051" 100051502 100051501
- "100453" 430111102 430111101
- "100453" 430111101 430111102
- "100453" 430111103 100453431
- "100551" 130281103 100551551
- "101023" 130815105 130815102
- "102438" 210206103 102438551
- "102473" 210263102 210263101
- "102888" 210966105 210966102
- "102888" 210966102 210966105
- "103465" 103465551 211584103
- "103465" 211584103 103465551
- "103476" 211600103 103476551
- "103788" 211952103 103788501
- end
复制代码
------------------ copy up to and including the previous line ------------------
请看下面,这是我想要的数据形式,其中第一列A列是重点,如何实现这一列的自动生成,以统计样本总共含有多少个家庭
----------------------- copy starting from the next line -----------------------
- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input byte A str7 fid16 long pid double pid_s
- 1 "100051" 100051501 100051502
- . "100051" 100051502 100051501
- 2 "100453" 430111102 430111101
- . "100453" 430111101 430111102
- . "100453" 430111103 100453431
- 3 "100551" 130281103 100551551
- 4 "101023" 130815105 130815102
- 5 "102438" 210206103 102438551
- 6 "102473" 210263102 210263101
- 7 "102888" 210966105 210966102
- . "102888" 210966102 210966105
- 8 "103465" 103465551 211584103
- . "103465" 211584103 103465551
- 9 "103476" 211600103 103476551
- . "103788" 211952103 103788501
- end
复制代码
------------------ copy up to and including the previous line ------------------