0

I am trying to create an ordinal logistic regression model with three outcome levels "None", "Backup" and "Primary." The model fits correctly however when I try to run a summary I am getting the error "Error in svd(X) : infinite or missing values in 'x'"

Below is what my data looks like:

glimpse(training_data)

  Observations: 19,132
  Variables: 11
  $ pickupcity       <chr> "AMSTERDAM", "BELLEVILLE", "WINSTON SALEM", 
  "BOWLING GREEN", "CERRITOS", "NEW...
  $ pickupstate      <chr> "NY", "IL", "NC", "KY", "CA", "NJ", "WI", "MN", 
  "OH", "TX", "GA", "CO", "GA",...
  $ dropcity         <chr> "BINGHAMTON", "JONESBORO", "CHARLOTTE", 
  "PULASKI", "BAKERSFIELD", "YORK", "AR...
  $ dropstate        <chr> "NY", "AR", "NC", "TN", "CA", "PA", "TX", "WI", 
  "OH", "TX", "TN", "UT", "WI",...
  $ equipment        <chr> "Van", "Van", "Van", "Van", "Van", "Van", 
  "Van", "Van", "Van", "Van", "Van", ...
  $ allinrate        <dbl> 902.82, 1155.33, 0.00, 928.10, 803.41, 952.60, 
  2891.33, 0.00, 625.82, 663.26,...
  $ awardstatus      <ord> None, None, None, None, None, None, None, None, 
  None, None, None, None, None,...
  $ loadsavailable   <dbl> 681, 589, 517, 370, 313, 223, 211, 197, 185, 
  159, 150, 135, 123, 121, 115, 10...
  $ loadsawarded     <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
  $ miles            <int> 127, 242, 97, 138, 137, 169, 1014, 322, 42, 
  144, 351, 516, 809, 946, 438, 574...
  $ customerindustry <chr> "Beverages", "Beverages", "Beverages", 
  "Beverages", "Beverages", "Beverages",...

I'm fitting my model by running this code:

awardmodel_olr <- polr(awardstatus ~ pickupstate + dropstate + equipment + 
allinrate + miles, data = training_data, Hess = TRUE)
Warning message:
glm.fit: fitted probabilities numerically 0 or 1 occurred

I then try to run summary on the model I am getting this error:

summary(awardmodel_olr)
Error in svd(X) : infinite or missing values in 'x'

I'm not sure how to correct this but I would like to use the summary information in order to be able to calculate P-values but am currently unable to.

1 Answers1

0

Please provide MRE, see dput().

My best guess is that you can use https://stackoverflow.com/a/21424647/7199966

Bruno
  • 4,109
  • 1
  • 9
  • 27
  • my numeric columns in the testing data don't have all zeros and I an unable to scale the character columns – Brian Mochtyak Apr 16 '19 at 15:12
  • Try to use dput() if you can give us a subset of your data where this problem exists and your code we can try to solve it. – Bruno Apr 16 '19 at 16:11