批量卡方檢驗程序:
data chisq;
input group class A1 A2 A3 A4 A5 A6 ;
cards;
1 1 157 3 45 312 20 19
1 2 151 17 41 325 43 17
2 1 499 653 611 344 617 617
2 2 1408 1542 1518 1234 1499 1499
;
%macro ka;
%do i=1 %to 6;
proc freq data=chisq;
weight A&i;
table group*class/chisq nocol norow nopercent cmh expected;
title "A&i.的卡方檢驗";
run;
%end;
%mend ka;
%ka;