Reputation: 783
Hel lo I would like to test something, I have 2 variables:
Var1 : Presence/absence
Var2 : pvalue value
and I would like to show that when I have a presence value , the pvalues
is statistacly < 0.05
here is an exemple :
var1 var2
1 0.003
1 0.0005
0 0.2
0 0.23
0 0.4
1 0.004
1 0.0000005
1 0.03
1 0.04
0 0.12
0 0.34
0 0.43
0 0.32
1 0.034
1 0.003
I thought to a correlation test but I do not know how to deal with absence/presence values of the var1. Does someone have an idea?
Upvotes: 0
Views: 299
Reputation: 46968
You can show an association between 0/1 and p < 0.05. This is your table:
tab = structure(list(var1 = c(1L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 0L,
0L, 0L, 0L, 1L, 1L), var2 = c(0.003, 5e-04, 0.2, 0.23, 0.4, 0.004,
5e-07, 0.03, 0.04, 0.12, 0.34, 0.43, 0.32, 0.034, 0.003)), class = "data.frame", row.names = c(NA,
-15L))
Binarize it, seems like a perfect association:
table(tab$var1,as.numeric(tab$var2 < 0.05))
0 1
0 7 0
1 0 8
fisher.test(table(tab$var1,as.numeric(tab$var2 < 0.05)))
Fisher's Exact Test for Count Data
data: table(tab$var1, as.numeric(tab$var2 < 0.05))
p-value = 0.0001554
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
5.83681 Inf
sample estimates:
odds ratio
Inf
Upvotes: 0