R/ggcoefstats.R
ggcoefstats.Rd
Model coefficients for fitted models with the model summary as a caption.
ggcoefstats(x, output = "plot", statistic = NULL, scales = NULL, conf.method = "Wald", p.kr = TRUE, coefficient.type = "beta", effsize = "eta", partial = TRUE, nboot = 500, meta.analysis.subtitle = FALSE, point.color = "blue", point.size = 3, point.shape = 16, conf.int = TRUE, conf.level = 0.95, se.type = "nid", k = 2, k.caption.summary = 0, exclude.intercept = TRUE, exponentiate = FALSE, errorbar.color = "black", errorbar.height = 0, errorbar.linetype = "solid", errorbar.size = 0.5, vline = TRUE, vline.color = "black", vline.linetype = "dashed", vline.size = 1, sort = "none", xlab = "regression coefficient", ylab = "term", title = NULL, subtitle = NULL, stats.labels = TRUE, caption.summary = TRUE, stats.label.size = 3, stats.label.fontface = "bold", stats.label.color = NULL, label.r = 0.15, label.size = 0.25, label.box.padding = 1, label.label.padding = 0.25, label.point.padding = 0.5, label.segment.color = "grey50", label.segment.size = 0.5, label.segment.alpha = NULL, label.min.segment.length = 0.5, label.force = 1, label.max.iter = 2000, label.nudge.x = 0, label.nudge.y = 0, label.xlim = c(NA, NA), label.ylim = c(NA, NA), label.direction = "y", package = "RColorBrewer", palette = "Dark2", direction = 1, ggtheme = ggplot2::theme_bw(), ggstatsplot.layer = TRUE, messages = FALSE, ...)
x  A model object to be tidied with 

output  Character describing the expected output from this function:

statistic  Which statistic is to be displayed (either 
scales  scales on which to report the variables: for random effects, the choices are ‘"sdcor"’ (standard deviations and correlations: the default if 
conf.method  Character describing method for computing confidence
intervals (for more, see 
p.kr  Logical, if 
coefficient.type  Relevant only for ordinal regression models ( 
effsize  Character describing the effect size to be displayed: 
partial  Logical that decides if partial etasquared or omegasquared
are returned (Default: 
nboot  Number of bootstrap samples for confidence intervals for partial
etasquared and omegasquared (Default: 
meta.analysis.subtitle  Logical that decides whether subtitle for
metaanalysis via linear (mixedeffects) models  as implemented in the

point.color  Character describing color for the point (Default:

point.size  Numeric specifying size for the point (Default: 
point.shape  Numeric specifying shape to draw the points (Default: 
conf.int  Logical. Decides whether to display confidence intervals as
error bars (Default: 
conf.level  Numeric deciding level of confidence intervals (Default:

se.type  Character specifying the method used to compute standard
standard errors for quantile regression (Default: 
k  Number of decimal places expected for results displayed in labels
(Default : 
k.caption.summary  Number of decimal places expected for results
displayed in captions (Default : 
exclude.intercept  Logical that decides whether the intercept should be
excluded from the plot (Default: 
exponentiate  If 
errorbar.color  Character deciding color of the error bars (Default:

errorbar.height  Numeric specifying the height of the error bars
(Default: 
errorbar.linetype  Line type of the error bars (Default: 
errorbar.size  Numeric specifying the size of the error bars (Default:

vline  Decides whether to display a vertical line (Default: 
vline.color  Character specifying color of the vertical line (Default:

vline.linetype  Character specifying line type of the vertical line
(Default: 
vline.size  Numeric specifying the size of the vertical line (Default:

sort  If 
xlab  Label for 
ylab  Label for 
title  The text for the plot title. 
subtitle  The text for the plot subtitle. The input to this argument
will be ignored if 
stats.labels  Logical. Decides whether the statistic and pvalues for
each coefficient are to be attached to each dot as a text label using

caption.summary  Logical. Decides whether the model summary should be
displayed as a cation to the plot (Default: 
stats.label.size, stats.label.fontface, stats.label.color  Aesthetics for
the labels. Defaults: 
label.r,  Radius of rounded corners, as unit or number. Defaults to

label.size  Size of label border, in mm. Defaults to 
label.box.padding  Amount of padding around bounding box, as number.
Defaults to 
label.label.padding  Amount of padding around label, as number.
Defaults to 
label.point.padding  Amount of padding around labeled point, as
number. Defaults to 
label.segment.color  Color of the line segment (Default: 
label.segment.size  Width of line segment connecting the data point to
the text label, in mm. Defaults to 
label.segment.alpha  Transparency of the line segment. Defaults to the same transparency as the text. 
label.min.segment.length  Skip drawing segments shorter than this.
Defaults to 
label.force  Force of repulsion between overlapping text labels.
Defaults to 
label.max.iter  Maximum number of iterations to try to resolve
overlaps. Defaults to 
label.nudge.x, label.nudge.y  Horizontal and vertical adjustments to
nudge the starting position of each text label. Defaults to 
label.xlim, label.ylim  Limits for the x and y axes. Text labels will be
constrained to these limits. By default, text labels are constrained to the
entire plot area. Defaults to 
label.direction  Character ( 
package  Name of package from which the palette is desired as string or symbol. 
palette  Name of palette as string or symbol. 
direction  Either 
ggtheme  A function, 
ggstatsplot.layer  Logical that decides whether 
messages  Decides whether messages references, notes, and warnings are
to be displayed (Default: 
...  Additional arguments to tidying method. 
Plot with the regression coefficients' point estimates as dots with confidence interval whiskers.
https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html
# for reproducibility set.seed(123) # with model object ggcoefstats(x = lm(formula = mpg ~ cyl * am, data = mtcars))# with custom dataframe # creating a dataframe df < structure( list( term = structure( c(3L, 4L, 1L, 2L, 5L), .Label = c( "Africa", "Americas", "Asia", "Europe", "Oceania" ), class = "factor" ), estimate = c( 0.382047603321706, 0.780783111514665, 0.425607573765058, 0.558365541235078, 0.956473848429961 ), std.error = c( 0.0465576338644502, 0.0330218199731529, 0.0362834986178494, 0.0480571500648261, 0.062215818388157 ), statistic = c( 8.20590677855356, 23.6444603038067, 11.7300588415607, 11.6187818146078, 15.3734833553524 ), conf.low = c( 0.290515146096969, 0.715841986960399, 0.354354575031406, 0.46379116008131, 0.827446138277154 ), conf.high = c( 0.473580060546444, 0.845724236068931, 0.496860572498711, 0.652939922388847, 1.08550155858277 ), p.value = c( 3.28679518728519e15, 4.04778497135963e75, 7.59757330804449e29, 5.45155840151592e26, 2.99171217913312e13 ), df.residual = c( 394L, 358L, 622L, 298L, 22L ) ), row.names = c(NA, 5L), class = c( "tbl_df", "tbl", "data.frame" ) ) # plotting the dataframe ggstatsplot::ggcoefstats( x = df, statistic = "t", meta.analysis.subtitle = TRUE )#> Note: No model diagnostics information available for the object of class tbl_df . #>#>