print.estimate_contrasts {modelbased} | R Documentation |
Printing modelbased-objects
Description
print()
method for modelbased objects. Can be used to tweak the output
of tables.
Usage
## S3 method for class 'estimate_contrasts'
print(x, select = NULL, include_grid = NULL, full_labels = NULL, ...)
Arguments
x |
An object returned by the different |
select |
Determines which columns are printed and the table layout. There are two options for this argument:
Using Note: glue-like syntax is still experimental in the case of more complex models (like mixed models) and may not return expected results. |
include_grid |
Logical, if |
full_labels |
Logical, if |
... |
Arguments passed to |
Value
Invisibly returns x
.
Global Options to Customize Tables when Printing
Columns and table layout can be customized using options()
:
-
modelbased_select
:options(modelbased_select = <string>)
will set a default value for theselect
argument and can be used to define a custom default layout for printing. -
modelbased_include_grid
:options(modelbased_include_grid = TRUE)
will set a default value for theinclude_grid
argument and can be used to include data grids in the output by default or not. -
modelbased_full_labels
:options(modelbased_full_labels = FALSE)
will remove redundant (duplicated) labels from rows.
Note
Use print_html()
and print_md()
to create tables in HTML or
markdown format, respectively.
Examples
model <- lm(Petal.Length ~ Species, data = iris)
out <- estimate_means(model, "Species")
# default
print(out)
# smaller set of columns
print(out, select = "minimal")
# remove redundant labels
data(efc, package = "modelbased")
efc <- datawizard::to_factor(efc, c("c161sex", "c172code", "e16sex"))
levels(efc$c172code) <- c("low", "mid", "high")
fit <- lm(neg_c_7 ~ c161sex * c172code * e16sex, data = efc)
out <- estimate_means(fit, c("c161sex", "c172code", "e16sex"))
print(out, full_labels = FALSE, select = "{estimate} ({se})")