Run sequential quality control checks and thereby restrict the pts and smp datasets to cases that pass certain criteria. trt (treatment) data are passed along without changes.

check_prostate_redcap(
  data,
  qc_crit_pts = qc_criteria_pts(),
  qc_crit_smp = qc_criteria_smp(),
  qc_level_pts = NULL,
  qc_level_smp = NULL,
  recommended_only = FALSE,
  time_origin = c("seq", "dx", "adt", "met")
)

Arguments

data

List with elements pts and smp, returned by load_prostate_redcap.

qc_crit_pts

Criteria for checking the pts tibble. Defaults to the return of the qc_criteria_pts function. Custom criteria can be supplied instead.

qc_crit_smp

Criteria for checking the smp tibble. Defaults to the return of the qc_criteria_smp function. Custom criteria can be supplied instead.

qc_level_pts

Level of QC that the return pts tibble will be restricted to. By default, all QC steps in qc_crit_pts will be applied. A integer index (row) number of qc_crit_pts can be provided instead to perform less strict exclusions. qc_level_pts = 1 will perform no exclusions.

qc_level_smp

As qc_level_pts, for smp.

recommended_only

Return qc'd pts and smp restricted to variables that are recommended for use in analyses? Defaults to FALSE but is recommended for use.

time_origin

Time origin for follow-up time scales: sequencing ("seq"), diagnosis ("dx"), from initiation of androgen deprivaiton therapy "adt", or from metastasis ("met")? Provide multiple origins as, e.g., c("dx", "seq"). Returns all variables by default or if recommended_only = FALSE.

Value

List:

  • pts: Patient-level data after QC.

  • smp: Sample-level data after QC.

  • qc_pts: Tibble of sequential exclusions for pts.

  • qc_smp: Tibble of sequential exclusions for smp. The qc_pts and qc_smp tibbles can be used to extract information on which records failed which QC step.

See also

Examples

if (FALSE) {
# Process output of load_prostate_redcap():
pts_smp_qc <- check_prostate_redcap(pts_smp, recommended_only = TRUE)
}