看板 Statistics 關於我們 聯絡資訊
※ 引述《jhchu (原來眼淚是止不住的~~)》之銘言: : 請問語法要怎麼寫? : 我只知道SPSS可以用選的.... : 那SAS呢? : 3Q 我嘗試寫了一下 請自行使用研究 data original(drop=i); do i = 1 to 300; seed=12345678; a=rannor(seed); x = a*100 + 50; n=i; drop i a seed; output; end; run; data rand; do i=1 to 300; seed=12345678; a=ranuni(seed); b=round(a*300); type=1; if b>0 then output; drop a seed; end; run; proc sort data=rand nodupkey; by b; run; proc sort data=rand;by i; run; data rand; set rand; n=b; if _n_>100 then delete; drop i b; run; proc sort;by n; run; data randsample ; merge original rand;by n; if type=1 then output; drop n type; run; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.225.39.118
tew:以上結果是保證每次選取都一樣,只要更改seed值即可 07/31 17:30
bugle:proc surveyselect ? 07/31 22:25
tew:我第一次知道有 proc surveyselect這個指令 07/31 22:54
tew:使用確實方便多了 07/31 22:54
jhchu:我明天就試試看這個語法,謝謝大家^^ 07/31 23:01
bugle:查一下surveyselect吧 功能還算齊全 07/31 23:22
chien533:我用過proc surveyselect,還不錯用 08/01 00:55