Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot

Plot Regression Coefficients


Description

The plot() function extracts x$table_body and passes the it to GGally::ggcoef_plot() along with a formatting options.

Usage

## S3 method for class 'tbl_regression'
plot(x, remove_header_rows = TRUE, remove_reference_rows = FALSE, ...)

## S3 method for class 'tbl_uvregression'
plot(x, remove_header_rows = TRUE, remove_reference_rows = FALSE, ...)

Arguments

x

'tbl_regression' or 'tbl_uvregression' object

remove_header_rows

logical indicating whether to remove header rows for categorical variables. Default is TRUE

remove_reference_rows

logical indicating whether to remove reference rows for categorical variables. Default is FALSE.

...

arguments passed to GGally::ggcoef_plot(...)

Details

[Experimental]

Value

a ggplot

Examples

if (requireNamespace("GGally")) {
  glm(response ~ marker + grade, trial, family = binomial) %>%
    tbl_regression(
      add_estimate_to_reference_rows = TRUE,
      exponentiate = TRUE
    ) %>%
    plot()
}

gtsummary

Presentation-Ready Data Summary and Analytic Result Tables

v1.4.0
MIT + file LICENSE
Authors
Daniel D. Sjoberg [aut, cre] (<https://orcid.org/0000-0003-0862-2018>), Michael Curry [aut] (<https://orcid.org/0000-0002-0261-4044>), Margie Hannum [aut] (<https://orcid.org/0000-0002-2953-0449>), Joseph Larmarange [aut] (<https://orcid.org/0000-0001-7097-700X>), Karissa Whiting [aut] (<https://orcid.org/0000-0002-4683-1868>), Emily C. Zabor [aut] (<https://orcid.org/0000-0002-1402-4498>), Esther Drill [ctb] (<https://orcid.org/0000-0002-3315-4538>), Jessica Flynn [ctb] (<https://orcid.org/0000-0001-8310-6684>), Jessica Lavery [ctb] (<https://orcid.org/0000-0002-2746-5647>), Stephanie Lobaugh [ctb], Gustavo Zapata Wainberg [ctb] (<https://orcid.org/0000-0002-2524-3637>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.