作者gintin1003 (俊廷)
看板Statistics
標題[程式] 無母 SAS Wilcoxon & t-test 有何不同?
時間Wed Oct 5 22:05:26 2011
[軟體程式類別]:SAS
[程式問題]:用一樣的DATA跑Wilcoxon & t-test,兩者有何異同? (SAS要看單尾雙尾?)
[軟體熟悉度]:(1~3個月)
[問題敘述]:
students in an introductory statistics class were asked how many brothers and sisters they have and whether their hometown is urban or rural.
number of siblings rural versus urban areas
rural 3 2 1 1 2 1 3 2 2 2 2 5 1 4 1 1 1 1 6 2 2 2 1 1
urban 1 0 1 1 0 0 1 1 1 8 1 1 1 0 1 1 2
a.
test for a significant difference between rural and urban areas using the
wilcoxon rank-sum test.
b.
test for a significant difference using the two-sample t-test,
and compare the results with those obtained in part a. w
hy are the results different?
[程式範例]:
data wh7;
INPUT Areas $ number @@;
CARDS;
Rural 3 Rural 2 Rural 1 Rural 1 Rural 2 Rural 1 Rural 3 Rural 2 Rural
2 Rural 2 Rural 2 Rural 5
Rural 1 Rural 4 Rural 1 Rural 1 Rural 1 Rural 1 Rural 6 Rural 2 Rural
2 Rural 2 Rural 1 Rural 1
Urban 1 Urban 0 Urban 1 Urban 1 Urban 0 Urban 0 Urban 1 Urban 1
Urban 1 Urban 8 Urban 1
Urban 1 Urban 1 Urban 0 Urban 1 Urban 1 Urban 2
;
PROC NPAR1WAY WILCOXON;
CLASS Areas;
EXACT WILCOXON;
VAR number;
RUN;
PROC TTEST;
CLASS Areas;
VAR number;
RUN;
PROC NPAR1WAY;
CLASS Areas;
EXACT SCORE=DATA/N=1000;
VAR number;
RUN;
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.181.187
1F:→ Chsieh:假設檢定不同阿 一個是曲線下面積 一個是平均數 10/05 22:39
2F:→ gintin1003:那想問這兩個檢定用SAS跑出來後 有雷同之處? 與差異嗎? 10/05 23:20
3F:→ gintin1003:wilcoxon & t-test 分別是 是要看單尾還是雙尾? 10/05 23:21
4F:→ Chsieh:單尾還是雙尾應該是看你的H0吧 跟用什麼方法沒差 10/06 02:17
5F:→ yhliu:Wilcoxon 的方法是非參數化方法(所謂 "無母數方法"), 是比較 10/06 13:17
6F:→ yhliu:中位數; t test 是基於常態性條件的方法, 是比較平均數. 10/06 13:17