util_acc_loess_bin {dataquieR}R Documentation

Utility function for smoothed longitudinal trends from logistic regression models

Description

This function is under development. It computes a logistic regression for binary variables and visualizes smoothed time trends of the residuals by LOESS or GAM. The function can also be called for non-binary outcome variables. These will be transformed to binary variables, either using user-specified groups in the metadata columns RECODE_CASES and/or RECODE_CONTROL (see util_dichotomize), or it will attempt to recode the variables automatically. For nominal variables, it will consider the most frequent category as 'cases' and every other category as 'control', if there are more than two categories. Nominal variables with only two distinct values will be transformed by assigning the less frequent category to 'cases' and the more frequent category to 'control'. For variables of other statistical data types, values inside the interquartile range are considered as 'control', values outside this range as 'cases'. Variables with few different values are transformed in a simplified way to obtain two groups.

Usage

util_acc_loess_bin(
  resp_vars,
  label_col = NULL,
  study_data,
  item_level = "item_level",
  group_vars = NULL,
  time_vars,
  co_vars = NULL,
  min_obs_in_subgroup = 30,
  resolution = 80,
  plot_format = getOption("dataquieR.acc_loess.plot_format",
    dataquieR.acc_loess.plot_format_default),
  meta_data = item_level,
  n_group_max = getOption("dataquieR.max_group_var_levels_in_plot",
    dataquieR.max_group_var_levels_in_plot_default),
  enable_GAM = getOption("dataquieR.GAM_for_LOESS", dataquieR.GAM_for_LOESS.default),
  exclude_constant_subgroups =
    getOption("dataquieR.acc_loess.exclude_constant_subgroups",
    dataquieR.acc_loess.exclude_constant_subgroups.default),
  min_bandwidth = getOption("dataquieR.acc_loess.min_bw",
    dataquieR.acc_loess.min_bw.default),
  min_proportion = getOption("dataquieR.acc_loess.min_proportion",
    dataquieR.acc_loess.min_proportion.default)
)

Arguments

resp_vars

variable the name of the (binary) measurement variable

label_col

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

study_data

data.frame the data frame that contains the measurements

group_vars

variable the name of the observer, device or reader variable

time_vars

variable the name of the variable giving the time of measurement

co_vars

variable list a vector of co-variables, e.g. age and sex for adjustment

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. Subgroups with less observations are excluded.

resolution

integer the maximum number of time points used for plotting the trend lines

plot_format

enum AUTO | COMBINED | FACETS | BOTH. Return the plot as one combined plot for all groups or as facet plots (one figure per group). BOTH will return both variants, AUTO will decide based on the number of observers.

meta_data

data.frame the data frame that contains metadata attributes of study data

n_group_max

integer maximum number of categories to be displayed individually for the grouping variable (group_vars, devices / examiners)

enable_GAM

logical Can LOESS computations be replaced by general additive models to reduce memory consumption for large datasets?

exclude_constant_subgroups

logical Should subgroups with constant values be excluded?

min_bandwidth

numeric lower limit for the LOESS bandwidth, should be greater than 0 and less than or equal to 1. In general, increasing the bandwidth leads to a smoother trend line.

min_proportion

numeric lower limit for the proportion of the smaller group (cases or controls) for creating a LOESS figure, should be greater than 0 and less than 0.4.

Details

Descriptor

Value

a list with:


[Package dataquieR version 2.5.1 Index]