[R] p-values from coxph?

Terry Therneau therneau at mayo.edu
Mon Oct 18 14:48:35 CEST 2010


On Oct 15, 2010, at 9:21 AM, ?hagen Patrik wrote:

>
> Dear List,
>
> I each iteration of a simulation study, I would like to save the p- 
> value generated by "coxph". I fail to see how to adress the p-value.  
> Do I have to calculate it myself from the Wald Test statistic?

No.  Look at help(coxph.object).  This list the components of a coxph
object and explains what they are.  You will find that
   fit <- coxph(.....
   fit$wald.test

contains the Wald test statistic.  I prefer the likelihood ratio test
myself 2*diff(fit$loglik), with fit$df degrees of freedom.

Hunting with str(...) is a good strategy, but even better is the
documentation (when it exists).

Terry T.



More information about the R-help mailing list