[R] singular information matrix in lrm.fit

Gad Abraham gabraham at csse.unimelb.edu.au
Mon Oct 13 00:38:58 CEST 2008


Prof Brian Ripley wrote:
> I believe lrm has a criterion appropriate to single-precision 
> calculations (as S-PLUS used to use).  Try reducing 'tol' from its 
> default of 1e-7.
> 
> But your design matrix *is* near singular
> 
>> kappa(cbind(1,x))
> [1] 557390.5
> 
> so try centring/scaling your variables.

Thanks, centering and scaling did the trick (after increasing maxit):

 > lrm(y ~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 + X10, 
data=data.frame(scale(x)), maxit=50)

Logistic Regression Model

lrm(formula = y ~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 +
     X10, data = data.frame(scale(x)), maxit = 50)


Frequencies of Responses
  0  1
14 14

        Obs  Max Deriv Model L.R.       d.f.          P          C 
   Dxy
         28      5e-04      38.81         10          0          1 
     1
      Gamma      Tau-a         R2      Brier
          1      0.519          1          0

           Coef    S.E.   Wald Z P
Intercept   42.48 125.56  0.34  0.7351
X1         147.43 379.96  0.39  0.6980
X2          43.93 119.86  0.37  0.7140
X3         -24.21 102.98 -0.24  0.8141
X4         -34.26 111.18 -0.31  0.7580
X5         -14.16  44.01 -0.32  0.7476
X6         102.23 315.00  0.32  0.7455
X7          32.31  88.59  0.36  0.7153
X8        -123.62 322.01 -0.38  0.7011
X9         174.07 464.86  0.37  0.7081
X10        -36.59  99.23 -0.37  0.7123


-- 
Gad Abraham
Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia
email: gabraham at csse.unimelb.edu.au
web: http://www.csse.unimelb.edu.au/~gabraham



More information about the R-help mailing list