util_margins_bin {dataquieR} | R Documentation |
Utility function to create a margins plot for binary variables
Description
Utility function to create a margins plot for binary variables
Usage
util_margins_bin(
resp_vars = NULL,
group_vars = NULL,
co_vars = NULL,
threshold_type = NULL,
threshold_value,
min_obs_in_subgroup = 5,
min_obs_in_cat = 5,
caption = NULL,
ds1,
label_col,
adjusted_hint = "",
title = "",
sort_group_var_levels = getOption("dataquieR.acc_margins_sort",
dataquieR.acc_margins_sort_default),
include_numbers_in_figures = getOption("dataquieR.acc_margins_num",
dataquieR.acc_margins_num_default)
)
Arguments
resp_vars |
variable the name of the binary measurement variable |
group_vars |
variable the name of the observer, device or reader variable |
co_vars |
variable list a vector of covariables, e.g. age and sex for adjustment |
threshold_type |
enum empirical | user | none. See |
threshold_value |
numeric see |
min_obs_in_subgroup |
integer from=0. This optional argument specifies
the minimum number of observations that is required to
include a subgroup (level) of the |
min_obs_in_cat |
integer This optional argument specifies the minimum
number of observations that is required to include
a category (level) of the outcome ( |
caption |
string a caption for the plot (optional, typically used to report the coding of cases and control group) |
ds1 |
data.frame the data frame that contains the measurements, after
replacing missing value codes by |
label_col |
variable attribute the name of the column in the metadata with labels of variables |
adjusted_hint |
character hint, if adjusted for |
title |
character title for the plot |
sort_group_var_levels |
logical Should the levels of the grouping variable be sorted descending by the number of observations (in the figure)? |
include_numbers_in_figures |
logical Should the figure report the number of observations for each level of the grouping variable? |
Value
A table and a matching plot.