Skip to contents

Generic Occurrence Summary Tiered Table

Usage

occ_tier_summary(
  datain,
  a_subset = NA_character_,
  summary_by = "Patients",
  hterm = "AEBODSYS",
  lterm = "AEDECOD",
  htermctyn = "Y",
  pctdisp = "TRT",
  cutoff_where = NA,
  sum_row = "N",
  sum_row_label = "Number of Participants with Any AE",
  apply_hrow_cutoff = "N",
  sort_opt = "Ascending",
  sort_var = "Count",
  sort_col = 1,
  nolwrtierdispyn = "N",
  sigdec_cat = 2,
  pctsyn = "Y",
  stathead = "n (%)"
)

Arguments

datain

Input dataset (generally the output from mentry())

a_subset

Analysis Subset condition specific to categorical analysis.

summary_by

Measure to construct the summary by. Values: 'Patients' or 'Events'.

hterm

High Level Event term variable, used for analysis (tilde-separated)

lterm

Low Level Event term variable, used for analysis

htermctyn

To show count of high term rows or not. Should correspond to and be same number of terms passed in hterm (tilde-separated). To suppress showing counts for any term pass "N"

pctdisp

Method to calculate denominator (for %) by. Possible values: "TRT", "VAR", "COL", "SUBGRP", "CAT", "NONE", "NO", "DPTVAR", "BYVARxyN"

cutoff_where

Filter condition for incidence/pct. Consider only terms with eg: "FREQ > 5" or "PCT <3". Must contain FREQ or PCT (count or percent)

sum_row

To show summary/any term row or not. 'Y'/'N'

sum_row_label

Label for Summary Row to be displayed, if Y.

apply_hrow_cutoff

To apply cutoff_where value to high terms in addition to low term. If set to "Y" same cutoff is applied to remove both high and low level terms that don't meet the criteria. If set to "N" (default), cutoff is applied only to Lower Level term. The terms that do not fit the criteria are then excluded from the counts for High Level term. This does not happen in case of "N" - all low terms are included in high term which is displayed as long as it meets the criteria as well.

sort_opt

How to sort terms, only for table/forest plot. Values: 'Ascending','Descending','Alphabetical'.

sort_var

Metric to sort by. Values: 'Count','Percent','RiskValue'.

sort_col

Which treatment column to sort by. (Depends on trt levels) eg: 1, 2, 3

nolwrtierdispyn

Whenapply_hrow_cutoff = Y, to display high level terms with zero low level terms satisfying the cutoff threshold or not? If Y, high terms will be displayed even with no corresponding lower levels in the table.

sigdec_cat

Number of decimal places for % displayed in output

pctsyn

Display Percentage Sign in table or not. Values: "Y"/"N"

stathead

Label for sub-column header in output. eg. "n (%)"

Value

Summarized data frame for Adverse Events based on high and lower terms.

Details

  • cutoff_where is applied to event lower term only, unless apply_hrow_cutoff is given.

  • If apply_hrow_cutoff is Y, cutoff_where is applied to higher terms as well. If it is N, lower terms which do not meet criteria are removed from higher term count. eg: if cutoff_where is set to "PCT >= 2" and hterm and lterm are AEBODSYS and AEDECOD:

    EYE DISORDERS 9 (3.1) Dry eye 3 (1.4) Wet eye 6 (2.4)

    Here if apply_hrow_cutoff is set to N then 'Dry eye' row will be excluded and the 3 excluded from count of EYE DISORDERS as well (9). If Y, then 'Dry eye' will be excluded but EYE DISORDERS not impacted as it is 4.4% and its PCT >= 2.

  • If cutoff_where is PCT >= 3 and nolwrtierdispyn set to Y, then neither Dry eye nor Wet eye will be shown, but EYE DISORDERS will still be displayed.

    If nolwrtierdispyn is N in this case, EYE DISORDERS will also be removed as no low terms meet the criteria.

Examples

data("adae")
ae_pre_process <- ae_pre_processor(
  datain = adae,
  obs_residual = 0,
  fmq_data = NA
)
ae_entry <- ae_pre_process[["data"]] |>
  mentry(
    subset = NA,
    byvar = "AEBODSYS",
    trtvar = "TRTA",
    trtsort = "TRTAN",
    trttotalyn = "N",
    add_grpmiss = "N",
    sgtotalyn = "N",
    pop_fil = "Overall Population"
  )
