# package 'rms' - singular information matrix encountered

I am trying to fit a binary logistic regression model using only one predictor. After consulting a loess plot I decided to use restricted cubic spline to fit the curve (with default 4 knots). Using 'rms' package:

lrm(y ~ rcs(x), data = data)


however I encounter the following problem:

singular information matrix in lrm.fit (rank= 3 ).  Offending variable(s):
x''' x''
Error in lrm(y ~ rcs(x), data = data) :
Unable to fit model using “lrm.fit”


Why am I getting this issue? and how do I solve it?

(N=61829), Min=-29000, 1st Qu.=0 , Median.=300 , Mean=7260 , 3rd Qu.=6190 , Max.=240000

• Show us a high-resolution histogram of the distribution of x (e.g., 100 or 200 bins). – Frank Harrell Feb 9 '18 at 13:17
• It's the clumping at zero that creates the problem: hard to figure out which knots to use. Override default knots with constants you select, or use a regular polynomial, e.g. pol(x, 2). Or with your extreme skewness, pol(sqrt(x), 2). Also use sqrt(x) inside rcs, or cube root. – Frank Harrell Feb 9 '18 at 13:58
• do you need the loes plot also? @FrankHarrell – Danny Feb 9 '18 at 13:58
• The relationship is exactly what I expect: maxium at about 0(a bit less than 0) , a rise at 10000 then decay . – Danny Feb 9 '18 at 14:12
• any suggestions where to put the knots. – Danny Feb 9 '18 at 14:58