Skip to contents

This function detects the type of study based on the provided data.

Usage

detect_study_types(
  data,
  groups,
  drug_column,
  analyte_column,
  route_column,
  volume_column = "volume"
)

Arguments

data

The dataset containing the study types to be identified. Assumed to be the output from aNCA formatted concentration data. Must contain group columns, the specified route, analyte and drug columns, and ADOSEDUR.

groups

the grouping variables for the study type detection.

drug_column

A character string specifying the column name for drug

analyte_column

A character string specifying the column name for analyte

route_column

A character string specifying the column name for the route of administration.

volume_column

A character string specifying the column name for the volume of a sample. Extravascular samples must be written as extravascular. Can be set to volume if not applicable.

Value

A data frame summarizing the detected study types, including the grouping columns and the identified type.

Details

The function identifies a possible five different types of studies based on grouping by STUDYID, DRUG, USUBJID, PCSPEC, and the route column. The study types are determined as follows:

  • "Excretion Data": If the volume column for a group is not NA and has values > 0.

  • "Single Extravascular Dose": If there is only one dose and TAU is not available, and the route is extravascular.

  • "Single IV Infusion Dose": If there is only one dose and TAU is not present, and the route is not extravascular.

  • "Single IV Bolus Dose": If there is only one dose and TAU is not present, the route is not extravascular, and ADOSEDUR == 0.

  • "Multiple Extravascular Doses": If there are multiple doses (or TAU is available) and the route is extravascular.

  • "Multiple IV Infusion Doses": If there are multiple doses (or TAU is available) and the route is not extravascular.

  • "Multiple IV Bolus Doses": If there are multiple doses or TAU is not present, the route is not extravascular, and ADOSEDUR == 0.

  • If none of these conditions are met, the type is marker as "Unknown".

Examples

sample_data <- data.frame(
  STUDYID = "STUDY001",
  DRUG = "Drug",
  ANALYTE = "DRUG",
  USUBJID = c(
    # 1. Single IV Dose subject
    "Subj-01", "Subj-01",
    # 2. Multiple Extravascular Doses subject (identified by TAU)
    "Subj-02", "Subj-02",
    # 3. Excretion Data subject (identified by positive volume)
    "Subj-03", "Subj-03"
  ),
  PCSPEC = "PLASMA",
  DOSNOA = c(
    1, 1,        # Single dose
    1, 1,        # Appears as single dose...
    1, 1         # Single dose
  ),
  ROUTE = c(
    "INTRAVENOUS", "INTRAVENOUS",
    "extravascular", "extravascular",
    "INTRAVENOUS", "INTRAVENOUS"
  ),
  ADOSEDUR = c(
  0, 0,
  0, 0,
  2, 2),
  SAMPLE_VOLUME = c(
    NA, 0,
    NA, 0,
    10, 12       # Positive volume indicates excretion
  ),
  TAU = c(
    NA, NA,
    24, 24,      # ...but TAU indicates a multiple-dose regimen
    NA, NA
  )
)

study_summary <- detect_study_types(
  data = sample_data,
  groups = c("USUBJID", "PCSPEC", "DRUG"),
  drug_column = "DRUG",
  analyte_column = "ANALYTE",
  route_column = "ROUTE",
  volume_column = "SAMPLE_VOLUME"
)