[R] help--Cox ph model

Göran Broström gb at stat.umu.se
Tue Mar 11 12:23:46 CET 2003


On 10 Mar 2003, Peter Dalgaard BSA wrote:

> "Song, Guangchun" <Guangchun.Song at stjude.org> writes:
> 
> > Dear r-users,
> > 
> > I want to use the Cox's ph model to analyze survival data set.  How can I
> > extract the model coefs. and Wald test p-value or Score?
> 
> Unlike most other modelling code, summary.coxph() just prints its
> results rather than store them in an object that can be queried. So
> basically, you need to copy code from summary.coxph. It's not all that
> hard. 
> 
> 

On the other hand, you can do

> fit <- coxph(Surv(enter, exit, event) ~ season, data = rrv)
> coef(fit)
seasonspring seasonsummer   seasonfall 
   0.1900660   -0.4514284   -0.4560273 

and  'fit$score'  and  'fit$wald.test' to get score and Wald _statistics_. 

Göran 
---
 Göran Broström                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Umeå University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se



More information about the R-help mailing list