楼主: dandan_9075
1878 2

批量计算fisher概率值 [推广有奖]

  • 3关注
  • 2粉丝

已卖:1份资源

硕士生

66%

还不是VIP/贵宾

-

威望
0
论坛币
36 个
通用积分
2.6381
学术水平
1 点
热心指数
4 点
信用等级
1 点
经验
2164 点
帖子
148
精华
0
在线时间
132 小时
注册时间
2012-3-12
最后登录
2025-12-4

楼主
dandan_9075 在职认证  发表于 2013-4-12 20:35:52 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
有一张表,有3000多行,每行有一个a、b、c、d值,如图所示,a、b、c、d表示四格表的数字,我想对每一行的数据都计算列联系数C和fisher概率p值,并和原始数据一起输出到一张表中,每一行要求有原始的数字及计算出的联系数C和fisher概率p值,如图所示,请问怎么完成啊?
ab
cd


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Fisher Fish SHE fis 如图所示 fisher 计算

图结果要求.jpg (34.13 KB)

结果要像图中所示

结果要像图中所示

沙发
jingju11 发表于 2013-4-13 07:18:19
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

  1. data had;
  2.    a= 232; b =13; c=59; d=1153; output;
  3.    a= 232; b =59; c=13; d=1153; output;
  4.    a=1313; b =49; c= 1; d= 94; output;
  5. run;
  6. data have;
  7.    set had;
  8.    array n[2,2] a b c d;
  9.    v_by ++1;
  10.    do i =1 to dim1(n);
  11.       do j =1 to dim2(n);
  12.          count =n[i,j];output;
  13.       end;
  14.    end;
  15.    keep v_by i j count;
  16. run;
  17. ods output fishersexact =FishersExact(where =(name1 ="XP2_FISH"));
  18. proc freq data =have order=data;
  19.    by v_by;
  20.    tables i*j / chisq;
  21.    weight Count;
  22. run;
  23. data have2;
  24.    merge had FishersExact(keep =nValue1 rename =(nValue1 = p));
  25. run;
复制代码




藤椅
rdwalk 发表于 2013-4-14 11:37:06
学习

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-3 18:03