我正在尝试创建具有三个结果级别“无”,“备份”和“主要”的序数逻辑回归模型。该模型正确拟合,但是当我尝试运行摘要时,出现错误“ 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值,但目前无法。