I am working on a large dataset of offspring sex ratio from +36,000 individuals of over 1,000 species. I want to see if the median sex ratio of each species significantly differs from .5. I am using a one-sample wilcoxon to do this. Here is an example dataset:
n<-100
dat<-data.frame(species=rep(LETTERS[1:5],n/5), SR=sample((1:100)/100,n,replace=TRUE))
When I run the following code, I get results where all p-values are the same.
library(dyplr)
res <- dat %>% group_by(species) %>%
do(w=wilcox.test(dat$SR,mu=.5,alternative=("two.sided"))) %>%
summarize(species,wilcox=w$p.value)
res
#OUTPUT#
# # A tibble: 5 x 2
species wilcox
<chr> <dbl>
1 A 0.465
2 B 0.465
3 C 0.465
4 D 0.465
5 E 0.465
Any idea what I'm doing wrong and how I can fix this?