
Create a tidy version of the glm object as a rich-formatted table
Source:R/tabularise.glm.R
tabularise_tidy.glm.Rd
Turn the tidy of glm object into a rich-formatted table with {flextable}. The table can be printed in different formats (HTML, LaTeX, Word, PowerPoint), or rearranged later on.
Usage
# S3 method for glm
tabularise_tidy(
data,
header = TRUE,
title = NULL,
equation = header,
auto.labs = TRUE,
origdata = NULL,
labs = NULL,
conf.int = FALSE,
conf.level = 0.95,
lang = getOption("data.io_lang", "en"),
show.signif.stars = getOption("show.signif.stars", TRUE),
...,
kind = "ft",
env = parent.frame()
)
Arguments
- data
A glm object
- header
If
TRUE
(by default), add a header to the table- title
If
TRUE
, add a title to the table header. Default to the same value than header, except outside of a chunk where it isFALSE
if a table caption is detected (tbl-cap
YAML entry).- equation
If
TRUE
(by default), add an equation to the table header. The equation can also be passed in the form of a character string (LaTeX).- auto.labs
If
TRUE
(by default), use labels (and units) automatically fromorigdata=
. `- origdata
The original data set this model was fitted to. By default it is
NULL
and variables labels from this data set are not used.- labs
Labels to change the names of elements in the
term
column of the table. By default it isNULL
and nothing is changed.- conf.int
If
TRUE
, add the confidence interval. The default isFALSE
.- conf.level
The confidence level to use for the confidence interval if
conf.int = TRUE
. The default is 0.95.- lang
The natural language to use. The default value can be set with, e.g.,
options(data.io_lang = "fr")
for French.- show.signif.stars
If
TRUE
, add the significance stars to the table. Its value is obtained fromgetOption("show.signif.stars")
.- ...
Additional arguments passed to
tabularise::equation()
- kind
The kind of table to produce: "tt" for tinytable, or "ft" for flextable (default).
- env
The environment where to evaluate lazyeval expressions (unused for now).
Value
A flextable object is returned. You can print it in different formats (HTML, LaTeX, Word, PowerPoint), or rearrange it with the {flextable} functions.
Examples
iris_glm <- glm(data = iris, Petal.Length ~ Sepal.Length)
tabularise::tabularise$tidy(iris_glm)
Generalized Linear Model
NA
Term
Estimate
Standard Error
t value
p value
\alpha
-7.10
0.5067
-14.0
< 2·10-16
***
\beta_{}
1.86
0.0859
21.6
< 2·10-16
***
0 <= '***' < 0.001 < '**' < 0.01 < '*' < 0.05