作者edwarded (阿德)
看板Statistics
標題[問題] STATA 的 IF ELSE
時間Sat Nov 29 18:07:10 2008
D =( 0 height大於 155)
( 1 height小於等 155)
我寫gen D=0 if height>155 , if else D=1
究竟哪裡錯了
HELP裡面的 例子都無法讓我理解
拜託大家幫忙了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.70.197.25
1F:推 agood:gen d=1 if height>155 11/29 18:37
2F:→ agood:打錯了,應該是 gen d=1 if height<155 11/29 18:38
3F:→ agood:replace d=0 if d==. 11/29 18:38
4F:→ agood:試試看 11/29 18:39
5F:→ edwarded:沒錯就是這樣謝謝 else完全用不到 11/29 19:01
6F:推 lin15:如果有三類別要怎麼寫@@? 11/29 21:04
7F:→ edwarded:應該再用REPLACE八 11/29 21:18