How can I add stars to broom package's tidy() function output?
问题 I have been using the broom package's tidy() function in R to print my model summaries. However, the tidy() function returns p-values without stars, which makes it a bit weird for many people who are used to seeing stars in model summaries. Does anyone know a way to add stars to the output? 回答1: We can use a convenient function stars.pval from gtools to do this library(gtools) library(broom) library(dplyr) data(mtcars) mtcars %>% lm(mpg ~ wt + qsec, .) %>% tidy %>% mutate(signif = stars.pval