output <- occ_tier_summary(
  ae_entry,
  a_subset = ae_pre_process[["a_subset"]],
  summary_by = "Patients",
  hterm = "AEBODSYS",
  lterm = "AEDECOD",
  pctdisp = "TRT",
  cutoff_where = "PCT > 2",
  apply_hrow_cutoff = "N",
  sort_opt = "Ascending",
  sort_var = "Count"
)
#> mcatstat success
#> mcatstat success
output |>
  tbl_processor() |>
  tbl_display()

Placebo

Xanomeline Low Dose

Xanomeline High Dose

n (%)

n (%)

n (%)

CONGENITAL, FAMILIAL AND GENETIC DISORDERS

0

1 ( 1.37%)

2 ( 2.90%)

   VENTRICULAR SEPTAL DEFECT

0

1 ( 1.37%)

2 ( 2.90%)

CARDIAC DISORDERS

2 ( 3.45%)

7 ( 9.59%)

9 (13.04%)

   ATRIAL FIBRILLATION

0

0

2 ( 2.90%)

   VENTRICULAR EXTRASYSTOLES

0

2 ( 2.74%)

1 ( 1.45%)

   MYOCARDIAL INFARCTION

1 ( 1.61%)

2 ( 2.74%)

4 ( 5.80%)

   SINUS BRADYCARDIA

1 ( 1.61%)

4 ( 5.48%)

4 ( 5.80%)

INJURY, POISONING AND PROCEDURAL COMPLICATIONS

2 ( 3.45%)

1 ( 1.37%)

3 ( 4.35%)

   CONTUSION

1 ( 1.61%)

1 ( 1.37%)

2 ( 2.90%)

   EXCORIATION

2 ( 3.23%)

0

1 ( 1.45%)

VASCULAR DISORDERS

2 ( 3.45%)

0

0

   HYPOTENSION

2 ( 3.23%)

0

0

MUSCULOSKELETAL AND CONNECTIVE TISSUE DISORDERS

3 ( 5.17%)

5 ( 6.85%)

3 ( 4.35%)

   ARTHRALGIA

1 ( 1.61%)

2 ( 2.74%)

1 ( 1.45%)

   BACK PAIN

1 ( 1.61%)

1 ( 1.37%)

3 ( 4.35%)

   SHOULDER PAIN

1 ( 1.61%)

2 ( 2.74%)

0

INVESTIGATIONS

4 ( 6.90%)

2 ( 2.74%)

1 ( 1.45%)

   ELECTROCARDIOGRAM T WAVE INVERSION

2 ( 3.23%)

1 ( 1.37%)

1 ( 1.45%)

   ELECTROCARDIOGRAM ST SEGMENT DEPRESSION

3 ( 4.84%)

1 ( 1.37%)

0

RESPIRATORY, THORACIC AND MEDIASTINAL DISORDERS

4 ( 6.90%)

7 ( 9.59%)

7 (10.14%)

   EPISTAXIS

0

1 ( 1.37%)

2 ( 2.90%)

   COUGH

1 ( 1.61%)

5 ( 6.85%)

5 ( 7.25%)

   NASAL CONGESTION

3 ( 4.84%)

1 ( 1.37%)

2 ( 2.90%)

NERVOUS SYSTEM DISORDERS

5 ( 8.62%)

12 (16.44%)

16 (23.19%)

   BURNING SENSATION

0

0

2 ( 2.90%)

   SYNCOPE

0

1 ( 1.37%)

2 ( 2.90%)

   DIZZINESS

2 ( 3.23%)

6 ( 8.22%)

10 (14.49%)

   HEADACHE

2 ( 3.23%)

3 ( 4.11%)

4 ( 5.80%)

   SOMNOLENCE

2 ( 3.23%)

3 ( 4.11%)

1 ( 1.45%)

PSYCHIATRIC DISORDERS

6 (10.34%)

5 ( 6.85%)

2 ( 2.90%)

   ANXIETY

0

3 ( 4.11%)

0

   AGITATION

2 ( 3.23%)

0

0

   CONFUSIONAL STATE

2 ( 3.23%)

2 ( 2.74%)

1 ( 1.45%)

   INSOMNIA

2 ( 3.23%)

0

2 ( 2.90%)

INFECTIONS AND INFESTATIONS

12 (20.69%)

5 ( 6.85%)

10 (14.49%)

   EAR INFECTION

2 ( 3.23%)

0

0

   NASOPHARYNGITIS

2 ( 3.23%)

4 ( 5.48%)

