有没有办法直接从 MuMIn model.avg() 为具有置信带的不同变量绘制模型平均汇总输出。以前我一直在使用 ggplot 和 ggpredict 从实际模型中绘制项,但我一直无法找到一种方法来绘制平均模型的结果。
显然,我可以手动绘制斜率和截距,但是获得准确的置信带并从 confint() 绘制并不理想,而且我还没有从看起来正确的区间中获得置信带。
library(MuMIn)
#Dummy Data
a <- seq(1:5)
set.seed(1)
b <- sample(1:100,5)
c <- sample(1:100,5)
d <-sample(1:100,5)
df <- data.frame(a,b,c,d)
Dredged <- dredge(lm(a ~ b + c + d, data=df), rank=AIC)
ModelAvg <- model.avg(Dredged, subset=delta<=2)
CI <- confint(ModelAvg, full=T) # get confidence intervals
summary(ModelAvg)
#I want to be able to create a graph for each term from the averaged output with its estimate, SE, and Confidence bands
#Output - I've only left the relevant part of the output, my actual data ends up with 5 component models
#Call:
#model.avg(object = Dredged, subset = delta <= 2)
#Component models:
# df logLik AIC delta weight
#12 4 -1.32 10.63 0.00 0.69
#123 5 -1.10 12.21 1.58 0.31
#Model-averaged coefficients:
#(full average)
# Estimate Std. Error Adjusted SE z value Pr(>|z|)
#(Intercept) 4.933497 1.308953 7.725454 0.639 0.523
#b 0.021946 0.010320 0.048539 0.452 0.651
#c -0.044848 0.012076 0.067954 0.660 0.509
#d -0.002275 0.014081 0.088694 0.026 0.980