t_mh_slide: Medical history table

View source: R/t_mh_slide.R

t_mh_slideR Documentation

Medical history table

Description

Summarize medical history by system organ class (SOC) and preferred term (PT). ADSL defines both the analysis population and the treatment denominators. ADMH records for subjects not present in ADSL are excluded, and treatment is derived from ADSL. If ADMH also contains arm, its non-missing values must agree with ADSL for the same subject.

Usage

t_mh_slide(adsl, admh, arm = "TRT01A", add_all_patients_col = TRUE)

Arguments

adsl

Subject-level analysis dataset. It must contain one row per non-missing USUBJID and the treatment variable named by arm.

admh

Medical history analysis dataset. It must contain USUBJID, MHBODSYS, and MHDECOD.

arm

Name of the treatment variable in adsl, character scalar; "TRT01A" by default.

add_all_patients_col

Logical scalar indicating whether an additional ⁠All Patients⁠ column is displayed.

Details

Counts for the overall table and each SOC include the number and percentage of unique subjects with at least one condition and, on a separate row, the non-unique number of condition records. PT rows contain unique subject counts and percentages. SOCs and PTs are sorted by decreasing total unique subject count, with labels used to break ties deterministically. Missing or blank SOC and PT values are displayed as ⁠<Missing>⁠.

Value

An rtables::VTableTree object.

Note

* Default arm variables are set to '"TRT01A"' for safety output, and '"TRT01P"' for efficacy output

References

The table structure follows the public MHT01 example in the TLG Catalog.

Examples

library(dplyr)
adsl <- eg_adsl %>%
  dplyr::mutate(TRT01A = factor(TRT01A))
admh <- eg_admh

out <- t_mh_slide(adsl, admh)
print(out)

out_without_overall <- t_mh_slide(
  adsl,
  admh,
  add_all_patients_col = FALSE
)

autoslider.core documentation built on Sept. 29, 2026, 5:08 p.m.