[R] Explaining Survival difference between Stata and R

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed May 12 13:48:55 CEST 2004


Göran Broström <gb at stat.umu.se> writes:

>                       coef exp(coef) se(coef)      z    p
> I(haz.wst * 1e-06) 0.08479      1.09    0.095 0.8920 0.37
> pol.free           0.00896      1.01    0.170 0.0526 0.96
> 
> Likelihood ratio test=0.76  on 2 df, p=0.685  n= 21 
> ----------------------------------------------------------------
> and now 'coxph' gets the same results as 'coxreg'. I don't know about coxph
> for sure, but I do know that coxreg centers all covariates before the NR
> procedure starts. Maybe we also should rescale to unit variance? And of
> course scale back the coefficients and se:s at the end? 

It's not the only place one bumps into this effect. It stems from the
matrix routines' heuristics for detecting singularities, and one of
them is that a column of very small numbers (relative to the other
columns) is indistinguishable from zero. 

It is not obvious that this is really done optimally for a statistical
context. E.g., it would definitely be possible to have a Choleski
factorization that looks for relative loss of precision instead of
looking at the numeric value of the computed diagonal elements.
However, the routines in standard libraries were typically developed
for situations where the scale is similar for all coordinates.

On the other hand, choosing always to rescale to unit variance,
prevents catching those cases where a column really is zero up to
roundoff in the computations. 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list