Open microresearcher opened 4 years ago
Hi, would you please provide a reproducible R code with a demo data (using the reprex R package)
Hi, I am meeting the same problem as you described by using rstatix package. I am wondering if you find some solutions for it? I am appreciative of any shares or helps with it! Thank you in advance!
A reproducible script with a demo data are needed so that I can help efficiently.
A reproducible script with a demo data are needed so that I can help efficiently.
@kassambara Hi, thanks a lot for this great package! I encountered the same error, though the cause might be different. After checking my data, I though it could be caused by 'all 0 values in one group'. When using the following minimal code, I reproduced the same error. Please see below:
` library(rstatix)
df <- data.frame(group = c(rep('a', 10), rep('b', 10)), value = rep(0, 20)) t_test(df, value ~ group) wilcox_test(df, value ~ group)
t.test(rep(0, 10), rep(0, 10)) wilcox.test(rep(0, 10), rep(0, 10))
df <- data.frame(group = c(rep('a', 10), rep('b', 10)), value = 1:20) t_test(df, value ~ group) wilcox_test(df, value ~ group)
`
A reproducible script with a demo data are needed so that I can help efficiently.
@kassambara Hi, thanks a lot for this great package! I encountered the same error, though the cause might be different. After checking my data, I though it could be caused by 'all 0 values in one group'. When using the following minimal code, I reproduced the same error. Please see below:
` library(rstatix)
reproduce the error
df <- data.frame(group = c(rep('a', 10), rep('b', 10)), value = rep(0, 20)) t_test(df, value ~ group) wilcox_test(df, value ~ group)
base R ttest and wilcox test is fine; show warning, but not error
t.test(rep(0, 10), rep(0, 10)) wilcox.test(rep(0, 10), rep(0, 10))
to show the error only happens when one group has all 0 value
df <- data.frame(group = c(rep('a', 10), rep('b', 10)), value = 1:20) t_test(df, value ~ group) wilcox_test(df, value ~ group)
`
Hello, I met the same problem, I wonder if you have solved this problem? Thank you very much.
Sorry for not following up. The script guanxn90 shared is indeed what gets me the error as well. Hope what they shared is helpful in solving the issue! Thanks again
Hi all, I am getting the same error, I was wondering whether you figured out what is wrong.
@Victor-K27 I was getting this same error as well, but eventually realized that there were a lot of zeros in the data for each group I was using, so I had to use a different tool to deal with the zero inflated values. The tool I found and used was https://github.com/chvlyl/ZIR/
Hi @kassambara I got the same error (Error in if (f.lower <= 0) return(mumin) : missing value where TRUE/FALSE needed) and here is a reproducible example
ps.prev.phylum is attached as .zip of .rds vector that you can read as follow ps.prev.phylum <- readRDS("ps.prev.phylum.rds") ps.prev.phylum.zip
# psmelt
ps.prev.phylum_melt <- ps.prev.phylum %>%
psmelt()
# log transform
ps.prev.phylum_melt$logAbundance <- log10(1 + ps.prev.phylum_melt$Abundance)
# select only Fusobacteriota
ps.prev.phylum_melt.fuso <- subset(ps.prev.phylum_melt, subset = Phylum == "Fusobacteriota")
# pairwise wilcox
ps.prev.phylum_melt.fuso.pairwise <- pairwise_wilcox_test(ps.prev.phylum_melt.fuso,
Abundance ~ Sample_Regime,
p.adjust.method = "BH")
Error in if (f.lower <= 0) return(mumin) : missing value where TRUE/FALSE needed
I have this same error when I try using wilcox_test, which is the test I need to use. When I try using t_test, it works without a single issue.
I had this issue too, but found that it was due to that some values were non-finite (Inf, to be precise) in the data. When removing those, the test worked fine.
@Victor-K27 I was getting this same error as well, but eventually realized that there were a lot of zeros in the data for each group I was using, so I had to use a different tool to deal with the zero inflated values. The tool I found and used was https://github.com/chvlyl/ZIR/
Exactly the same issue for me, and the solution works! Thanks for sharing.
Hi,
I am using the rstatix package to compare the microbiota between three different groups, and when using the pairwise_wilcox_test I ran into an issue with certain bacteria where it gave the following error:
Error in if (f.lower <= 0) return(mumin) : missing value where TRUE/FALSE needed
Running the base pairwise.wilcox.test function worked perfectly fine on these bacteria though. When I took a look at the specific bacteria, I found that they were present in one group and absent in the other two, so I suspect that is related to the issue. I would really like to find a way to make this work, however, as I am using the output of pairwise_wilcox_test to generate boxplots of the significant bacteria with p-value annotations using stat_pvalue_manual, which the rstatix package seems to work really well for.
Seeing as the base pairwise.wilcox.test ran fine, I would think that pairwise_wilcox_test is intended to be able to handle this as well. I'd appreciate any help with this!
Thanks in advance.