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

2009-09-04 Thread Frank E Harrell Jr

annie Zhang wrote:

Hi, Frank,
 
I met the same problem. My data does not have NA, when I run

fit <- lrm(Y_t~.,data=X)
The error message is:
singular information matrix in lrm.fit (rank= 35 ).  Offending variable(s):
X35
 Error in j:(j + params[i] - 1) : NA/NaN argument

How can I avoid this?
 
Thank you,
 
Annie


Please read earlier posts.  Avoid it by not having an overdescribed 
problem which will result in overfitting.


Frank

On Fri, Sep 4, 2009 at 2:44 PM, Frank E Harrell Jr 
mailto:f.harr...@vanderbilt.edu>> wrote:


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 CovACovBCovCCovDCovE
2   1   0   1   1   0   -0.0055752802
2   1   0   1   0   1   -0.0019595802
3   0   0   0   1   0   -0.0047258802
0   0   0   1   0   0   -0.0055048502
2   1   1   0   0   0   -0.0038801701
2   1   0   0   1   0   -0.0060742302
2   1   0   0   1 1 -0.0039639202
2   1   0   0   1   00.0006582302
2   1   0   1   0   1   -0.0020336102
0   0   0   0   0   1   -0.0077617702
0   0   0   0   1   1   -0.0009517842

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)


Please read the documentation.  Use data=.  Don't use $ in variables
in the model.  I don't know what na.pass is.  lrm does not allow NAs
to be used in the attempted model fit.

Frank


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?

Thanks,
Mike
__
R-help@r-project.org  mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2009-09-04 Thread annie Zhang
Hi, Frank,

I met the same problem. My data does not have NA, when I run
fit <- lrm(Y_t~.,data=X)
The error message is:
singular information matrix in lrm.fit (rank= 35 ).  Offending variable(s):
X35
 Error in j:(j + params[i] - 1) : NA/NaN argument

How can I avoid this?

Thank you,

Annie
On Fri, Sep 4, 2009 at 2:44 PM, Frank E Harrell Jr  wrote:

> 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 CovACovBCovCCovDCovE
>> 2   1   0   1   1   0   -0.0055752802
>> 2   1   0   1   0   1   -0.0019595802
>> 3   0   0   0   1   0   -0.0047258802
>> 0   0   0   1   0   0   -0.0055048502
>> 2   1   1   0   0   0   -0.0038801701
>> 2   1   0   0   1   0   -0.0060742302
>> 2   1   0   0   1 1 -0.0039639202
>> 2   1   0   0   1   00.0006582302
>> 2   1   0   1   0   1   -0.0020336102
>> 0   0   0   0   0   1   -0.0077617702
>> 0   0   0   0   1   1   -0.0009517842
>>
>> 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)
>>>
>>
> Please read the documentation.  Use data=.  Don't use $ in variables in the
> model.  I don't know what na.pass is.  lrm does not allow NAs to be used in
> the attempted model fit.
>
> Frank
>
> 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?
>>
>> Thanks,
>> Mike
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
> --
> Frank E Harrell Jr   Professor and Chair   School of Medicine
> Department of Biostatistics   Vanderbilt University
>
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2009-09-04 Thread Frank E Harrell Jr

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 CovACovBCovCCovDCovE
2   1   0   1   1   0   -0.0055752802
2   1   0   1   0   1   -0.0019595802
3   0   0   0   1   0   -0.0047258802
0   0   0   1   0   0   -0.0055048502
2   1   1   0   0   0   -0.0038801701
2   1   0   0   1   0   -0.0060742302
2   1   0   0   1 1 -0.0039639202
2   1   0   0   1   00.0006582302
2   1   0   1   0   1   -0.0020336102
0   0   0   0   0   1   -0.0077617702
0   0   0   0   1   1   -0.0009517842

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)


Please read the documentation.  Use data=.  Don't use $ in variables in 
the model.  I don't know what na.pass is.  lrm does not allow NAs to be 
used in the attempted model fit.


Frank

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?

Thanks,
Mike
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2009-09-04 Thread David Winsemius
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 CovACovBCovCCovDCovE
2   1   0   1   1   0   -0.0055752802
2   1   0   1   0   1   -0.0019595802
3   0   0   0   1   0   -0.0047258802
0   0   0   1   0   0   -0.0055048502
2   1   1   0   0   0   -0.0038801701
2   1   0   0   1   0   -0.0060742302
2   1   0   0   1 1 -0.0039639202
2   1   0   0   1   00.0006582302
2   1   0   1   0   1   -0.0020336102
0   0   0   0   0   1   -0.0077617702
0   0   0   0   1   1   -0.0009517842

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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2009-09-04 Thread Ping-Hsun Hsieh
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 CovACovBCovCCovDCovE
2   1   0   1   1   0   -0.0055752802
2   1   0   1   0   1   -0.0019595802
3   0   0   0   1   0   -0.0047258802
0   0   0   1   0   0   -0.0055048502
2   1   1   0   0   0   -0.0038801701
2   1   0   0   1   0   -0.0060742302
2   1   0   0   1 1 -0.0039639202
2   1   0   0   1   00.0006582302
2   1   0   1   0   1   -0.0020336102
0   0   0   0   0   1   -0.0077617702
0   0   0   0   1   1   -0.0009517842

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?

Thanks,
Mike
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.