[R] crr - computationally singular

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Mon Jul 6 14:05:46 CEST 2009


Laura Bonnett wrote:
> Hi Everyone,
> 
> Thank you for all your comments and suggestions.
> 
> I determined that I had a full rank model matrix by using the code:
>> qr(covaeb)$rank
> This is 17 which is equal to the number of covariates in the matrix, covaeb.
> 
> I cannot invert the model matrix using 'solve' as my matrix is not
> square.  

Ravi was posibly not fully awake when he suggested that...
The singular values (SVD(X)$d) could be more informative.

It is possible that the function is using a less sophisticated matrix
inversion than those based on QR or SVD, in which case they may also
disagree on the rank. Otherwise, as Ravi suggested, this sort of thing
can also happen during (divergent) iterations with e.g. some
observations ending up with zero weights.

-pd

BTW, there's no 'crr' package that I can find. You meant 'cmprisk'?

> In the matrices ending in a, there are 1677 rows and 15
> columns/covariates while in the matrices ending in b, there are 701
> rows and 17 columns.
> 
> Thank you,
> 
> Laura
> 
> 2009/6/26 Ravi Varadhan <RVaradhan at jhmi.edu>:
>> How did you determine that you have "full rank" model matrix comprising 17
>> predictors?  Are you able to invert the model matrix using `solve'?  If not,
>> you still have collinearity problem.
>>
>> If you are, then the problem might be in the Newton's method used by `crr'
>> to solve the partial-likelihood optimization.  The hessian matrix of the
>> parameters might be singular during the iterations.  If this is the case,
>> your best bet would be to just simplify the model, i.e. use fewer
>> predictors.
>>
>> Ravi.
>>
>

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907




More information about the R-help mailing list