用于稳健回归的 sjPlot?
sjPlot for robust regression?
有人知道 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)
对于类型="cond",置信区间有效
我觉得不可能。 sjp.int(type="eff")
使用 effects::allEffects()
计算 CI 等。但是这个函数不计算 rlm.model
的 CI (returns NAs
),所以 sjp.int(rlm.model, type="eff", show.ci=TRUE)
不起作用。 (参考代码;summary(effects::allEffects(fname, KR=F))
)。
[编辑]
(sjp.int(fname, type="eff"))
returns data.list
并且它有关于 se
的信息。但我认为这个价值不可信。如果你想画像sjp.int
这样的图,我觉得你用predict(rlm.model)
会更好,因为predict
有一种处理rlm.model
.[=25=的方法]
我的例子;
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)
有人知道 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)
对于类型="cond",置信区间有效
我觉得不可能。 sjp.int(type="eff")
使用 effects::allEffects()
计算 CI 等。但是这个函数不计算 rlm.model
的 CI (returns NAs
),所以 sjp.int(rlm.model, type="eff", show.ci=TRUE)
不起作用。 (参考代码;summary(effects::allEffects(fname, KR=F))
)。
(sjp.int(fname, type="eff"))
returns data.list
并且它有关于 se
的信息。但我认为这个价值不可信。如果你想画像sjp.int
这样的图,我觉得你用predict(rlm.model)
会更好,因为predict
有一种处理rlm.model
.[=25=的方法]
我的例子;
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)