Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. library(dunn.test) #available on CRAN
  2.  
  3. ## count data
  4. df <- data.frame(group=LETTERS[1:3], count = c(1,3,5,4,4,6,1,3,5,2,3,5,1,5,3,4,2,5))
  5.  
  6. kruskal.test(count~group, data=df)
  7.  
  8. #Kruskal-Wallis rank sum test
  9. #
  10. #data: count by group
  11. #Kruskal-Wallis chi-squared = 8.7041, df = 2, p-value = 0.01288
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. # non-formula usage (default "holm" method)
  19. dunnTest(df$count,df$group)
  20.  
  21. #Dunn (1964) Kruskal-Wallis multiple comparison
  22. # p-values adjusted with the Holm method.
  23. #
  24. # Comparison Z P.unadj P.adj
  25. #1 A - B -1.131517 0.257837400 0.25783740
  26. #2 A - C -2.925386 0.003440288 0.01032086
  27. #3 B - C -1.793869 0.072834082 0.14566816
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement