Skip to content

Weird row number in the interactive baseline characteristic table when drill down to AE subgroup #123

@LittleBeannie

Description

@LittleBeannie

The following code generates an interactive baseline characteristic table.

adsl <- r2rtf::r2rtf_adsl |> 
  filter(TRT01P %in% c("Placebo", "Xanomeline High Dose")) |>
  mutate(TRT01P = factor(TRT01P,
                         levels = c("Placebo", "Xanomeline High Dose"),
                         labels = c("Control", "Experimental")),
         TRT01A = factor(TRT01A,
                         levels = c("Placebo", "Xanomeline High Dose"),
                         labels = c("Control", "Experimental")),
         RACE = stringr::str_to_sentence(RACE))

adae <- forestly_adae |> 
  filter(TRTA %in% c("Placebo", "Xanomeline High Dose")) |>
  rename(TRT01A = TRTA) |>
  mutate(TRT01A = factor(TRT01A,
                         levels = c("Placebo", "Xanomeline High Dose"),
                         labels = c("Control", "Experimental"))) |>
  left_join(adsl |> select(USUBJID, SUBJID, TRT01P, EFFFL))

meta_base_char <- meta_adam(population = adsl,
                            observation = adsl) |>
  define_plan(plan = plan(analysis = "base_char", 
                          population = "itt",
                          observation = "itt", 
                          parameter = "age;gender;race")) |>
  define_population(name = "itt",
                    group = "TRT01P",
                    subset = EFFFL == "Y",
                    var = c("USUBJID", "TRT01P", "EFFFL", "AGEGR1", "SEX", "RACE"),
                    label = "ITT population") |>
  define_observation(name = "itt",
                     group = "TRT01P",
                     subset = EFFFL == "Y",
                     var = c("USUBJID", "TRT01P", "EFFFL", "AGEGR1", "SEX", "RACE"),
                     label = "ITT") |>
  define_parameter(name = "age",
                   var = "AGE",
                   label = "Age (years)",
                   vargroup = "AGEGR1") |>
  define_parameter(name = "gender",
                   var = "SEX",
                   label = "Gender") |>
  define_parameter(name = "race",
                   var = "RACE",
                   label = "Race") |>
  define_analysis(name = "base_char",
                  title = "Participant Baseline Characteristics by Treatment Group",
                  label = "baseline characteristic table") |>
  meta_build()

meta_base_char_subgrp_ae <- meta_adam(population = adsl,
                                      observation = adae) |>
  define_plan(plan = plan(analysis = "ae_specific", 
                          population = "itt",
                          observation = "itt", 
                          parameter = "serious")) |>
  define_population(name = "itt",
                    group = "TRT01P",
                    subset = EFFFL == "Y",
                    label = "ITT") |>
  define_observation(name = "itt",
                     group = "TRT01P",
                     subset = EFFFL == "Y",
                     label = "ITT") |>
  define_parameter(name = "serious",
                   subset = AESER == "Y",
                   label = "Serious AEs",
                   var = "AEDECOD", soc = "AEBODSYS",
                   term1 = "Serious", term2 = "")|>
  define_analysis(name = "ae_specific",
                  title = "AE specific analysis") |>
  meta_build()

react_base_char(metadata_sl = meta_base_char,
                metadata_ae = meta_base_char_subgrp_ae,
                population = "itt",
                observation = "itt",
                sl_parameter = "age;gender;race",
                ae_subgroup = c("age", "gender"),
                ae_specific = "serious",
                width = 1200,
                display_total = TRUE)

When I drill down to subgroup AE, the row index seems werid...

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions