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 acc_margins.

threshold_value

numeric see acc_margins

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 group_var in the analysis.

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 (resp_vars) in the analysis.

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 NA, excluding inadmissible values and transforming categorical variables to factors.

label_col

variable attribute the name of the column in the metadata with labels of variables

adjusted_hint

character hint, if adjusted for co_vars

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.


[Package dataquieR version 2.5.1 Index]