Question: In R, Why is the survdiff function returning the p value = 0?
0
gravatar for Goldname100
3.1 years ago by
Goldname1000 wrote:

I want to obtain the pvalue of the three curves that are plotted. Here is the code that does a survdiff:

fitSurvDiffP <- survdiff(formula = Surv(predictI, trainD[,"Status"]) ~ cond)

predictI is the predicted time, which is just a numberic vector. trainD[,"Status"] is the status of the patient and cond is a character vector that specifies either "Low", "Med", or "High" risk.

For some reason, however, the output is p = 0. There are numbers for everything else, but I keep getting p = 0 for all 7 of my graphs.

Here's one of my outputs:

Call: survdiff(formula = Surv(predictI, trainD[, "Status"]) ~ cond)

N Observed Expected (O-E)^2/E (O-E)^2/V
cond=High 145 97 20.4 287.449 389.40

cond=Low 53 36 102.4 43.080 112.45

cond=Med 206 128 138.2 0.748 2.15

Chisq= 456 on 2 degrees of freedom, p= 0
survival analysis R • 2.0k views
ADD COMMENTlink modified 3.1 years ago by genomax70k • written 3.1 years ago by Goldname1000
2
gravatar for Istvan Albert
3.1 years ago by
Istvan Albert ♦♦ 81k
University Park, USA
Istvan Albert ♦♦ 81k wrote:

The precise answer is a bit more complicated but the way to think about it is that when using R numbers are rounded to (typically) 53 binary digits accuracy.

When your p value is very small and reaches this limit (typically smaller than 1e-16) it will be reported as zero. Hence all values less than 1e-16 will be reported as zero.

People that run into this problem end up holding two different opinions:

  • It is awesome because it takes away people's ability to sort the results by p-value.

or

  • It is much hated because it takes away people's ability to sort the results by p-value.
ADD COMMENTlink modified 3.1 years ago • written 3.1 years ago by Istvan Albert ♦♦ 81k
1

In my experience it's a misunderstanding of what the code is trying to do. I guess goldname98 wants several different p-values, but the code is just telling him "yup, those three conditions are definitely different".

ADD REPLYlink written 3.1 years ago by karl.stamm3.5k
1

The issue is even more confusing since from statistical (and common sense) interpretation a value p=0 is incorrect, it cannot exist within the framework of statistics.

But that just adds to the conundrum - we have a statistical test where the result is rounded to an incorrect value...

ADD REPLYlink written 3.1 years ago by Istvan Albert ♦♦ 81k
Please log in to add an answer.

Help
Access

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