6 ( 8.70%)

   URINARY TRACT INFECTION

2 ( 3.23%)

0

1 ( 1.45%)

   UPPER RESPIRATORY TRACT INFECTION

6 ( 9.68%)

1 ( 1.37%)

3 ( 4.35%)

GASTROINTESTINAL DISORDERS

13 (22.41%)

10 (13.70%)

14 (20.29%)

   SALIVARY HYPERSECRETION

0

0

4 ( 5.80%)

   ABDOMINAL PAIN

1 ( 1.61%)

3 ( 4.11%)

1 ( 1.45%)

   NAUSEA

3 ( 4.84%)

3 ( 4.11%)

6 ( 8.70%)

   VOMITING

3 ( 4.84%)

3 ( 4.11%)

3 ( 4.35%)

   DIARRHOEA

9 (14.52%)

3 ( 4.11%)

3 ( 4.35%)

SKIN AND SUBCUTANEOUS TISSUE DISORDERS

17 (29.31%)

36 (49.32%)

37 (53.62%)

   BLISTER

0

5 ( 6.85%)

1 ( 1.45%)

   RASH PRURITIC

0

1 ( 1.37%)

2 ( 2.90%)

   HYPERHIDROSIS

2 ( 3.23%)

2 ( 2.74%)

8 (11.59%)

   SKIN IRRITATION

2 ( 3.23%)

6 ( 8.22%)

5 ( 7.25%)

   RASH

5 ( 8.06%)

13 (17.81%)

9 (13.04%)

   ERYTHEMA

7 (11.29%)

14 (19.18%)

13 (18.84%)

   PRURITUS

8 (12.90%)

20 (27.40%)

24 (34.78%)

GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS

19 (32.76%)

41 (56.16%)

35 (50.72%)

   APPLICATION SITE PAIN

0

0

2 ( 2.90%)

   APPLICATION SITE PERSPIRATION

0

0

2 ( 2.90%)

   APPLICATION SITE SWELLING

0

1 ( 1.37%)

2 ( 2.90%)

   APPLICATION SITE URTICARIA

0

2 ( 2.74%)

0

   CHEST PAIN

0

0

2 ( 2.90%)

   MALAISE

0

1 ( 1.37%)

2 ( 2.90%)

   OEDEMA

0

2 ( 2.74%)

0

   APPLICATION SITE VESICLES

1 ( 1.61%)

4 ( 5.48%)

3 ( 4.35%)

   FATIGUE

1 ( 1.61%)

5 ( 6.85%)

5 ( 7.25%)

   OEDEMA PERIPHERAL

2 ( 3.23%)

0

2 ( 2.90%)

   PYREXIA

2 ( 3.23%)

0

0

   APPLICATION SITE ERYTHEMA

3 ( 4.84%)

12 (16.44%)

14 (20.29%)

   APPLICATION SITE IRRITATION

3 ( 4.84%)

8 (10.96%)

9 (13.04%)

   APPLICATION SITE DERMATITIS

5 ( 8.06%)

9 (12.33%)

7 (10.14%)

   APPLICATION SITE PRURITUS

6 ( 9.68%)

22 (30.14%)

21 (30.43%)

# Example 2: ADAE table with max sev/ctc grade: ae_pre <- ae_pre_processor( adae, subset = "TRTEMFL == 'Y'", max_sevctc = "SEV", sev_ctcvar = "AESEVN", pt_total = "Y" ) ae_entry_max <- adsl_merge( adsl, adsl_subset = 'SAFFL == "Y"', ae_pre[["data"]] ) |> mentry( subset = NA, byvar = "AEBODSYS", trtvar = "TRTA", trtsort = "TRTAN", trttotalyn = "N", add_grpmiss = "N", subgrpvar = "AESEV", sgtotalyn = "N", pop_fil = "Overall Population" ) rpt_data <- occ_tier_summary( ae_entry_max, a_subset = ae_pre[["a_subset"]], summary_by = "Patients", hterm = "AEBODSYS", lterm = "AEDECOD", cutoff_where = "FREQ > 2", pctdisp = "TRT", sum_row = "Y", sum_row_label = "Any Adverse Event", nolwrtierdispyn = "N", sort_opt = "Alphabetical", stathead = "n (%)" ) #> mcatstat success #> mcatstat success #> mcatstat success #> mcatstat success rpt_data |> tbl_processor() |> tbl_display(dpthead = "No. of Adverse Events_SOC and PT") |> flextable::autofit()

