SHARE
TWEET

Untitled

a guest Jun 17th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. x = c(-0.2, -0.05, 0.1, 0.15, 0.2)
  2. wilcox.test(x)
  3.  
  4.  
  5.     Wilcoxon signed rank test with continuity correction
  6.  
  7. data:  x
  8. V = 9.5, p-value = 0.6845
  9. alternative hypothesis: true location is not equal to 0
  10.  
  11. Warning message:
  12. In wilcox.test.default(x) : cannot compute exact p-value with ties
  13.      
  14. x = c(0.1, 0.3, 0.4, 0.5, 0.8)
  15. wilcox.test(x, alt="gr")$p.val
  16. [1] 0.03125
  17.      
  18. set.seed(617)
  19. pv =  replicate( 10^5,
  20.        wilcox.test(round(runif(15, -.4, 1),1), alt="g")$p.val )
  21. There were 50 or more warnings (use warnings() to see the first 50)
  22. mean(pv <= .05)
  23. [1] 0.81138
  24.      
  25. set.seed(617)
  26. x = round(runif(15, -.4, 1),1)
  27. sort(x)
  28.  [1] -0.4 -0.3 -0.1 -0.1  0.1  0.2  0.3  0.5  0.7
  29. [10]  0.7  0.8  0.8  0.8  1.0  1.0
  30.  
  31. wilcox.test(x, alt="g")
  32.  
  33.         Wilcoxon signed rank test with continuity correction
  34. data:  x
  35. V = 103.5, p-value = 0.007189
  36. alternative hypothesis: true location is greater than 0
  37.  
  38. Warning message:
  39. In wilcox.test.default(x, alt = "g") :
  40.   cannot compute exact p-value with ties
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top