count_missed_doses {tern} | R Documentation |
Count missed doses
Description
These are specific functions to count patients with missed doses. The difference to count_cumulative()
is
mainly the special labels.
Usage
count_missed_doses(
lyt,
vars,
thresholds,
var_labels = vars,
show_labels = "visible",
na_str = default_na_str(),
nested = TRUE,
...,
table_names = vars,
.stats = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL
)
s_count_nonmissing(x)
s_count_missed_doses(x, thresholds, .N_col)
a_count_missed_doses(x, thresholds, .N_col)
Arguments
lyt |
( |
vars |
( |
thresholds |
( |
var_labels |
( |
show_labels |
( |
na_str |
( |
nested |
( |
... |
additional arguments for the lower level functions. |
table_names |
( |
.stats |
( |
.formats |
(named |
.labels |
(named |
.indent_mods |
(named |
x |
( |
.N_col |
( |
Value
-
count_missed_doses()
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_count_missed_doses()
to the table layout.
-
s_count_nonmissing()
returns the statisticn
which is the count of non-missing values inx
.
-
s_count_missed_doses()
returns the statisticsn
andcount_fraction
with one element for each threshold.
-
a_count_missed_doses()
returns the corresponding list with formattedrtables::CellValue()
.
Functions
-
count_missed_doses()
: Layout-creating function which can take statistics function arguments and additional format arguments. This function is a wrapper forrtables::analyze()
. -
s_count_nonmissing()
: Statistics function to count non-missing values. -
s_count_missed_doses()
: Statistics function to count patients with missed doses. -
a_count_missed_doses()
: Formatted analysis function which is used asafun
incount_missed_doses()
.
See Also
Relevant description function d_count_missed_doses()
.
Examples
library(dplyr)
anl <- tern_ex_adsl %>%
distinct(STUDYID, USUBJID, ARM) %>%
mutate(
PARAMCD = "TNDOSMIS",
PARAM = "Total number of missed doses during study",
AVAL = sample(0:20, size = nrow(tern_ex_adsl), replace = TRUE),
AVALC = ""
)
basic_table() %>%
split_cols_by("ARM") %>%
add_colcounts() %>%
count_missed_doses("AVAL", thresholds = c(1, 5, 10, 15), var_labels = "Missed Doses") %>%
build_table(anl, alt_counts_df = tern_ex_adsl)