print.estimate_contrasts | R Documentation |
print()
method for modelbased objects. Can be used to tweak the output
of tables.
## S3 method for class 'estimate_contrasts'
print(x, select = NULL, include_grid = NULL, full_labels = NULL, ...)
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 |
Invisibly returns x
.
Columns and table layout can be customized using options()
:
modelbased_select
: options(modelbased_select = <string>)
will set a
default value for the select
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 the include_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.
Use print_html()
and print_md()
to create tables in HTML or
markdown format, respectively.
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})")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.