看板 Statistics 關於我們 聯絡資訊
※ 引述《wqewwqew (香草天空)》之銘言: : 請問大大我想知道下列數是否隨機 : data three; : input y @@; : cards; : 1 4 4 2 1 3 2 1 3 3 2 4 2 3 3 4 2 : 1 1 2 3 4 1 2 3 2 1 3 2 3 4 2 1 4 : ; : proc print; : data three; : set three; : IF y >1 then n1=1; <-請問各位大大這行這麼改, 如果要改成當二個數字 : 一樣 n1=1。 請問怎麼改? : ELSE n1=0; : n2=1-n1; : r1= abs(lag(n1)-n1); : proc means; : var n1 n2 r1; : output out=run sum=n1 n2 r1; data three; input y @@; cards; 1 4 4 2 1 3 2 1 3 3 2 4 2 3 3 4 2 1 1 2 3 4 1 2 3 2 1 3 2 3 4 2 1 4 ; run; data three; set three; n1=dif(y)=0; run; 我猜上 你的n1是指 跟前依各數值是否一樣 所以設立虛擬變數即可 -- -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.30.78.187 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1493480294.A.A17.html