No. of Adverse Events

Placebo

Xanomeline Low Dose

Xanomeline High Dose

SOC and PT

MILD

MODERATE

SEVERE

MILD

MODERATE

SEVERE

MILD

MODERATE

SEVERE

n (%)

n (%)

n (%)

n (%)

n (%)

n (%)

n (%)

n (%)

n (%)

Any Adverse Event

29 (48.33%)

13 (21.67%)

2 ( 3.33%)

17 (22.08%)

29 (37.66%)

11 (14.29%)

19 (25.33%)

34 (45.33%)

3 ( 4.00%)

CARDIAC DISORDERS

8 (13.33%)

2 ( 3.33%)

2 ( 3.33%)

8 (10.39%)

5 ( 6.49%)

0

9 (12.00%)

5 ( 6.67%)

1 ( 1.33%)

   MYOCARDIAL INFARCTION

1 ( 1.54%)

1 ( 1.54%)

2 ( 3.08%)

2 ( 2.60%)

0

0

3 ( 3.95%)

1 ( 1.32%)

0

   SINUS BRADYCARDIA

1 ( 1.54%)

1 ( 1.54%)

0

6 ( 7.79%)

1 ( 1.30%)

0

4 ( 5.26%)

4 ( 5.26%)

0

GASTROINTESTINAL DISORDERS

15 (25.00%)

2 ( 3.33%)

0

10 (12.99%)

4 ( 5.19%)

0

14 (18.67%)

4 ( 5.33%)

2 ( 2.67%)

   DIARRHOEA

9 (13.85%)

0

0

4 ( 5.19%)

0

0

2 ( 2.63%)

2 ( 2.63%)

0

   NAUSEA

2 ( 3.08%)

1 ( 1.54%)

0

2 ( 2.60%)

1 ( 1.30%)

0

5 ( 6.58%)

0

1 ( 1.32%)

   SALIVARY HYPERSECRETION

0

0

0

0

0

0

4 ( 5.26%)

0

0

   VOMITING

2 ( 3.08%)

1 ( 1.54%)

0

2 ( 2.60%)

1 ( 1.30%)

0

5 ( 6.58%)

2 ( 2.63%)

0

GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS

16 (26.67%)

5 ( 8.33%)

0

19 (24.68%)

21 (27.27%)

7 ( 9.09%)

19 (25.33%)

21 (28.00%)

0

   APPLICATION SITE DERMATITIS

5 ( 7.69%)

0

0

4 ( 5.19%)

4 ( 5.19%)

1 ( 1.30%)

2 ( 2.63%)

5 ( 6.58%)

0

   APPLICATION SITE ERYTHEMA

3 ( 4.62%)

0

0

4 ( 5.19%)

6 ( 7.79%)

2 ( 2.60%)

9 (11.84%)

6 ( 7.89%)

0

   APPLICATION SITE IRRITATION

1 ( 1.54%)

2 ( 3.08%)

0

3 ( 3.90%)

3 ( 3.90%)

3 ( 3.90%)

3 ( 3.95%)

6 ( 7.89%)

0

   APPLICATION SITE PRURITUS

5 ( 7.69%)

1 ( 1.54%)

0

13 (16.88%)

8 (10.39%)

1 ( 1.30%)

10 (13.16%)

12 (15.79%)

0

   APPLICATION SITE VESICLES

1 ( 1.54%)

0

0

3 ( 3.90%)

1 ( 1.30%)

0

2 ( 2.63%)

4 ( 5.26%)

0

   FATIGUE

1 ( 1.54%)

0

0

3 ( 3.90%)

2 ( 2.60%)

0

5 ( 6.58%)

0

0

INFECTIONS AND INFESTATIONS

11 (18.33%)

5 ( 8.33%)

0

6 ( 7.79%)

2 ( 2.60%)

1 ( 1.30%)

10 (13.33%)

3 ( 4.00%)

0

   NASOPHARYNGITIS

1 ( 1.54%)

1 ( 1.54%)

0

3 ( 3.90%)

0

1 ( 1.30%)

5 ( 6.58%)

1 ( 1.32%)

0

   UPPER RESPIRATORY TRACT INFECTION

4 ( 6.15%)

2 ( 3.08%)

0

1 ( 1.30%)

0

0

2 ( 2.63%)

1 ( 1.32%)

0

INVESTIGATIONS

8 (13.33%)

2 ( 3.33%)

0

6 ( 7.79%)

