作者goods41 (蘇格拉底)
看板NCCU06_SOCIO
標題sas的試驗版
時間Wed Sep 20 00:21:59 2006
剛剛才試驗出來的 而且是用很小的樣本以及號碼來跑
不過跑大的邏輯應該差不多
(希望啦~)
用sas的可以參考一下 或是幫忙提出建議一下啦
data homework;
input N1 N2 N3;
if N1=1then d11=1; else d11=0;
if N1=2then d12=1; else d12=0;
if N1=3then d13=1; else d13=0;
if N2=1then d21=1; else d21=0;
if N2=2then d22=1; else d22=0;
if N2=3then d23=1; else d23=0;
if N3=1then d31=1; else d31=0;
if N3=2then d32=1; else d32=0;
if N3=3then d33=1; else d33=0;
dS=d11+d12+d13+d21+d22+d23+d31+d32+d33;
cards;
1 2 3
2 1 3
33 1 1
5 46 1
;
proc print;
var N1 N2 N3 dS;
run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~以上是程式的部份~~~~~~~~~~~~~~~~~~~~~
Obs N1 N2 N3 dS
1 1 2 3 3
2 2 1 3 3
3 33 1 1 2
4 5 46 1 1
所以
我們可以看dS的數量
知道中了幾個號碼
至於特別號的部份
就再多設一個變相即可
如此加上特別號
就可以知道有各組有多少數量
希望是如此可以跑出來
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.224.25.186
推 bukaroo:秉儒真的很優秀!想我當初完全是土法煉鋼!加偷吃步! 09/20 01:11
推 lylytat:真是太厲害啦~~ 09/20 10:01