Dear all,

I have a beginner's R question for coxph() and survfit().
I have a data set with survival time (no censoring) and treatment 
indicator(0/1). I did something like

fit<-coxph( Surv(t)~treat, method="breslow",data=data)
> fit
Call:
coxph(formula = Surv(t) ~ treat, data = data, method = "breslow")


       coef exp(coef) se(coef)     z       p
treat -1.96     0.140    0.243 -8.07 6.7e-16

Likelihood ratio test=80.3  on 1 df, p=0  n= 144 

> plot(survfit(fit))

But it only gives me the curve with combined treatment. How do I get a plot 
with two curves for different treatments.
I don't want to do 
new<-data.frame(treat=c(0,1))
and plot(survfit(fit,newdata=new)) cause it gives you predicted curves for two 
treatments.

Thanks you so much for your help.

Jimmy Chu
        [[alternative HTML version deleted]]

______________________________________________
R-help@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

Reply via email to