STATA如何產生count data - 經濟

By Quintina
at 2011-05-31T17:32
at 2011-05-31T17:32
Table of Contents
如題,我有一個所得變數,想要區分為3級,例如:
if 0萬-100萬, then Inc=1
if 101萬-200萬, then Inc=2
if 201萬-300萬, then Inc=3
其中Inc是新建立的變數,有人知道語法要如何下嗎?
※ 編輯: incessantgas 來自: 140.109.122.224 (05/31 17:33)
if 0萬-100萬, then Inc=1
if 101萬-200萬, then Inc=2
if 201萬-300萬, then Inc=3
其中Inc是新建立的變數,有人知道語法要如何下嗎?
※ 編輯: incessantgas 來自: 140.109.122.224 (05/31 17:33)
推 fox817:你可以直接在檔案裡內建阿,就data set裡新設這個變數就好 05/31 22:34
→ fox817:這就類似在數據資料裡再另設有程度區分的dummy 05/31 22:36
推 davedave91:小弟我只會土法煉鋼法 您如果不介意就參考一下吧 06/01 00:00
→ davedave91:gen inc=1 if income>=0 &income<=1000000 06/01 00:00
→ davedave91:replace inc=2 if income>1000000 &income<=2000000 06/01 00:01
→ davedave91:replace inc=3 if income>2000000 & income<=3000000 06/01 00:03
→ incessantgas:謝大家幫忙。但我依稀記得看過類似的指令(在UCLA的 06/01 15:00
→ incessantgas:教學網站),好像可以直接寫(xx-xx)給1,(xx-xx)給2 06/01 15:01
→ incessantgas:以此類推 06/01 15:01
→ incessantgas:剛剛找到解答了,上來分享一下... 06/06 12:37
→ incessantgas:reocde Inc (0/100=1) (101/200=2) (201/300=3), 06/06 12:38
→ incessantgas:gen(IncCat) 06/06 12:38
Tags:
經濟
All Comments

By Faithe
at 2011-06-02T23:31
at 2011-06-02T23:31

By Ingrid
at 2011-06-04T03:40
at 2011-06-04T03:40

By Andy
at 2011-06-05T23:44
at 2011-06-05T23:44

By William
at 2011-06-10T16:07
at 2011-06-10T16:07

By Ula
at 2011-06-15T01:23
at 2011-06-15T01:23

By Dora
at 2011-06-16T20:31
at 2011-06-16T20:31

By Heather
at 2011-06-18T21:02
at 2011-06-18T21:02

By Tracy
at 2011-06-22T00:39
at 2011-06-22T00:39

By Joseph
at 2011-06-23T05:33
at 2011-06-23T05:33
Related Posts
Re: What Austrian Economics IS and What It Is NOT

By Yedda
at 2011-05-31T06:32
at 2011-05-31T06:32
交易能力研討組織招募

By Olga
at 2011-05-31T06:22
at 2011-05-31T06:22
某大型金控旗下研究部門誠徵總經研究員

By Ethan
at 2011-05-31T01:34
at 2011-05-31T01:34
Ordinal Logistic和 Multinomial Logit的差異

By Skylar Davis
at 2011-05-30T23:17
at 2011-05-30T23:17
我是計量白癡

By Dinah
at 2011-05-30T03:03
at 2011-05-30T03:03