|
沙发

楼主 |
发表于 2011-5-26 07:32:40
|
只看该作者
Re: 如何通过程序直接计算频数,并进行卡方检验
Firstly, seemingly we can use FREQ directly;
When to compute frequency at first in our own code, we may consider SQL more convenient; the ways are like the followings.
I hope it is helpful.
JingJu
[code:36cmh6gr]proc freq data =tmp;
tables x*y/chisq ;
run; [/code:36cmh6gr]
[code:36cmh6gr]proc sql;
create table tmp1 as
select count(*) as w, x, y from tmp group by x, y;
quit;
proc freq data =tmp1;
weight w;
tables x*y/chisq;
run;[/code:36cmh6gr] |
|