[R] Extract p-value from survdiff function

Christos Hatzis christos at nuverabio.com
Thu Apr 26 21:22:31 CEST 2007


If 

sdf <- survdiff(...)
 
is your survdiff object, the p-value can be computed as follows:

p.val <- 1 - pchisq(sdf$chisq, length(sdf$n) - 1)

and then use it in your K-M plot.

-Christos

Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Suite 5350
Woburn, MA 01801
Tel: 781-938-3830
www.nuverabio.com
 


> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Armin Goralczyk
> Sent: Thursday, April 26, 2007 3:03 PM
> To: R-help at stat.math.ethz.ch
> Subject: [R] Extract p-value from survdiff function
> 
> Hi list,
> I want to use the p-value from the survdiff function (package
> survival) to reuse within a function in a Kaplan-Meier plot. 
> The p-value is somehow not a component of the value list ?!
> 
> Thanks in advance
> --
> A. Goralczyk
> Göttingen, Ger.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list