0

I am trying to run an ordinal regression on a dataset that I removed the missing values from. When I try to get a summary of the model, I find the following error message:

error in svd (x): infinite or missing values in 'x'.

I am very new to rstudio, and not sure how to go about correcting this problem.

complete_model <- polr(hlthstat~  r_incomeall, train, Hess = TRUE)
summary(complete_model)

this is what appears in the console when i run the code:

complete_model <- polr(hlthstat~ r_incomeall, train, Hess = TRUE) Warning message: glm.fit: fitted probabilities numerically 0 or 1 occurred summary(complete_model) Error in svd(X) : infinite or missing values in 'x'

jpsmith
  • 11,023
  • 5
  • 15
  • 36
  • 1
    Welcome to SO! Could you please post an example of your data structure using something like `dput(train)`? – jpsmith Jan 04 '23 at 22:48
  • It will be impossible to answer the question definitively for anyone here without access to the same dataset that you're using, but the error message would indicate that there's something problematic with your dataset, i.e. that it leads to a call to `svd` with "infinite or missing values". My guess would be that you have a feature that is constant or some other multicollinearity problem. – crf Jan 04 '23 at 22:48
  • Apologies for the lack of information. I'm very new to this, and very confused. I appreciate any and all help and responses! I think the problem may be that my independent variable has several '0' values. When I tried running the model summary with a different independent variable (with no '0' values), it worked. Could that be the source of the error message? If so, how might I fix this? thank-you again!! – Chelsea M Jan 04 '23 at 23:00
  • Welcome to SO, the best way for us to help you is for you to provide your data and code so we can recreate your error message. Like jpsmith commented, can you provide the output from `dput(train)` so your post is [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? – jrcalabrese Jan 05 '23 at 02:42

0 Answers0