Plot with the regression coefficients' point estimates as dots with confidence interval whiskers and other statistical details included as labels.
ggcoefstats( x, output = "plot", statistic = NULL, conf.int = TRUE, conf.level = 0.95, k = 2L, exclude.intercept = FALSE, effsize = "eta", meta.analytic.effect = FALSE, meta.type = "parametric", bf.message = TRUE, sort = "none", xlab = "regression coefficient", ylab = "term", title = NULL, subtitle = NULL, caption = NULL, only.significant = FALSE, point.args = list(size = 3, color = "blue"), errorbar.args = list(height = 0), vline = TRUE, vline.args = list(size = 1, linetype = "dashed"), stats.labels = TRUE, stats.label.color = NULL, stats.label.args = list(size = 3, direction = "y"), package = "RColorBrewer", palette = "Dark2", ggtheme = ggplot2::theme_bw(), ggstatsplot.layer = TRUE, ... )
x  A model object to be tidied, or a tidy data frame containing results
from a regression model. Function internally uses


output  Character describing the expected output from this function:

statistic  Which statistic is to be displayed (either 
conf.int  Logical. Decides whether to display confidence intervals as
error bars (Default: 
conf.level  Numeric deciding level of confidence or credible intervals
(Default: 
k  Number of digits after decimal point (should be an integer)
(Default: 
exclude.intercept  Logical that decides whether the intercept should be
excluded from the plot (Default: 
effsize  Character describing the effect size to be displayed: 
meta.analytic.effect  Logical that decides whether subtitle for
metaanalysis via linear (mixedeffects) models (default: 
meta.type  Type of statistics used to carry out randomeffects
metaanalysis. If 
bf.message  Logical that decides whether results from running a
Bayesian metaanalysis assuming that the effect size d varies across
studies with standard deviation t (i.e., a randomeffects analysis)
should be displayed in caption. Defaults to 
sort  If 
xlab, ylab  Labels for 
title  The text for the plot title. 
subtitle  The text for the plot subtitle. The input to this argument
will be ignored if 
caption  The text for the plot caption. 
only.significant  If 
point.args  Additional arguments that will be passed to

errorbar.args  Additional arguments that will be passed to

vline  Decides whether to display a vertical line (Default: 
vline.args  Additional arguments that will be passed to

stats.labels  Logical. Decides whether the statistic and pvalues for
each coefficient are to be attached to each dot as a text label using

stats.label.color  Color for the labels. If set to 
stats.label.args  Additional arguments that will be passed to

package  Name of the package from which the given palette is to
be extracted. The available palettes and packages can be checked by running

palette  Name of the package from which the given palette is to
be extracted. The available palettes and packages can be checked by running

ggtheme  A function, 
ggstatsplot.layer  Logical that decides whether 
...  Additional arguments to tidying method. For more, see

Important: In case you want to carry out metaanalysis using this
function, it assumes that you have already downloaded the needed package
(metafor
, metaplus
, or metaBMA
) for metaanalysis.
All rows of regression estimates where either of the following
quantities is NA
will be removed if labels are requested: estimate
,
statistic
, p.value
.
Given the rapid pace at which new methods are added to these packages, it
is recommended that you install the GitHub versions of parameters
and
performance
in order to make most of this function.
https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html
# \donttest{ # for reproducibility set.seed(123) library(ggstatsplot) # model object mod < lm(formula = mpg ~ cyl * am, data = mtcars) # to get a plot ggcoefstats(x = mod, output = "plot")# to get a tidy dataframe ggcoefstats(x = mod, output = "tidy")#> # A tibble: 4 x 10 #> term estimate std.error conf.level conf.low conf.high statistic #> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 (Intercept) 30.9 3.19 0.95 24.3 37.4 9.68 #> 2 cyl 1.98 0.449 0.95 2.89 1.06 4.40 #> 3 am 10.2 4.30 0.95 1.36 19.0 2.36 #> 4 cyl:am 1.31 0.707 0.95 2.75 0.143 1.85 #> df.error p.value #> <int> <dbl> #> 1 28 1.95e10 #> 2 28 1.41e 4 #> 3 28 2.53e 2 #> 4 28 7.55e 2 #> # ... with 1 more variable: label <chr># to get a glance summary ggcoefstats(x = mod, output = "glance")#> # A tibble: 1 x 6 #> aic bic r2 r2.adjusted rmse sigma #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 166. 173. 0.785 0.762 2.75 2.94# }