sjPlot_tab_model: Print regression models as HTML table

View source: R/sjPlot.R

sjPlot_tab_modelR Documentation

Print regression models as HTML table

Description

tab_model() creates HTML tables from regression models.

Usage

sjPlot_tab_model(
  ...,
  show.omnibus.f = FALSE,
  show.auc = FALSE,
  show.hosmer_lemeshow = FALSE,
  show.deviance_test = FALSE,
  footnote = NULL,
  digits = 2,
  digits.p = 3,
  digits.rsq = 3,
  file = NULL,
  use.viewer = TRUE,
  print = TRUE
)

Arguments

...

arguments passed on to tab_model; notably one or more regression models to summarize

show.omnibus.f

Logical, if TRUE, the omnibus F-test is computed and printed

show.auc

Logical, if TRUE, the AUC is calculated and printed

show.hosmer_lemeshow

Logical, if TRUE, a Hosmer-Lemeshow goodness of fit test is calculated and printed

show.deviance_test

Logical, if TRUE, a deviance-test comparing to the null model is calculated and printed

footnote

optional footnote for table

digits

Amount of decimals for estimates

digits.p

Amount of decimals for p-values

digits.rsq

Amount of decimals for r-squared values

file

Destination file, if the output should be saved as file. If NULL (default), the output will be saved as temporary file and opened either in the IDE's viewer pane or the default web browser.

use.viewer

Logical, if TRUE, the HTML table is shown in the IDE's viewer pane. If FALSE or no viewer available, the HTML table is opened in a web browser.

print

Logical, if TRUE in non-interactive mode, the html table code is inserted into the document

Details

Standardized Estimates

Default standardization is done by completely refitting the model on the standardized data. Hence, this approach is equal to standardizing the variables before fitting the model, which is particularly recommended for complex models that include interactions or transformations (e.g., polynomial or spline terms). When show.std = "std2", standardization of estimates follows Gelman's (2008) suggestion, rescaling the estimates by dividing them by two standard deviations instead of just one. Resulting coefficients are then directly comparable for untransformed binary predictors. For backward compatibility reasons, show.std also may be a logical value; if TRUE, normal standardized estimates are printed (same effect as show.std = "std"). Use show.std = NULL (default) or show.std = FALSE, if no standardization is required.

How do I use CSS-argument?

With the CSS-argument, the visual appearance of the tables can be modified. To get an overview of all style-sheet-classnames that are used in this function, see return value page.style for details. Arguments for this list have following syntax:

  1. the class-names with "css."-prefix as argument name and

  2. each style-definition must end with a semicolon

You can add style information to the default styles by using a + (plus-sign) as initial character for the argument attributes. Examples:

  • css.table = 'border:2px solid red;' for a solid 2-pixel table border in red.

  • css.summary = 'font-weight:bold;' for a bold fontweight in the summary row.

  • css.lasttablerow = 'border-bottom: 1px dotted blue;' for a blue dotted border of the last table row.

  • css.colnames = '+color:green' to add green color formatting to column names.

  • css.arc = 'color:blue;' for a blue text color each 2nd row.

  • css.caption = '+color:red;' to add red font-color to the default table caption style.

Value

Invisibly returns

  • the web page style sheet (page.style),

  • the web page content (page.content),

  • the complete html-output (page.complete) and

  • the html-table with inline-css for use with knitr (knitr)

for further use.

Note

The HTML tables can either be saved as file and manually opened (use argument file) or they can be saved as temporary files and will be displayed in the RStudio Viewer pane (if working with RStudio) or opened with the default web browser. Displaying resp. opening a temporary file is the default behaviour (i.e. file = NULL).

Examples are shown in these three vignettes: Summary of Regression Models as HTML Table, Summary of Mixed Models as HTML Table and Summary of Bayesian Models as HTML Table.

References

Hosmer, David W.; Lemeshow, Stanley (2013). Applied Logistic Regression. New York: Wiley.


the-mad-statter/washu documentation built on May 5, 2024, 10:26 a.m.