Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #I have the following boxplot
  2. ToothGrowth%>%ggplot(aes(x=dose, y=len, fill=supp))+
  3. geom_boxplot()
  4.  
  5. #I would like to do a wilcoxon sum rank test on the data and label each comparison between OJ and VC
  6. stat.test <- ToothGrowth%>%group_by(dose)%>%wilcox_test(len~supp, p.adjust.method = 'BH')%>%
  7. mutate(y.position = c(29, 35, 39))
  8. stat.test
  9. #I try to add the p-values to my boxplots
  10. ToothGrowth%>%ggplot(aes(x=dose, y=len, fill=supp))+
  11. geom_boxplot()+
  12. stat_pvalue_manual(stat.test, label = 'p')
  13.  
  14. #However I get the following error:
  15. # Error in FUN(X[[i]], ...) : object 'supp' not found
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement