[程式] SAS兩個類別變數合併成一個新類別

看板Statistics作者 (蝙蝠俠霸子)時間5年前 (2019/05/18 12:39), 5年前編輯推噓2(202)
留言4則, 3人參與, 5年前最新討論串1/1
想請問一下用這個程式碼產生新類別變數(將兩個類別合併形成一個新類別),然後跑LSD TUKEY Duncan 怎麼一直跑不出來? data newdata; set outbreak; newwt=.; If weather=1 and time=1 then newwt=1; Else if weather=1 and time=2 then newwt=2; Else if weather=2 and time=1 then newwt=3; Else if weather=2 and time=2 then newwt=4; Run; Proc glm data=newdata; Class newwt; Model motor_illegal= newwt; Means newwt/ lines TUKEY T Duncan alpha=0.05 Run; -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.136.86.189 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1558154362.A.EF9.html ※ 編輯: BartJ (36.231.155.32), 05/18/2019 13:34:18

05/18 14:13, 5年前 , 1F
拿掉Model=motor_illegal之間的等號
05/18 14:13, 1F

05/18 14:30, 5年前 , 2F
class 中間應該也不會有=
05/18 14:30, 2F

05/18 14:51, 5年前 , 3F
好像還是跑不出來 日誌檔裡面寫Syntax error....
05/18 14:51, 3F
※ 編輯: BartJ (114.32.176.48), 05/18/2019 15:07:26

05/18 16:12, 5年前 , 4F
alpha=0.05後面少一個;
05/18 16:12, 4F
文章代碼(AID): #1Stunwxv (Statistics)