resp01_acfun {junco} | R Documentation |
Formatted Analysis and Content Summary Function for Response Tables (RESP01)
Description
This function applies to both factor
and logical
columns called
.var
from df
. Depending on the position in the split, it returns the
right formatted results for the RESP01 and related layouts.
Usage
resp01_acfun(
df,
labelstr = NULL,
label = NULL,
.var,
.spl_context,
include_comp,
.alt_df,
conf_level,
arm,
strata,
formats,
methods
)
Arguments
df |
( |
labelstr |
( |
label |
( |
.var |
( |
.spl_context |
( |
include_comp |
( |
.alt_df |
( |
conf_level |
( |
arm |
( |
strata |
( |
formats |
( |
methods |
( |
Value
The formatted result as rtables::in_rows()
result.
Examples
fake_spl_context <- data.frame(
cur_col_split_val = I(list(c(ARM = "A: Drug X", count_prop = "count_prop")))
)
dm <- droplevels(subset(DM, SEX %in% c("F", "M")))
resp01_acfun(
dm,
.alt_df = dm,
.var = "COUNTRY",
.spl_context = fake_spl_context,
conf_level = 0.9,
include_comp = c("USA", "CHN"),
arm = "SEX",
strata = "RACE",
methods = list(
comp_stat_ci = "or_cmh",
pval = "",
prop_ci = "wald"
),
formats = list(
prop_ci = jjcsformat_xx("xx.% - xx.%"),
comp_stat_ci = jjcsformat_xx("xx.xx (xx.xx - xx.xx)"),
pval = jjcsformat_pval_fct(0.05)
)
)
fake_spl_context2 <- data.frame(
cur_col_split_val = I(list(c(ARM = "Overall", comp_stat_ci = "comp_stat_ci")))
)
resp01_acfun(
dm,
.alt_df = dm,
.var = "COUNTRY",
.spl_context = fake_spl_context2,
conf_level = 0.9,
include_comp = c("USA", "CHN"),
arm = "SEX",
strata = "RACE",
methods = list(
comp_stat_ci = "or_cmh",
pval = "",
prop_ci = "wald"
),
formats = list(
prop_ci = jjcsformat_xx("xx.% - xx.%"),
comp_stat_ci = jjcsformat_xx("xx.xx (xx.xx - xx.xx)"),
pval = jjcsformat_pval_fct(0.05)
)
)