by_trans <- mtcars %>%
group_by(am) %>% # group data by trans
do(tidy(lm(mpg ~ wt + cyl + disp + gear, data = .))) %>% # run model on each grp
rename(model=am) %>% # make model variable
relabel_predictors(c(wt = "Weight", # relabel predictors
cyl = "Cylinders",
disp = "Displacement",
gear = "Gear"))
If we use conf.level=0.999:
dwplot(by_trans, conf.level=0.999,
vline = geom_vline(xintercept = 0, colour = "grey60", linetype = 2)) + # plot line at zero _behind_ coefs
theme_bw() + xlab("Coefficient Estimate") + ylab("") +
ggtitle("Predicting Gas Mileage by Transmission Type") +
theme(plot.title = element_text(face="bold"),
legend.position = c(0.007, 0.01),
legend.justification = c(0, 0),
legend.background = element_rect(colour="grey80"),
legend.title.align = .5) +
scale_colour_grey(start = .3, end = .7,
name = "Transmission",
breaks = c(0, 1),
labels = c("Automatic", "Manual"))
We will have:
Changing conf.level to 0.7 gives me the same output:
Following the example on https://cran.r-project.org/web/packages/dotwhisker/vignettes/dotwhisker-vignette.html. The output image does not change if we alter the
conf.level
in the following example:If we use
conf.level=0.999
:We will have:
Changing
conf.level
to0.7
gives me the same output: