楼主: jy1st
10813 11

[程序分享] 两组数(mean、median)差异性检验 [推广有奖]

  • 0关注
  • 0粉丝

大专生

51%

还不是VIP/贵宾

-

威望
0
论坛币
21 个
通用积分
0.0013
学术水平
2 点
热心指数
1 点
信用等级
0 点
经验
601 点
帖子
40
精华
0
在线时间
37 小时
注册时间
2008-12-19
最后登录
2016-7-28

楼主
jy1st 发表于 2014-5-20 09:52:07 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
想要得到如下表格:
  
  

Group 1



Group 2



Difference  in mean (p-value)



Difference  in median (p-value)



Capex



Mean(median)



Mean(median)



diff (p)



diff (p)



用ttest,很容易得到mean的差异值。
* difference in mean;
proc ttest data=temp1;
   class group;
   var capex;
run;


但是用npar1way,结果里面没有输出median 和 difference in median,只有p-value。如下。请问,如何得到上面的表格呢?想到一个土办法,把两组的median分别算出来,然后自己减一下。。。这个,这个,是不是有点傻?



*difference in median;
proc npar1way data = temp1 wilcoxon;
        class group;
        var capex;
run;



Wilcoxon Scores (Rank Sums) for Variable capex
Classified by Variable gr
grNSum of
Scores
Expected
Under H0
Std Dev
Under H0
Mean
Score
top428418500092.018389070.0114799.0624318.41550
bottom430018346728.018457750.0114799.0624266.68093
Average scores were used for ties.




Wilcoxon Two-Sample Test
Statistic18500092.0000
Normal Approximation
Z0.9671
One-Sided Pr > Z0.1667
Two-Sided Pr > |Z|0.3335
t Approximation
One-Sided Pr > Z0.1668
Two-Sided Pr > |Z|0.3335
Z includes a continuity correction of
0.5.




二维码

扫码加我 拉你入群

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

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

关键词:median 差异性检验 Media mean Med median

沙发
intheangel 学生认证  发表于 2014-5-20 10:04:40
平均值的差是可以拟合到一个分布的(方差相同正态分布,不同t分布),所以SAS是有办法进行差异性检验,但是我不知道原来中位数的差值也可以拟合到一个分布么?SAS有程序可以检验median的差异性?
我是一只瘦瘦的小猪~~~
╭︿︿︿╮
{/-◎◎-/}
( (oo) )
  ︶︶︶

藤椅
jy1st 发表于 2014-5-20 10:33:32
intheangel 发表于 2014-5-20 10:04
平均值的差是可以拟合到一个分布的(方差相同正态分布,不同t分布),所以SAS是有办法进行差异性检验,但是 ...
我在网上查的,就是说用proc npar1way data = temp1 wilcoxon;
说这个就是检验median的。

板凳
hkhl237 发表于 2014-5-20 14:22:01
Using Wilcoxon scores in the linear rank statistic for two-sample data produces the rank sum statistic of the Mann-Whitney-Wilcoxon test. Using Wilcoxon scores in the one-way ANOVA statistic produces the Kruskal-Wallis test. Wilcoxon scores are locally most powerful for location shifts of a logistic distribution

Using median scores in the linear rank statistic for two-sample data produces the two-sample median test. The one-way ANOVA statistic with median scores is equivalent to the Brown-Mood test. Median scores are particularly powerful for distributions that are symmetric and heavy-tailed.


报纸
intheangel 学生认证  发表于 2014-5-20 16:33:55
jy1st 发表于 2014-5-20 10:33
我在网上查的,就是说用proc npar1way data = temp1 wilcoxon;
说这个就是检验median的。
也是,wilcox秩和检验,非参倒是可以,果然理论已经忘得差不多了
我是一只瘦瘦的小猪~~~
╭︿︿︿╮
{/-◎◎-/}
( (oo) )
  ︶︶︶

地板
hkhl237 发表于 2014-5-20 16:40:15
intheangel 发表于 2014-5-20 16:33
也是,wilcox秩和检验,非参倒是可以,果然理论已经忘得差不多了
恩,wilcox是给所有的观测数排个序,从大到小记个分,然后检验,median scores是观测数和中位数做个比较,按照谁大谁小来记个分,然后检验

7
intheangel 学生认证  发表于 2014-5-20 21:20:55
hkhl237 发表于 2014-5-20 16:40
恩,wilcox是给所有的观测数排个序,从大到小记个分,然后检验,median scores是观测数和中位数做个比较, ...
额~~~秩和检验我还是学过的。。。thx
我是一只瘦瘦的小猪~~~
╭︿︿︿╮
{/-◎◎-/}
( (oo) )
  ︶︶︶

8
jy1st 发表于 2014-5-20 22:10:47
intheangel 发表于 2014-5-20 21:20
额~~~秩和检验我还是学过的。。。thx
楼上两位,所以,我应该怎么做呢?还是困惑ing

9
jingju11 发表于 2014-5-21 09:43:48
You can get medians from other procedures, for examples, proc means.
It is not strange why NPAR1WAY does not provide medians, etc. The reason is that this procedure does the computation based all on  the ranks or scores, but not the data values themselves, with an exception of anova scores. it gives group means.
JingJu

10
jy1st 发表于 2014-5-22 22:52:08
jingju11 发表于 2014-5-21 09:43
You can get medians from other procedures, for examples, proc means.
It is not strange why NPAR1WA ...
Thanks a lot.
Although I can get median from proc means, the p-value of difference-in-median is still calculated by NPAR1WA. Right?

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

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