如何修正我的模型以获取摘要统计信息?

时间:2019-04-16 14:09:32

标签: r error-handling logistic-regression ordinal

我正在尝试创建具有三个结果级别“无”,“备份”和“主要”的序数逻辑回归模型。该模型正确拟合,但是当我尝试运行摘要时,出现错误“ svd(X)中的错误:'x'中的值无穷或缺失”

以下是我的数据:

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",...

我通过运行以下代码来拟合模型:

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

然后我尝试在出现此错误的模型上运行摘要:

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

我不确定如何更正此问题,但我想使用摘要信息来计算P值,但目前无法。

1 个答案:

答案 0 :(得分:0)

请提供MRE,请参见dput()。

我最好的猜测是您可以使用https://stackoverflow.com/a/21424647/7199966