# NOT RUN {
# set up
set.seed(123)
library(ggstatsplot)
library(gapminder)
# saving results from regression
df_results <- purrr::pmap(
.l = list(
data = list(gapminder::gapminder),
formula = list(scale(lifeExp) ~ scale(gdpPercap)),
grouping.vars = alist(continent),
output = list("tidy", "glance")
),
.f = groupedstats::grouped_lm
) %>%
dplyr::full_join(x = .[[1]], y = .[[2]], by = "continent") %>%
dplyr::filter(.data = ., term != "(Intercept)")
# making subtitle
ggstatsplot::subtitle_meta_ggcoefstats(
data = df_results,
k = 3,
messages = FALSE
)
# getting tidy data frame with coefficients
ggstatsplot::subtitle_meta_ggcoefstats(
data = df_results,
messages = FALSE,
output = "tidy"
)
# }
Run the code above in your browser using DataCamp Workspace