Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent incorrect results for data with missing values (NAs) ? #25

Open
karoliskoncevicius opened this issue Apr 8, 2023 · 0 comments
Open

Comments

@karoliskoncevicius
Copy link

Seems like wilcoxauc() silently returns incorrect results when data has missing values:

library(presto)
set.seed(14)

x <- rnorm(20)
g <- gl(2, 10)

All is good when no missing values are present:

wilcox.test(x ~ g, exact=FALSE)$p.value
[1] 0.7913368
wilcoxauc(t(x), g)$pval[1]
[1] 0.7913368

Add one missing obvervation:

x[14] <- NA

Now the result is not correct:

wilcox.test(x ~ g, exact=FALSE)$p.value
[1] 0.9674355
wilcoxauc(t(x), g)$pval[1]
[1] 0.9097219

Remove the missing value from the data:

x <- x[-14]
g <- g[-14]

Result is correct again:

wilcox.test(x ~ g, exact=FALSE)$p.value
[1] 0.9674355
wilcoxauc(t(x), g)$pval[1]
[1] 0.9674355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant