Alcampopiano / hypothesize

Robust statistics in Python
https://alcampopiano.github.io/hypothesize/
BSD 3-Clause "New" or "Revised" License
62 stars 3 forks source link

Added mcpKadjp function. #11

Closed bwettimz closed 3 years ago

bwettimz commented 4 years ago

Added basic part of mcpJadjp function in utilities.py. Only Holm's method is available, but I will add the other methods in next push.

bwettimz commented 4 years ago

Changes:

PYTHON OUTPUT rawp Holm 0 0.7800 1.0000 1 0.0100 0.0600 2 0.0300 0.1200 3 0.0110 0.0600 4 0.0030 0.0210 5 0.5600 1.0000 6 0.1200 0.3600 7 0.0001 0.0008

rawp Hochberg 0 0.7800 0.7800 1 0.0100 0.0550 2 0.0300 0.1200 3 0.0110 0.0550 4 0.0030 0.0210 5 0.5600 0.7800 6 0.1200 0.3600 7 0.0001 0.0008

R OUTPUT rawp Holm [1,] 0.7800 1.0000 [2,] 0.0100 0.0600 [3,] 0.0300 0.1200 [4,] 0.0110 0.0600 [5,] 0.0030 0.0210 [6,] 0.5600 1.0000 [7,] 0.1200 0.3600 [8,] 0.0001 0.0008

rawp Hochberg [1,] 0.7800 0.7800 [2,] 0.0100 0.0550 [3,] 0.0300 0.1200 [4,] 0.0110 0.0550 [5,] 0.0030 0.0210 [6,] 0.5600 0.7800 [7,] 0.1200 0.3600 [8,] 0.0001 0.0008

Alcampopiano commented 3 years ago

@bwettimz

Hello,

Unfortunately, given the same input, Wilcox's R function still produces different values when compared to your function. For example,

In Python:

p=[0.01, 0.05, 0.02]
mcpKadjp(, k=.4, proc = 'Holm')

rawp Holm 0 0.01 0.03 1 0.05 0.05 2 0.02 0.04

In R:

p=c(.01, .05, .02)
mcpKadjp(p, k=.4, proc='Holm', rawp=p)

rawp Holm [1,] 0.01 0.075 [2,] 0.05 0.125 [3,] 0.02 0.100

The formulas for crit appear to be incorrect in the Python code from what I can tell.

Alcampopiano commented 3 years ago

@bwettimz I'm kindly closing this PR due to inactivity. I'm happy to reopen it in the future. Take care.