全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
4546 30
2013-01-01
悬赏 200 个论坛币 已解决
data aaa;
input x1 x2;
diff=x1-x2;
cards;
50.7 60
3.3  3.3
28.8 30
46.2 43.2
1.2  2.2
25.5 27.5
2.9 4.9
5.4 5
3.8 3.2
1 4
;
run;
proc univariate data =aaa;
  var diff;
run;

If , the significance of is computed from the exact distribution of , where the distribution is a convolution of scaled binomial distributions.

For n <= 20, proc univariate uses the exact distribution to compute the significance of S,如何计算得到的呢?
谢谢!

最佳答案

jingju11 查看完整内容

This is an exact p value from permutation. I gave a way how to calculate the exact p value in data step. Please read Wilcoxon Signed Rank Test when n
二维码

扫码加我 拉你入群

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

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

全部回复
2013-1-1 09:37:30
This is an exact p value from permutation. I gave a way how to calculate the exact p value in data step.
Please read Wilcoxon Signed Rank Test when n <= 20
jingju
二维码

扫码加我 拉你入群

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

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

2013-1-4 20:06:23
也许可以用R函数  还是等高手吧
二维码

扫码加我 拉你入群

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

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

2013-1-4 22:20:36
wilcoxon符号秩检验;
默认的mu0=0;
原假设为dif的中位数=mu0;
以dif为例,首先计算dif-mu0;剔除掉dif-mu0=0的观测;
计算|dif-mu0|的秩,
之后考虑正负号,
r+为正数的秩和,r-为负数的秩和;
实际应用中W=min(r+,r-),W服从wilcoxon符号秩分布
查表可以确定是否拒绝原假设。
二维码

扫码加我 拉你入群

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

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

2013-1-5 13:29:09
jingju11 发表于 2013-1-5 12:49
This is an exact p value from permutation. I gave a way how to calculate the exact p value in data s ...
data have;
input x1 x2;
diff=x1-x2;
a_diff= round(abs(diff), .01);
cards;
50.7 60
3.3  3.3
28.8 30
46.2 43.2
1.2  2.2
25.5 27.5
2.9 4.9
5.4 5
3.8 3.2
1 4
;
run;

试试这个数据集,你的程序中未考虑差值为0和ties的情况!
谢谢!
二维码

扫码加我 拉你入群

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

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

2013-1-5 13:49:21
dxystata 发表于 2013-1-5 13:29
data have;
input x1 x2;
diff=x1-x2;
你怎么知道我没有考虑TIES的情况? 在SAS里,0 不携带信息.(但是我不是说所有的人都认为如此).基于你的数据结果如下:
京剧

VarName
Test
Testlab
StatpType
pValueMu0
diff
Student's t
t
-1.41562Pr > |t|
0.190550
diff
Sign
M
-1.5Pr >= |M|
0.507810
diff
Signed Rank
S
-12Pr >= |S|
0.179690


好象粘贴表格不好用.
MPRINT(WSRLE20): run;
-------------------------------------------------------
------------- Results from data step -------------
Sum of total ranks for diff 45
Sum of ranks for +/- diff 10.5
# of combinations in one-side 46
Wilcoxon signed rank statistic S -12
P value from exact permutation test 0.17969
-------------------------------------------------------
NOTE: There were 9 observations read from the data set WORK.HAVE_R.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.01 seconds
 
19353 ;

二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群