I don't really know what C stands for, but for Fishers' P: jingju
If you want to self-define a function to compute Fishers' P value, you can refer to the blog. But you may notice that computing fishers' is involving lots of calculations, thus might-be over-floating during the computation. that is one reason why calculating fishers' in more than 2 by 2 is time-consuming.
http://blog.sina.com.cn/s/blog_a3a92636010134mn.html
- data had;
- a= 232; b =13; c=59; d=1153; output;
- a= 232; b =59; c=13; d=1153; output;
- a=1313; b =49; c= 1; d= 94; output;
- run;
- data have;
- set had;
- array n[2,2] a b c d;
- v_by ++1;
- do i =1 to dim1(n);
- do j =1 to dim2(n);
- count =n[i,j];output;
- end;
- end;
- keep v_by i j count;
- run;
- ods output fishersexact =FishersExact(where =(name1 ="XP2_FISH"));
- proc freq data =have order=data;
- by v_by;
- tables i*j / chisq;
- weight Count;
- run;
- data have2;
- merge had FishersExact(keep =nValue1 rename =(nValue1 = p));
- run;
复制代码