gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 08:45:30 25 4
gpt4 key购买 nike

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

最佳答案

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

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

关于r - 如何修正我的模型以获取摘要统计信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55710210/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com