bhklab / CoreGx

Shared code for both PharmacoGx and RadioGx
https://bhklab.github.io/CoreGx/
GNU General Public License v3.0
2 stars 3 forks source link

mcc p-value is not correct for negative estimate #118

Closed spocks closed 3 years ago

spocks commented 3 years ago

For negative values of mcc estimate, function is returning wrong p-values

x <- factor(c("A", "B", "A", "B", "A", "A"))
CoreGx::mcc(x,x)

#$estimate
#[1] 1
#$p.value
#[1] 0.000999001

y <- factor(x, levels = c("B","A"))
CoreGx::mcc(x, y)

#$estimate
#[1] -1
#$p.value
#[1] 0.941
p-smirnov commented 3 years ago

No one said it was a two sided p value :smile:

Will fix with the standard alternative parameter

bhaibeka commented 3 years ago

Should we make it two-sided by default?

spocks commented 3 years ago

yes should be two-sided by default just like Pearson etc.

p-smirnov commented 3 years ago

22a4502d65f9bc5976a877ed0f0edc3b5dd1ab88 is not two sided (missing a factor of 2)

p-smirnov commented 3 years ago

09e5658 adds alternative par, defaults to two sided.

good catch on the >= @spocks