看板 Statistics 關於我們 聯絡資訊
※ 引述《lsshno1 (朝右邊鋒邁進)》之銘言: : 我希望我的ID後面都有一個變數叫做Weight , : 他的定義是 ID = i 的個數 : 例如 ID =1 時 , 所有ID=1的變數Weight都=3 : 所以我的資料變成這樣 : ID R weight : 1 2 3 : 1 3 3 : 1 1 3 : 2 3 2 : 2 10 2 : 3 4 4 : 3 11 4 : 3 5 4 : 3 7 4 : 雖然很簡單就是快要想出來可以又想不到! : 感謝大家!! Proc Sql; Create table weight as select id,r, count(*) as weight from original_data group by id, r ;Quit; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.167.170.185
lsshno1:感謝你 ! sql我研究一下 12/25 01:06
west1996:推sql 不過group by後面多打了r 12/25 01:07
liton:撇條撇到一半才想到多打了一個r XD 12/25 01:11
gsuper:在文章目錄按 shift + e 可修文 12/25 01:15
liton:懶得改了 12/25 02:14