作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有人知道 sjp.Int 是否适用于稳健回归吗?基本绘图有效,但置信区间不起作用?错误=
Error in seq.default(from = best$lmin, to = best$lmax, by = best$lstep) :
'from' must be of length 1
In addition: Warning messages:
1: In min(intdf$conf.low, na.rm = T) :
no non-missing arguments to min; returning Inf
2: In max(intdf$conf.high, na.rm = T) :
no non-missing arguments to max; returning -Inf
我使用的命令是:
fname = rlm(Y ~ X1+X2+X3+X4*X5, data=mydata)
sjp.int(fname, type="eff", show.ci=TRUE)
对于 type="cond",置信区间起作用
最佳答案
我觉得不可能。 sjp.int(type="eff")
使用effects::allEffects()
来计算CI等。但是这个函数不计算rlm.model
的 CI(返回 NAs
),所以 sjp.int(rlm.model, type="eff", show.ci=TRUE)
不起作用. (引用代码;summary(effects::allEffects(fname, KR=F))
)。
(sjp.int(fname, type="eff"))
返回 data.list
并且它有关于 se
的信息。但我认为这个值(value)不可信。如果你想绘制像 sjp.int
这样的图,我认为你最好使用 predict(rlm.model)
因为 predict
有一种处理 rlm.model
的方法。
我的例子;
library(ggplot2)
df <- with(iris, data.frame(Y = Petal.Length, # example data
X1 = Sepal.Length, X2 = Sepal.Width, X3 = Petal.Width))
fname <- rlm(Y ~ X1 + X2 * X3, df)
pred.df <- with(df, data.frame(X1 = mean(X1),
X2 = c( min(X2), max(X2) ),
X3 = rep( seq( min(X3), max(X3), 0.1), each=2 )))
pred.df <- cbind(pred.df, predict(fname, pred.df, interval="confidence"))
pred.df$X2 <- as.factor(pred.df$X2)
ggplot(pred.df, aes(x=X3, y=fit, group=X2, colour=X2, fill=X2)) + geom_line() +
geom_ribbon(aes(ymin = lwr, ymax = upr, colour=NULL), alpha=0.2)
关于r - 用于稳健回归的 sjPlot?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39060754/
我是一名优秀的程序员,十分优秀!