1

Is there way to carry out a wilcoxon.test by group, with calculate confidence intervals, and then plot these results in ggplot?

My "data":

zero <- sample(0:0, 50, replace = TRUE)
small <- sample(1:5, 20, replace = TRUE)
medium <- sample(5:25, 15, replace = TRUE)
high <- sample(150:300, 5, replace = TRUE)

f <- function(x){
  return(data.frame(ID=deparse(substitute(x)), value=x))
}

all <- bind_rows(f(zero), f(small), f(medium), f(high))
all <- as.data.frame(all[,-1])
names(all)[1] <- "value"

all$group <- c("a", "b", "c")

My attempt:

x <- ddply(all, .(group), function(x) {wilcox.test(all$value, conf.int=TRUE, conf.level=0.95)})
Error in list_to_dataframe(res, attr(.data, "split_labels"), .id, id_as_factor) : 
  Results must be all atomic, or all data frames
In addition: There were 12 warnings (use warnings() to see them)

I'd then like to plot the psuedo-medians with their respective confidence intervals, but I'm also not sure how to save the results for ggplot to work from.

Nate
  • 411
  • 2
  • 10

0 Answers0