com_segment_missingness: Summarizes missingness for individuals in specific segments

Description Usage Arguments Details Value See Also

View source: R/com_segment_missingness.R

Description

This implementation can be applied in two use cases:

  1. participation in study segments is not recorded by respective variables, e.g. a participant's refusal to attend a specific examination is not recorded.

  2. participation in study segments is recorded by respective variables.

Use case (1) will be common in smaller studies. For the calculation of segment missingness it is assumed that study variables are nested in respective segments. This structure must be specified in the static metadata. The R-function identifies all variables within each segment and returns TRUE if all variables within a segment are missing, otherwise FALSE.

Use case (2) assumes a more complex structure of study data and meta data. The study data comprise so-called intro-variables (either TRUE/FALSE or codes for non-participation). The column KEY_STUDY_SEGMENT in the metadata is filled by variable-IDs indicating for each variable the respective intro-variable. This structure has the benefit that subsequent calculation of item missingness obtains correct denominators for the calculation of missingness rates.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
com_segment_missingness(
  study_data,
  meta_data,
  group_vars = NULL,
  strata_vars = NULL,
  label_col,
  threshold_value,
  direction,
  exclude_roles = "process"
)

Arguments

study_data

data.frame the data frame that contains the measurements

meta_data

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

group_vars

variable the name of a variable used for grouping, defaults to NULL for not grouping output

strata_vars

variable the name of a variable used for stratification, defaults to NULL for not grouping output

label_col

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

threshold_value

numeric from=0 to=100. a numerical value ranging from 0-100

direction

enum low | high. "high" or "low", i.e. are deviations above/below the threshold critical

exclude_roles

variable roles a character (vector) of variable roles not included

Details

Implementation and use of thresholds

This implementation uses one threshold to discriminate critical from non-critical values. If direction is high than all values below the threshold_value are normal (displayed in dark blue in the plot and flagged with grading = 0 in the dataframe). All values above the threshold_value are considered critical. The more they deviate from the threshold the displayed color shifts to dark red. All critical values are highlighted with grading = 1 in the summary data frame. By default, highest values are always shown in dark red irrespective of the absolute deviation.

If direction is low than all values above the threshold_value are normal (displayed in dark blue, grading = 0).

Hint

This function does not support a resp_vars argument but exclude_roles to specify variables not relevant for detecting a missing segment.

Value

a list with:

See Also

Online Documentation


dataquieR documentation built on Feb. 2, 2021, 5:14 p.m.