# Why median is NA for some of the group outcomes in survival analysis?

I'm trying to do survival analysis using the Followup information, patient_vital_status and the expression of gene. I'm using like below:

surv_diff <- survdiff(Surv(FollowUpDays, patient_vital_status) ~ ENSG00000001460,
data = data)
surv_diff

Call:
survdiff(formula = Surv(FollowUpDays, patient_vital_status) ~
ENSG00000001460, data = data)

N Observed Expected (O-E)^2/E (O-E)^2/V
ENSG00000001460=high 332       57     70.5      2.58      5.99
ENSG00000001460=low  264       67     53.5      3.40      5.99

Chisq= 6  on 1 degrees of freedom, p= 0.01


From the above I could say that log rank test for difference in survival gives a p-value of p = 0.01, indicating that the Expression groups high and low differ significantly in survival.

To check the median of both the groups which tells us which group is good or bad for prognosis, I used like below:

library(survival)
fit <- survfit(Surv(FollowUpDays, patient_vital_status) ~ ENSG00000001460,
data = data)

print(fit)

Call: survfit(formula = Surv(FollowUpDays, patient_vital_status) ~
ENSG00000001460, data = data)

n events median 0.95LCL 0.95UCL
ENSG00000001460=high 332     57     NA    2134      NA
ENSG00000001460=low  264     67   1741    1503      NA


From the above I see that median of high group is NA and 0.95UCL is also NA for both the groups.

If the median of one of the group is NA how can I say which group is worse for prognosis? Can anyone tell about these NA's here.

Any help is appreciated. thanq

• See this page for a very similar question and answer: you will get NA for median survival if there is still more than 50% survival in a group at the last time point. Please look that page over and edit this question to specify what issues are still giving you problems.
– EdM
Commented Apr 11, 2019 at 18:39
• So, if a group (high or low) has a median NA does it mean that group is good for prognosis? Commented Apr 11, 2019 at 20:49

If one of the groups has not yet dropped to 50% survival at the end of the available data, you cannot compute a median survival and there will be NA values for median survival in such cases. Even if median survival has been reached in a group, it might not be possible to calculate complete confidence intervals for those median values, as you have seen.*

It's very important to look at the data, not just rely on the output from a program. As you are using R, plot(fit) will display the survival curves for the two cases. Note that if the curves cross (as they can) then survival for one group could be better at early times but worse at later times. So even just knowing the difference in median survival values doesn't necessarily tell you which is better for prognosis--then you have to specify which prognosis time you care about.

One approach that gets around the problem of not reaching median survivals is to use a Cox proportional hazards regression model (coxph() in R) instead of survdiff() and survfit(), and examine the hazard ratio between the two groups. This has the further advantage that you can also incorporate other clinical, biochemical, or genetic variables into a combined survival analysis. Proper interpretation of such results, however, requires showing that the hazards are reasonable proportional to each other over time. Plots again are key.

Also, you should consider modeling the relation between gene expression and survival with gene expression as a continuous variable rather than arbitrarily specifying a high/low expression cutoff. (I have found log-transformed gene expression values to work well.) Continuous predictors work seamlessly in Cox regressions but can't be incorporated into the survdiff() paradigm.

*In your particular case it was possible to calculate a 0.95 lower confidence limit (LCL) for median survival in the the "high" group even though the median itself could not be determined. As that value is above the median survival for the "low" group, the "high" group has better survival in this particular case.

• In the above case it looks fine. But in this gene case I don't know how to say which group is good or worse for survival? low_high records n.max n.start events *rmean *se.rmean median 0.95LCL 0.95UCL CFAP97=high 176 176 176 25 2746.767649 261.3634514 2475 1910 NA CFAP97=low 420 420 420 99 2534.369762 144.8695301 2532 1849 NA Commented Apr 29, 2019 at 11:31