r - 无法绘制 rlm 对象。非 NA 剩余长度与拟合中使用的情况不匹配

标签 r plot regression

我正在尝试绘制 rlm - 对象,但出现以下错误

Error in lm.influence(x, do.coef = FALSE) : 
    non-NA residual length does not match cases used in fitting

我在互联网上搜索了此错误,但没有找到任何内容,而且我不明白它的含义以及为什么会出现。

rlm 回归中使用的日期由 1 个因变量和 4 个解释变量组成。没有观察结果为 NANULL

结果对象model$df.residual等于NA。这是整个结果对象中唯一的NA

有人可以解释一下如何避免 df.residual 等于 NA 吗?

最佳答案

这实际上是在 the docs 中:

Note that the df.residual component is deliberately set to NA to avoid inappropriate estimation of the residual scale from the residual mean square by "lm" methods

还有来自MASS作者的引用

df.residual is not a relevant concept [for rlm], and the coefficients are not t-distributed

关于r - 无法绘制 rlm 对象。非 NA 剩余长度与拟合中使用的情况不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33299621/

相关文章:

r - 如何绘制滞后时间序列?

matlab - 在 Matlab 上的两个地理空间点之间的线上绘制箭头

python - 绘制 error_only size-1 数组可以转换为 Python 标量

r stargazer - 将线添加到回归输出并定制它们的顺序

r - R中的更新功能不更新模型

r - do.call 构建并执行 data.table 命令

r - r中唯一时间(无日期)的序列

R 引用数据框中的其他行

plot - Plots.jl 中的 "line"和 "path"系列类型有什么区别?

r - 获取 'best' lambda 处的 glmnet 系数