s-news
[Top] [All Lists]

How to Avoid Singularity in lrm

To: s-news@lists.biostat.wustl.edu
Subject: How to Avoid Singularity in lrm
From: Stuart Luppescu <s-luppescu@uchicago.edu>
Date: Mon, 27 Nov 2006 23:15:46 -0600
Hello, I have 11 years of data (1995 to 2005) on about 550 units. I want
to do two discontinuous robust regressions on each set of data. One set
of predictors (years1) is  
[1] 0 0 0 0 0 0 1 2 3 4 5
and the other (years2) is
[1] 1 2 3 4 5 0 0 0 0 0 0
I run the models like this:
rlm(stab[,2:12] ~ years1, psi=psi.bisquare)
and similarly with years2 as the predictor. I'm running this on the 550
units using apply().
This works fine except when the last 5 years of data are missing. In
that case the whole thing blows up and I get this message:
Error in rlm.default(x, y, weights, method = method, wt.method =
wt.method,  : 
     'x' is singular: singular fits are not implemented in rlm
How can I get this to just skip over the cases where x is singular, and
just go on the the next one?
(I'm running R 2.3.1 and MASS 7.2)

Thanks.
-- 
Stuart Luppescu -=- s-luppescu .at. uchicago.edu        
University of Chicago (^_^)/ CCSR 
才文と智奈美の父 -=-=- Kernel 2.6.17-gentoo-r
Lay off the muses, it's a very tough dollar.   -- 
S.J. Perelman 




<Prev in Thread] Current Thread [Next in Thread>
  • How to Avoid Singularity in lrm, Stuart Luppescu <=