[R] lrm in Design

2009-08-29 Thread loch1

Hello everybody,
I am trying to do a logistic regression model with lrm() from the design
package. I am comparing to groups with different medical outcome which can
either be "good" or "bad". In the help file it says that lrm codes al
responses to 0,1,2,3, etc. internally and does so in alphabetical order. I
would guess this means bad=0 and good=1.

My question: I am trying to figure out the connection between my factors and
my response. Which probability is being calculated that of good or bad (1 or
0, respectively).

I'm not sure whether I made clear what I was trying to say but will be very
grateful for all help.
-- 
View this message in context: 
http://www.nabble.com/lrm-in-Design-tp25206737p25206737.html
Sent from the R help mailing list archive at Nabble.com.

__
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

2009-08-29 Thread Gabor Grothendieck
See:
https://stat.ethz.ch/pipermail/r-help/2009-July/204192.html

and also other posts in that thread.

On Sat, Aug 29, 2009 at 6:02 PM, loch1 wrote:
>
> Hello everybody,
> I am trying to do a logistic regression model with lrm() from the design
> package. I am comparing to groups with different medical outcome which can
> either be "good" or "bad". In the help file it says that lrm codes al
> responses to 0,1,2,3, etc. internally and does so in alphabetical order. I
> would guess this means bad=0 and good=1.
>
> My question: I am trying to figure out the connection between my factors and
> my response. Which probability is being calculated that of good or bad (1 or
> 0, respectively).
>
> I'm not sure whether I made clear what I was trying to say but will be very
> grateful for all help.
> --
> View this message in context: 
> http://www.nabble.com/lrm-in-Design-tp25206737p25206737.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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

2009-08-30 Thread loch1

Thank you for your reply, it helped. That thread is about glm, I take it that
lrm behaves in the same way?!?



See:
https://stat.ethz.ch/pipermail/r-help/2009-July/204192.html

and also other posts in that thread.

-- 
View this message in context: 
http://www.nabble.com/lrm-in-Design-tp25206737p25209958.html
Sent from the R help mailing list archive at Nabble.com.

__
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

2009-08-30 Thread Gabor Grothendieck
Presumably the same idea would apply to lrm if
appropriately adapted.

On Sun, Aug 30, 2009 at 5:19 AM, loch1 wrote:
>
> Thank you for your reply, it helped. That thread is about glm, I take it that
> lrm behaves in the same way?!?
>
>
>
> See:
> https://stat.ethz.ch/pipermail/r-help/2009-July/204192.html
>
> and also other posts in that thread.
>
> --
> View this message in context: 
> http://www.nabble.com/lrm-in-Design-tp25206737p25209958.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.


[R] lrm in Design package, missing value problem

2009-08-23 Thread James Fearon

__
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 problem

2009-08-23 Thread James Fearon

Hi,

This concerns lrm in the Design package, which I need for the clustered 
errors option with panel data.


I have created a variable (using sign()) that has values -1, 0, and 1 
(and some NAs).  call this variable x3.  lrm does not like


t = lrm(y ~ x1 + x2 + I(x3==-1) + I(x3==1), data=data,x=T,y=T)

I get the error message:  Error in if (!length(fname) || !any(fname == 
zname)) { :

 missing value where TRUE/FALSE needed

Running this on the subset of data with non missing x3 values doesn't help.

glm has no problem with this.

Thanks very much,

Jim Fearon

__
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 problem

2009-08-23 Thread Frank E Harrell Jr

James Fearon wrote:

Hi,

This concerns lrm in the Design package, which I need for the clustered 
errors option with panel data.


I have created a variable (using sign()) that has values -1, 0, and 1 
(and some NAs).  call this variable x3.  lrm does not like


t = lrm(y ~ x1 + x2 + I(x3==-1) + I(x3==1), data=data,x=T,y=T)

I get the error message:  Error in if (!length(fname) || !any(fname == 
zname)) { :

 missing value where TRUE/FALSE needed

Running this on the subset of data with non missing x3 values doesn't help.

glm has no problem with this.

Thanks very much,

Jim Fearon


Right, Design does not like variables to be split up.  Make x3 a factor 
and use it just as the single term x3 in the model.


Frank

--
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.


[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.


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.


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 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.