georgheinze / coxphf

2 stars 0 forks source link

Algorithm changed when transitioning from 1.13.1 to 1.13.3? #12

Closed aushev closed 1 year ago

aushev commented 1 year ago

Here's my sample dataset:

require(data.table)
require(survival); 
require(coxphf); 

dt1 <- fread(
'Group Event Time
Neg  TRUE   70
Neg  TRUE   88
Neg FALSE  184
Neg FALSE  227
Neg  TRUE  245
Neg  TRUE  274
Neg FALSE  646
Neg FALSE  688
Neg FALSE  747
Pos  TRUE   39
Pos  TRUE   56
')

With coxphf version 1.13.1, I had p-value p=0.006:

coxphf(formula = Surv(time = Time, event = Event) ~ Group, data = dt1)
# Model fitted by Penalized ML
# Confidence intervals and p-values by Profile Likelihood 
# 
# coef se(coef) exp(coef) lower 0.95 upper 0.95    Chisq           p
# GroupPos 3.526328 1.929072  33.99889   2.622605   4758.575 7.414588 0.006469714
# 
# Likelihood ratio test=7.414588 on 1 df, p=0.006469714, n=11

With 1.13.3, I get p=0.383 for the same dataset:

coxphf(formula = Surv(time = Time, event = Event) ~ Group, data = dt1)
# Model fitted by Penalized ML
# Confidence intervals and p-values by Profile Likelihood 
# 
# coef se(coef) exp(coef)  lower 0.95 upper 0.95     Chisq         p
# GroupPos -1.134009  1.68652 0.3217409 0.002410089   3.109158 0.7606559 0.3831233
# 
# Likelihood ratio test=0.7606559 on 1 df, p=0.3831233, n=11

What has changed so dramatically?

aushev commented 1 year ago

P.S. For illustration, here's how the KM plot look: image

karl-an commented 1 year ago

my results also change but only a little bit

gregorsteiner commented 1 year ago

Hi, thanks for raising this issue! This was indeed a mistake on our side. One of the changes we made in the previous update turned out to be incorrect, thanks for noticing! #15 fixes this