R/NonParametricMethod

윌콕슨의 부호순위 검정(Wilcoxon's signed rank test)

이부일 2017. 12. 9. 21:57

H0 : mu = 35

H1 : mu > 35


# 1. 데이터에 tie가 없을 때
x1 <- c(25, 16, 44, 82, 36, 58, 18)
wilcox.test(x1 , md = 35, alternative = "greater")


# 결과물
Wilcoxon signed rank test

data: x1
V = 16, p-value = 0.4063
alternative hypothesis: true location is greater than 35


# 결론

유의확률이 0.4063이므로 유의수준 0.05에서 귀무가설을 기각할 수 없다.



# 2. 데이터에 tie가 있을 때
install.packages("exactRankTests")
library(exactRankTests)

x2 <- c(25, 16, 44, 82, 36, 58, 18, 44)
exactRankTests::wilcox.exact(x2 , mu = 35, alternative = "greater")



# 결과물

Exact Wilcoxon signed rank test

 

data:  x2

V = 21, p-value = 0.3555

alternative hypothesis: true mu is greater than 35

# 결론

유의확률이 0.3555이므로 유의수준 0.05에서 귀무가설을 기각할 수 없다.


[출처] R을 이용한 비모수 통계학, 임동훈 지음, 자유아카데미, p20~27