[RsR] Maximum number of variables with lmRob? Error: singular matrix encountered

Manuel Koller ko||er @end|ng |rom @t@t@m@th@ethz@ch
Mon Aug 27 17:27:48 CEST 2012


Dear Fabricio,

Have you tried to fit the data using lm? If it does not work there,
then the problem most likely lies with the dataset.
Did you use lmRob (package robust) for a specific reason? The newer
versions of lmrob (package robustbase) also support categorical
variables, even without reverting to M-S estimates. You could also try
to fit your data using lmrob. Just make sure to use the most recent
version (0.9-3). You can check this by typing the command
sessionInfo().

Best regards,

Manuel

On Sun, Aug 26, 2012 at 8:16 PM, Andreas Alfons
<andreas.alfons using kuleuven.be> wrote:
> On Sun, Aug 26, 2012 at 4:18 PM, Fabricio Vasselai
> <fabriciovasselai using gmail.com> wrote:
>> Thank you very much for the fast reply.
>>
>> What info about the dataset would be helpful to figure out what's going on
>> about that error message? I am using a dataset wth N = 602, with
>> information political institution in countries. Variables are almost all
>> continuous and a few are binary. I am running two interation terms in the
>> models. I'll be more than happy to provide any needed info.
>
> Without a fully reproducible example (data + code), I'm afraid there's
> not much anybody can really do to help you.  If your data are
> confidential, please try to reproduce the error with simulated data.
>
> -Andreas
>
>
>> 2012/8/26 Kaveh Vakili <kaveh.vakili using wis.kuleuven.be>
>>
>>>
>>>
>>> whatever it is, it is specific to the dataset you are using, not the
>>> software:
>>>
>>> library(robust)
>>> p<-20
>>> n<-200
>>> x<-matrix(rnorm(n*p),n,p)
>>> b<-rnorm(p+1)
>>> y<-cbind(1,x)%*%b+rnorm(n)
>>> lmRob(y~x)
>>>
>>>
>>> you should therefore provide more informations about the dataset,
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 08/26/2012 07:33 AM, Fabricio Vasselai wrote:
>>>
>>>> Dear list,
>>>>
>>>> I've been trying different models with lmRob for the past days and I was
>>>> wondering: is there a maximum number of variables to include in a model so
>>>> to avoid the following error in lmRob?
>>>> The error message is:
>>>>
>>>> Error in lmRob.fit.compute(x2, y, x1 = x1, x1.idx = x1.idx, nrep = nrep,
>>>>  :
>>>>    Singular matrix encountered.Erro em ans[[i]]$call : $ operator is
>>>>
>>>> invalid for atomic vectors
>>>>
>>>>
>>>> It seems to me that there is a limit of 14 independent variables plus the
>>>> intercept. It can run any combination of variables in any dataset I try,
>>>> as
>>>> far as final parameters are not beyond this limit.
>>>> Is it right? I did not find information about this yet. Is there a way to
>>>> go beyond this number of variables?
>>>>
>>>> Thanks in advance!
>>>> Best,
>>>>
>>>> FABRICIO
>>>>
>>>>         [[alternative HTML version deleted]]
>>>>
>>>> ______________________________**_________________
>>>> R-SIG-Robust using r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-robust<https://stat.ethz.ch/mailman/listinfo/r-sig-robust>
>>>>
>>>
>>> ______________________________**_________________
>>> R-SIG-Robust using r-project.org mailing list
>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-robust<https://stat.ethz.ch/mailman/listinfo/r-sig-robust>
>>>
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-Robust using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-robust
>
>
>
> --
> Andreas Alfons
> Faculty of Business and Economics, KU Leuven
> www.econ.kuleuven.be/andreas.alfons/public/
>
> _______________________________________________
> R-SIG-Robust using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-robust



-- 
Manuel Koller <koller using stat.math.ethz.ch>
Seminar für Statistik, HG G 18, Rämistrasse 101
ETH Zürich  8092 Zürich  SWITZERLAND
phone: +41 44 632-4673 fax: ...-1228
http://stat.ethz.ch/people/kollerma/




More information about the R-SIG-Robust mailing list