summarize_ancova {tern} | R Documentation |
Summary for analysis of covariance (ANCOVA).
Description
Summarize results of ANCOVA. This can be used to analyze multiple endpoints and/or
multiple timepoints within the same response variable .var
.
Usage
summarize_ancova(
lyt,
vars,
variables,
conf_level,
interaction_y = FALSE,
interaction_item = NULL,
var_labels,
na_str = default_na_str(),
nested = TRUE,
...,
show_labels = "visible",
table_names = vars,
.stats = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL
)
s_ancova(
df,
.var,
.df_row,
variables,
.ref_group,
.in_ref_col,
conf_level,
interaction_y = FALSE,
interaction_item = NULL
)
a_ancova(
df,
.var,
.df_row,
variables,
.ref_group,
.in_ref_col,
conf_level,
interaction_y = FALSE,
interaction_item = NULL
)
Arguments
lyt |
( |
vars |
( |
variables |
(named
|
conf_level |
( |
interaction_y |
( |
interaction_item |
( |
var_labels |
( |
na_str |
( |
nested |
( |
... |
additional arguments for the lower level functions. |
show_labels |
( |
table_names |
( |
.stats |
( |
.formats |
(named |
.labels |
(named |
.indent_mods |
(named |
df |
( |
.var |
( |
.df_row |
( |
.ref_group |
( |
.in_ref_col |
( |
Value
-
summarize_ancova()
returns a layout object suitable for passing to further layouting functions, or tortables::build_table()
. Adding this function to anrtable
layout will add formatted rows containing the statistics froms_ancova()
to the table layout.
-
s_ancova()
returns a named list of 5 statistics:-
n
: Count of complete sample size for the group. -
lsmean
: Estimated marginal means in the group. -
lsmean_diff
: Difference in estimated marginal means in comparison to the reference group. If working with the reference group, this will be empty. -
lsmean_diff_ci
: Confidence level for difference in estimated marginal means in comparison to the reference group. -
pval
: p-value (not adjusted for multiple comparisons).
-
-
a_ancova()
returns the corresponding list with formattedrtables::CellValue()
.
Functions
-
summarize_ancova()
: Layout-creating function which can take statistics function arguments and additional format arguments. This function is a wrapper forrtables::analyze()
. -
s_ancova()
: Statistics function that produces a named list of results of the investigated linear model. -
a_ancova()
: Formatted analysis function which is used asafun
insummarize_ancova()
.
Examples
basic_table() %>%
split_cols_by("Species", ref_group = "setosa") %>%
add_colcounts() %>%
summarize_ancova(
vars = "Petal.Length",
variables = list(arm = "Species", covariates = NULL),
table_names = "unadj",
conf_level = 0.95, var_labels = "Unadjusted comparison",
.labels = c(lsmean = "Mean", lsmean_diff = "Difference in Means")
) %>%
summarize_ancova(
vars = "Petal.Length",
variables = list(arm = "Species", covariates = c("Sepal.Length", "Sepal.Width")),
table_names = "adj",
conf_level = 0.95, var_labels = "Adjusted comparison (covariates: Sepal.Length and Sepal.Width)"
) %>%
build_table(iris)