[R] lrm in Design package--missing value where TRUE/FALSE needed

David Winsemius dwinsemius at comcast.net
Fri Sep 4 23:18:45 CEST 2009


The idea of estimating 7 parameters from 11 cases using mostly binary  
variables just seems begging for a singular matrix.

On Sep 4, 2009, at 3:59 PM, Ping-Hsun Hsieh wrote:

> Hi,
>
> A error message arose while I was trying to fit a ordinal model with  
> lrm() I am using R 2.8 with Design package.
>
> Here is a small set of mydata:
> RC	RS	Sex	CovA	CovB	CovC	CovD	CovE
> 2	1	0	1	1	0	-0.005575280	2
> 2	1	0	1	0	1	-0.001959580	2
> 3	0	0	0	1	0	-0.004725880	2
> 0	0	0	1	0	0	-0.005504850	2
> 2	1	1	0	0	0	-0.003880170	1
> 2	1	0	0	1	0	-0.006074230	2
> 2	1	0	0	1     1 	-0.003963920	2
> 2	1	0	0	1	0	 0.000658230	2
> 2	1	0	1	0	1	-0.002033610	2
> 0	0	0	0	0	1	-0.007761770	2
> 0	0	0	0	1	1	-0.000951784	2
>
> Note: In the complete data, there are NAs. But the error messages  
> showed in both the complete and above sets.
>
>> attach(mydata)
>> lrm(RC~RS+Sex+CovA+CovB+CovC+CovD+CovE,data=mydata,na.action=na.pass)
> singular information matrix in lrm.fit (rank= 8 ).  Offending  
> variable(s):
> CovE
> Error in j:(j + params[i] - 1) : NA/NaN argument
>
>> detach(mydata)
>> lrm(mydata$RC~ mydata$RS+ mydata$Sex+ mydata$CovA+ mydata$CovB+  
>> mydata$CovC+ mydata$CovD+ mydata$CovE,data=mydata,na.action=na.pass)
> Error in if (!length(fname) || !any(fname == zname)) { :
>  missing value where TRUE/FALSE needed
>
>
> I have debugged for a while, but no success. Does anyone know what  
> happens?

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list