[R] comparing SAS and R survival analysis with time-dependent covariates

Göran Broström goran.brostrom at gmail.com
Wed Jul 20 23:44:24 CEST 2011

On Wed, Jul 20, 2011 at 12:02 PM, AO_Statistics <aboueslati at gmail.com> wrote:
> Thomas Lumley-2 wrote:
>> [...]
>> The warning and error messages are correct here.  Look at the point
>> estimate. It's a log hazard ratio of about 20 in one case and about
>> -20 in the other case.  The true partial maximum likelihood estimator
>> is infinite. The estimated standard errors are meaningless, since the
>> partial likelihood isn't close to quadratic at the maximum.
>> [...]
> I see. It explains the results for these testing data sets.
> But, with my real data set I get these results :
> With SAS :
> estimate FERM : 1.47654
> se : 0.03117
> Pr > Khi 2 : <.0001
> hazard ratio : 4.378
> convergence status : "Convergence criterion (GCONV=1E-8) satisfied."
> This time, the hazard ratio is not big. The maximum of the partial
> likelihood seems to be reached.
> The program takes about 45 seconds to finish computation. My sample contains
> 6588 observations with a lot of ties (discrete time values).
> With R :
> I don't get any result. The program freezes and does not respond. I waited
> for about 1 hour without a result.
> So can I conclude in this case that the problem with the "coxph" function is
> due to computation power rather than another algorithmic problem ?

I do not understand why you expect to get comparable results with SAS
"discrete" and coxph "exact". They are two different approaches to
handling ties (as Terry explained; of course, some comparability
should be expected in "normal" cases). If I understand the description
of SAS "discrete" correctly, it is nothing else than logistic
regression with the logit link, i.e., a proportional odds model. Have
you tried the 'coxreg' function in 'eha' with the option "method =
'ml'"? It performs logistic regression with the cloglog link, i.e., a
discrete analogue to the continuous time proportional hazards model.
If you want to mimic exactly what SAS (discrete) does in R, try
'toBinary' in eha, and run an ordinary logistic regression on the
result. Should be close to what SAS gives you. One caveat; the result
of 'toBinary' may be a too huge data frame for the memory
configuration of your computer.

> --
> View this message in context: http://r.789695.n4.nabble.com/comparing-SAS-and-R-survival-analysis-with-time-dependent-covariates-tp874438p3680340.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at r-project.org 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.

Göran Broström

More information about the R-help mailing list