[R] two group cox model

David Winsemius dwinsemius at comcast.net
Sun Oct 31 00:12:06 CEST 2010


On Oct 30, 2010, at 4:36 PM, cheba meier wrote:

> Dear all,
>
> I am doing
>
> library(survival)
> fit   <- coxph(Surv(futime,fustat) ~ rx, ovarian)
>
> plot(survfit(fit,newdata=ovarian),col=c(1,2))
> legend("bottomleft", legend=c("rx = 0", "rx = 1"),
>       lty=c(1,2),col=c(1,2))
> Is this correct to compare these two groups?

Is this a trick question?

> Is the 0.31 the p-value that
> the median f two groups are equal

That seems unlikely because one of the curves has not even reached the  
median. You might want to look at

?anova.coxph

> Why lty does not work here?

Perhaps you should define "not work". It seems to create a solid and  
dashed line in the legend when I use it.

?par     #    .... 1=solid (default), 2=dashed,....


>
> Many thanks in advance.
> Cheba
>


David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list