我正在使用polr函数进行有序回归。没有包含交互的结果出来很好,但只要我添加交互,我就会得到'In sqrt(diag(vc)):生产的NaN。输入和输出为:
m1 <- polr(Knowledge.ordinal.ranking ~ Years.fishing*Age + Attitude,
data = data, Hess=TRUE)
Call:
polr(formula = Knowledge.ordinal.ranking ~ Years.fishing * Age +
Attitude, data = data, Hess = TRUE)
Coefficients:
Value Std. Error t value
Years.fishing 0.052128 NaN NaN
Age 0.022808 NaN NaN
Attitude 0.160647 0.4904 0.3276
Years.fishing:Age -0.001141 NaN NaN
Intercepts:
Value Std. Error t value
Low|Average -0.9393 NaN NaN
Average|Good 1.3745 NaN NaN
Good|Excellent 2.9114 NaN NaN
Residual Deviance: 303.3596
AIC: 317.3596
有谁能告诉我怎么解决这个问题吗?
我不知道如何添加数据,但年龄(18 - 80)和Years.fishing(8 - 60)是连续的和相关的,态度是一个二元的,其中积极= 1和消极= 0。知识。序数。排名是一个四部分规模-低,平均,好,优秀。
1条答案
按热度按时间suzh9iv81#
我不知道,如果你还在寻找一个解决方案,但我经历了同样的问题。在我的例子中,交互作用项中变量的缩放有所帮助,如下所述:https://stats-stackexchange-com.translate.goog/questions/500396/ordinal-logistic-regression-how-to-handle-nans?_x_tr_sl=en&_x_tr_tl=de&_x_tr_hl=de&_x_tr_pto=sc