fm <- glm(Prop ~ dose + I(dose^2) + log(dose) + I(log(dose)^2),
data = Beetle, family = binomial, na.action = na.fail)
ma <- model.avg(dredge(fm))
# default coefficient plot:
plot(ma, full = NA, intercept = FALSE)
# Add colours per coefficient type
# Replicate each colour n(=number of coefficients) times
clr <- c("black", "red2")
i <- rep(1:2, each = length(coef(ma)) - 1)
plot(ma, full = NA, intercept = FALSE,
pch = 22, dotcex = 1.5,
col = clr[i], bg = clr[i],
lwd = 6, lend = 1, width = 0, horizontal = 0)
# Use `type = "n"` and `add` argument to e.g. add grid beneath the figure
plot(ma, full = NA, intercept = FALSE,
width = 0, horizontal = FALSE, zerolty = NA, type = "n")
grid()
plot(ma, full = NA, intercept = FALSE,
pch = 22, dotcex = 1.5,
col = clr[i], bg = clr[i],
lwd = 6, lend = 1, width = 0, horizontal = FALSE, add = TRUE)
Run the code above in your browser using DataLab