Question: R survival analysis : surv_pvalue vs fit.coxph for log-rank-test pvalue
gravatar for ZheFrench
4 days ago by
ZheFrench250 wrote:

I have different value for test$pval and and other.pval that should return the same log-rank test p-value, no ?

surv_object <- Surv(time = as.numeric(final_group_annotated[,time]), event = final_group_annotated[,opt$endPoint] )it1 <- survfit(surv_object ~ group, data = final_group_annotated)

test=surv_pvalue(fit1, final_group_annotated)


fit.coxph <- coxph(surv_object ~ group, data = final_group_annotated)

coxph(formula = surv_object ~ group, data = final_group_annotated)

  n= 188, number of events= 30

               coef exp(coef) se(coef)      z Pr(>|z|)
groupgroup2 -0.3482    0.7060   0.3689 -0.944    0.345

            exp(coef) exp(-coef) lower .95 upper .95
groupgroup2     0.706      1.417    0.3426     1.455

Concordance= 0.538  (se = 0.049 )
Likelihood ratio test= 0.87  on 1 df,   p=0.4
Wald test            = 0.89  on 1 df,   p=0.3
Score (logrank) test = 0.9  on 1 df,   p=0.3

other.pval <- coef(summary(fit.coxph))[,5]


survival analysis R • 53 views
ADD COMMENTlink modified 4 days ago by Kevin Blighe51k • written 4 days ago by ZheFrench250
gravatar for Kevin Blighe
4 days ago by
Kevin Blighe51k
Kevin Blighe51k wrote:

The p-value returned by Surv() is the log-rank p-value from the score test; so, you should be comparing this to the log-rank p-value from the Cox PH model. I went over this recently in this thread: A: survfit(Surv()) P-value interpretation for 3 survival curves?


The way that you are doing it, i.e.:


This will return multiple p-values when there are multiple strata, one p-value representing a single stratum / coefficient compared to the reference stratum.

To extract the log-rank p-value for the overall model, you need to use:



ADD COMMENTlink modified 4 days ago • written 4 days ago by Kevin Blighe51k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1229 users visited in the last hour