about the cox result

3 messages Options
Embed this post
Permalink
孟欣

about the cox result

Reply Threaded More More options
Print post
Permalink
Hi all:
I finished cox analysis like this:
fit_cox<-coxph(Surv(dat$Time, dat$death) ~ dat$CD4 + strata(dat$gender),data=dat);
> fit_cox
Call:
coxph(formula = Surv(data_ori$Time, data_ori$death) ~ data_ori$drug +
    strata(data_ori$gender), data = data_ori)

                  coef exp(coef) se(coef)    z    p
data_ori$drugddI 0.216      1.24    0.146 1.47 0.14
Likelihood ratio test=2.17  on 1 df, p=0.140  n= 467
 
I wanna extract the result:
0.216      1.24    0.146 1.47 0.14 and the corresponding name "coef exp(coef) se(coef)    z    p"
from fit_cox.
 
I use the command:
str(fit_cox),but I can only find 0.216 of the result,but the other four results( 1.24    0.146 1.47 0.14) can't be found.
 
 
Anyone can help me?
Thanks a lot!

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Yihui Xie

Re: about the cox result

Reply Threaded More More options
Print post
Permalink
coef(summary(fit_cox)) should give you what you wanted.

Regards,
Yihui
--
Yihui Xie <[hidden email]>
Phone: 515-294-6609 Web: http://yihui.name
Department of Statistics, Iowa State University
3211 Snedecor Hall, Ames, IA



On Tue, Nov 3, 2009 at 12:31 AM, 孟欣 <[hidden email]> wrote:

> Hi all:
> I finished cox analysis like this:
> fit_cox<-coxph(Surv(dat$Time, dat$death) ~ dat$CD4 + strata(dat$gender),data=dat);
>> fit_cox
> Call:
> coxph(formula = Surv(data_ori$Time, data_ori$death) ~ data_ori$drug +
>    strata(data_ori$gender), data = data_ori)
>
>                  coef exp(coef) se(coef)    z    p
> data_ori$drugddI 0.216      1.24    0.146 1.47 0.14
> Likelihood ratio test=2.17  on 1 df, p=0.140  n= 467
>
> I wanna extract the result:
> 0.216      1.24    0.146 1.47 0.14 and the corresponding name "coef exp(coef) se(coef)    z    p"
> from fit_cox.
>
> I use the command:
> str(fit_cox),but I can only find 0.216 of the result,but the other four results( 1.24    0.146 1.47 0.14) can't be found.
>
>
> Anyone can help me?
> Thanks a lot!

______________________________________________
[hidden email] 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.
Therneau, Terry M., Ph.D.

Re: about the cox result

Reply Threaded More More options
Print post
Permalink
In reply to this post by 孟欣
 To extract various portions of the coxph standard printout, look at
summary.coxph
 help('summary.coxph')

fit <- coxph(...
sfit <- summary(fit)

Terry Therneau

______________________________________________
[hidden email] 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.