0

0

4 ( 5.33%)

2 ( 2.67%)

0

   ELECTROCARDIOGRAM ST SEGMENT DEPRESSION

4 ( 6.15%)

0

0

1 ( 1.30%)

0

0

0

0

0

NERVOUS SYSTEM DISORDERS

6 (10.00%)

2 ( 3.33%)

0

10 (12.99%)

7 ( 9.09%)

3 ( 3.90%)

13 (17.33%)

8 (10.67%)

4 ( 5.33%)

   DIZZINESS

2 ( 3.08%)

0

0

5 ( 6.49%)

3 ( 3.90%)

0

7 ( 9.21%)

3 ( 3.95%)

1 ( 1.32%)

   HEADACHE

3 ( 4.62%)

0

0

2 ( 2.60%)

0

1 ( 1.30%)

4 ( 5.26%)

1 ( 1.32%)

0

PSYCHIATRIC DISORDERS

7 (11.67%)

2 ( 3.33%)

1 ( 1.67%)

3 ( 3.90%)

6 ( 7.79%)

1 ( 1.30%)

4 ( 5.33%)

4 ( 5.33%)

0

   ANXIETY

0

0

0

3 ( 3.90%)

0

0

0

0

0

   CONFUSIONAL STATE

1 ( 1.54%)

1 ( 1.54%)

0

0

3 ( 3.90%)

0

1 ( 1.32%)

0

0

RESPIRATORY, THORACIC AND MEDIASTINAL DISORDERS

7 (11.67%)

1 ( 1.67%)

0

6 ( 7.79%)

3 ( 3.90%)

0

8 (10.67%)

2 ( 2.67%)

0

   COUGH

1 ( 1.54%)

0

0

3 ( 3.90%)

2 ( 2.60%)

0

3 ( 3.95%)

2 ( 2.63%)

0

   NASAL CONGESTION

3 ( 4.62%)

0

0

1 ( 1.30%)

0

0

3 ( 3.95%)

0

0

SKIN AND SUBCUTANEOUS TISSUE DISORDERS

12 (20.00%)

8 (13.33%)

0

12 (15.58%)

23 (29.87%)

4 ( 5.19%)

24 (32.00%)

15 (20.00%)

1 ( 1.33%)

   BLISTER

0

0

0

1 ( 1.30%)

3 ( 3.90%)

1 ( 1.30%)

1 ( 1.32%)

0

0

   ERYTHEMA

4 ( 6.15%)

4 ( 6.15%)

0

6 ( 7.79%)

8 (10.39%)

0

10 (13.16%)

4 ( 5.26%)

0

   HYPERHIDROSIS

2 ( 3.08%)

0

0

1 ( 1.30%)

3 ( 3.90%)

0

8 (10.53%)

0

0

   PRURITUS

7 (10.77%)

1 ( 1.54%)

0

9 (11.69%)

11 (14.29%)

1 ( 1.30%)

17 (22.37%)

9 (11.84%)

0

   RASH

2 ( 3.08%)

3 ( 4.62%)

0

9 (11.69%)

3 ( 3.90%)

1 ( 1.30%)

5 ( 6.58%)

3 ( 3.95%)

1 ( 1.32%)

   SKIN IRRITATION

2 ( 3.08%)

1 ( 1.54%)

0

2 ( 2.60%)

3 ( 3.90%)

1 ( 1.30%)

3 ( 3.95%)

2 ( 2.63%)

0

Total preferred term events

67

20

2

93

66

13

123

68

3

## ADPR Example: if (FALSE) { # \dontrun{ pr_entry <- adsl |> adsl_merge( adsl_subset = "SAFFL == 'Y'", dataset_add = adpr ) |> mentry( subset = NA, byvar = "PRSOC", trtvar = "TRT01A", trtsort = "TRT01AN", trttotalyn = "N", add_grpmiss = "N", sgtotalyn = "N", pop_fil = "Overall Population" ) output <- occ_tier_summary( pr_entry, a_subset = "ONPERFL == 'Y' & PRDECOD != ''", summary_by = "Patients", hterm = "PRSOC", lterm = "PRDECOD", pctdisp = "TRT", apply_hrow_cutoff = "N", sort_opt = "Ascending", sort_var = "Count", sum_row = "Y", sum_row_label = "Participants with 1 term", htermctyn = "N" ) output |> display_bign_head( mentry_data = pr_entry ) |> tbl_processor() |> tbl_display() } # }