a_summarize_ancova_j {junco} | R Documentation |
ANCOVA Summary Function
Description
Combination of tern::s_summary, and ANCOVA based estimates for mean and diff between columns,
based on ANCOVA function s_ancova_j
Usage
a_summarize_ancova_j(
df,
.var,
.df_row,
ref_path,
.spl_context,
...,
.stats = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL
)
s_summarize_ancova_j(df, .var, .df_row, .ref_group, .in_ref_col, ...)
Arguments
df |
: need to check on how to inherit params from tern::s_ancova |
.var |
( |
.df_row |
( |
ref_path |
( |
.spl_context |
( |
... |
Additional arguments passed to |
.stats |
( |
.formats |
( |
.labels |
( |
.indent_mods |
( |
.ref_group |
( |
.in_ref_col |
( |
Details
Combination of tern::s_summary, and ANCOVA based estimates for mean and diff between columns,
based on ANCOVA function s_ancova_j
Value
-
a_summarize_ancova_j()
returns the corresponding list with formattedrtables::CellValue()
.
returns the statistics from tern::s_summary(x), appended with a new statistics based upon ANCOVA
Functions
-
a_summarize_ancova_j()
: Formatted analysis function which is used asafun
. Note that the junco specificref_path
and.spl_context
arguments are used for reference column information.
See Also
Other Inclusion of ANCOVA Functions:
a_summarize_aval_chg_diff_j()
,
s_ancova_j()
Examples
basic_table() |>
split_cols_by("Species") |>
add_colcounts() |>
analyze(
vars = "Petal.Length",
afun = a_summarize_ancova_j,
show_labels = "hidden",
na_str = tern::default_na_str(),
table_names = "unadj",
var_labels = "Unadjusted comparison",
extra_args = list(
variables = list(arm = "Species", covariates = NULL),
conf_level = 0.95,
.labels = c(lsmean = "Mean", lsmean_diff = "Difference in Means"),
ref_path = c("Species", "setosa")
)
) |>
analyze(
vars = "Petal.Length",
afun = a_summarize_ancova_j,
show_labels = "hidden",
na_str = tern::default_na_str(),
table_names = "adj",
var_labels = "Adjusted comparison (covariates: Sepal.Length and Sepal.Width)",
extra_args = list(
variables = list(
arm = "Species",
covariates = c("Sepal.Length", "Sepal.Width")
),
conf_level = 0.95,
ref_path = c("Species", "setosa")
)
) |>
build_table(iris)
library(dplyr)
library(tern)
df <- iris |> filter(Species == "virginica")
.df_row <- iris
.var <- "Petal.Length"
variables <- list(arm = "Species", covariates = "Sepal.Length * Sepal.Width")
.ref_group <- iris |> filter(Species == "setosa")
conf_level <- 0.95
s_summarize_ancova_j(
df,
.var = .var,
.df_row = .df_row,
variables = variables,
.ref_group = .ref_group,
.in_ref_col = FALSE,
conf_level = conf_level
)