Re: [R] using 'lrm' for logistic regression

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Mon, 03 Mar 2008 07:39:22 -0600

Utkarsh Singhal wrote:
> Hi R,
>
>
>
> I am getting this error while trying to use 'lrm' function with nine
> independent variables:
>
>
>

>> res =

> lrm(y1994~WC08301+WC08376+WC08316+WC08311+WC01001+WC08221+WC08106+WC0810
> 1+WC08231,data=y)
>
>
>
> singular information matrix in lrm.fit (rank= 8 ). Offending
> variable(s):
>
> WC08101 WC08221
>
> Error in j:(j + params[i] - 1) : NA/NaN argument
>
>
>
> Now, if I take choose only four independent variables then there is no
> error.
>
>
>
>> res = lrm(y1994~ WC08221+WC08106+WC08101+WC08231,data=y)

>
>
>
>
>
> But strangely, if I use 'glm', with the family as binomial(logit) and
> with the same dataset, it is working perfectly fine.
>
>
>
>> res =

> glm(y1994~WC08301+WC08376+WC08316+WC08311+WC01001+WC08221+WC08106+WC0810
> 1+WC08231,data=y,family=binomial(logit))
>
>
>
> Any ideas..?
>
>
>
> Regards
>
> Utkarsh

Design's fitting functions are not kind about ignoring parameters associated with singular covariance matrices. In glm you should see a zero for such coefficients. In design you have to delete the singular variables manually. Occasionally you have to tweak the tol argument to lrm.

A new function in Hmisc called redun will run a redundancy analysis to help understand the predictor collinearities.

Frank

>
>
>
> This e-mail may contain confidential and/or privileged i...{{dropped:13}}
>
> ______________________________________________
> R-help_at_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_at_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.
Received on Mon 03 Mar 2008 - 14:05:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 03 Mar 2008 - 14:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive