TL Catalog
  1. Tables
  2. Electrocardiograms
  3. TSFECG02
  • Introduction

  • Index

  • Tables
    • Adverse Events
      • TSFAE01A
      • TSFAE01B
      • TSFAE02
      • TSFAE02A
      • TSFAE03
      • TSFAE03A
      • TSFAE04
      • TSFAE04A
      • TSFAE05
      • TSFAE05A
      • TSFAE06A
      • TSFAE06B
      • TSFAE07A
      • TSFAE07B
      • TSFAE08
      • TSFAE09
      • TSFAE10
      • TSFAE11
      • TSFAE12
      • TSFAE13
      • TSFAE14
      • TSFAE15
      • TSFAE16
      • TSFAE17A
      • TSFAE17B
      • TSFAE17C
      • TSFAE17D
      • TSFAE19A
      • TSFAE19B
      • TSFAE19C
      • TSFAE19D
      • TSFAE20A
      • TSFAE20B
      • TSFAE20C
      • TSFAE21A
      • TSFAE21B
      • TSFAE21C
      • TSFAE21D
      • TSFAE22A
      • TSFAE22B
      • TSFAE22C
      • TSFAE23A
      • TSFAE23B
      • TSFAE23C
      • TSFAE23D
      • TSFAE24A
      • TSFAE24B
      • TSFAE24C
      • TSFAE24D
      • TSFAE24F
      • TSFDTH01
    • Clinical Laboratory Evaluation
      • TSFLAB01
      • TSFLAB01A
      • TSFLAB02
      • TSFLAB02A
      • TSFLAB02B
      • TSFLAB03
      • TSFLAB03A
      • TSFLAB04A
      • TSFLAB04B
      • TSFLAB05
      • TSFLAB06
      • TSFLAB07
    • Demographic
      • TSIDEM01
      • TSIDEM02
      • TSIMH01
    • Disposition of Subjects
      • TSIDS01
      • TSIDS02
      • TSIDS02A
    • Electrocardiograms
      • TSFECG01
      • TSFECG01A
      • TSFECG02
      • TSFECG03
      • TSFECG04
      • TSFECG05
    • Exposure
      • TSIEX01
      • TSIEX02
      • TSIEX03
      • TSIEX04
      • TSIEX06
      • TSIEX07
      • TSIEX08
      • TSIEX09
      • TSIEX10
      • TSIEX11
    • Pharmacokinetics
      • TPK01A
      • TPK01B
      • TPK02
      • TPK03
    • Prior and Concomitant Therapies
      • TSICM01
      • TSICM02
      • TSICM03
      • TSICM04
      • TSICM05
      • TSICM06
      • TSICM07
      • TSICM08
    • Vital Signs and Physical Findings
      • TSFVIT01
      • TSFVIT01A
      • TSFVIT02
      • TSFVIT03
      • TSFVIT04
      • TSFVIT05
      • TSFVIT06
  • Listings
    • Adverse Events
      • LSFAE01
      • LSFAE02
      • LSFAE03
      • LSFAE04
      • LSFAE05
      • LSFAE06A
      • LSFAE06B
      • LSFDTH01
    • Clinical Laboratory Evaluation
      • LSFLAB01
    • Demographic
      • LSIDEM01
      • LSIDEM02
      • LSIMH01
    • Disposition of Subjects
      • LSIDS01
      • LSIDS02
      • LSIDS03
      • LSIDS04
      • LSIDS05
    • Electrocardiograms
      • LSFECG01
      • LSFECG02
    • Exposure
      • LSIEX01
      • LSIEX02
      • LSIEX03
    • Prior and Concomitant Therapies
      • LSICM01
    • Vital Signs and Physical Findings
      • LSFVIT01
      • LSFVIT02

  • Reproducibility

  • Changelog

On this page

  • Output
  • Edit this page
  • Report an issue
  1. Tables
  2. Electrocardiograms
  3. TSFECG02

TSFECG02

Categorized Corrected QT Interval Values Over Time


Output

  • Preview
Code
# Program Name:              tsfecg02

# Prep Environment

library(envsetup)
library(tern)
library(dplyr)
library(rtables)
library(junco)

# Define script level parameters:

tblid <- "TSFECG02"
fileid <- tblid
titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map

popfl <- "SAFFL"
trtvar <- "TRT01A"
ctrl_grp <- "Placebo"

selparamcd <- c("QTC", "QTCBAG", "QTCFAG")
selvisit <- c(
  "Baseline",
  "Month 1",
  "Month 3",
  "Month 6",
  "Month 9",
  "Month 12"
)

# Process Data:

adsl <- pharmaverseadamjnj::adsl %>%
  filter(.data[[popfl]] == "Y") %>%
  select(
    USUBJID,
    all_of(c(popfl, trtvar)),
    SEX_DECODE,
    AGEGR1,
    RACE_DECODE,
    ETHNIC_DECODE
  )

adsl$colspan_trt <- factor(
  ifelse(adsl[[trtvar]] == ctrl_grp, " ", "Active Study Agent"),
  levels = c("Active Study Agent", " ")
)


filtered_adeg <- pharmaverseadamjnj::adeg %>%
  filter(PARAMCD %in% selparamcd) %>%
  filter(AVISIT %in% selvisit) %>%
  filter(ANL02FL == "Y") %>%
  filter(!is.na(AVALCAT1)) %>%
  select(
    STUDYID,
    USUBJID,
    PARAMCD,
    PARAM,
    AVALCAT1,
    AVALCA1N,
    AVISIT,
    ANL02FL,
    APOBLFL,
    ABLFL,
    ONTRTFL
  ) %>%
  inner_join(adsl)

## main analysis variable is AVALCAT1 : these have the same levels for all selected parameters
## no need to create an map dataframe for usage in layout

colspan_trt_map <- create_colspan_map(
  adsl,
  non_active_grp = ctrl_grp,
  non_active_grp_span_lbl = " ",
  active_grp_span_lbl = "Active Study Agent",
  colspan_var = "colspan_trt",
  trt_var = trtvar
)

ref_path <- c("colspan_trt", " ", trtvar, ctrl_grp)

# Define layout and build table:

extra_args_rr <- list(
  method = "wald",
  denom = "n_df",
  .stats = c("denom", "count_unique_fraction")
)
# extra_args_rr2 <- list(method = "wald", denom = "n_df", .stats = c("denom",  "count_unique_denom_fraction")) # version with explicit denominator (usefull for testing purpose)

lyt <- basic_table(
  show_colcounts = TRUE,
  colcount_format = "N=xx"
) %>%
  split_cols_by(
    "colspan_trt",
    split_fun = trim_levels_to_map(map = colspan_trt_map)
  ) %>%
  split_cols_by(trtvar) %>%
  split_rows_by(
    "PARAM",
    label_pos = "topleft",
    child_labels = "default",
    split_label = "QTc Interval",
    section_div = " ",
    ## ensure only selected params are included
    split_fun = drop_split_levels
  ) %>%
  split_rows_by(
    "AVISIT",
    label_pos = "topleft",
    child_labels = "default",
    split_label = "Study Visit",
    section_div = " ",
    ## ensure only the selected visits are included
    split_fun = drop_split_levels
  ) %>%
  analyze(
    "AVALCAT1",
    a_freq_j,
    extra_args = extra_args_rr,
    show_labels = "hidden",
    indent_mod = 0L
  ) %>%
  append_topleft(c("   Criteria, n (%)"))


result <- build_table(lyt, filtered_adeg, alt_counts_df = adsl)

# Post-Processing:

result <- remove_col_count(result)

# Add titles and footnotes:

result <- set_titles(result, titles)

# Convert to tbl file and output table

tt_to_tlgrtf(string_map = string_map, tt = result, file = fileid)

TSFECG02: Categorized Corrected QT Interval Values Over Time; Safety Analysis Set (Study jjcs - core)

QTc Interval

Active Study Agent

Study Visit

Xanomeline High Dose

Xanomeline Low Dose

Placebo

Criteria, n (%)

N=53

N=73

N=59

QT Interval, Corrected (msec)

Baseline

N

53

73

59

≤450

42 (79.2%)

54 (74.0%)

42 (71.2%)

>450 to ≤480

5 (9.4%)

10 (13.7%)

8 (13.6%)

>480 to ≤500

3 (5.7%)

3 (4.1%)

3 (5.1%)

>500

3 (5.7%)

6 (8.2%)

6 (10.2%)

Month 1

N

53

71

58

≤450

43 (81.1%)

50 (70.4%)

42 (72.4%)

>450 to ≤480

5 (9.4%)

2 (2.8%)

8 (13.8%)

>480 to ≤500

1 (1.9%)

7 (9.9%)

3 (5.2%)

>500

4 (7.5%)

12 (16.9%)

5 (8.6%)

Month 3

N

53

53

56

≤450

40 (75.5%)

37 (69.8%)

46 (82.1%)

>450 to ≤480

4 (7.5%)

6 (11.3%)

5 (8.9%)

>480 to ≤500

2 (3.8%)

3 (5.7%)

3 (5.4%)

>500

7 (13.2%)

7 (13.2%)

2 (3.6%)

Month 6

N

51

47

51

≤450

36 (70.6%)

35 (74.5%)

43 (84.3%)

>450 to ≤480

9 (17.6%)

3 (6.4%)

2 (3.9%)

>480 to ≤500

3 (5.9%)

3 (6.4%)

1 (2.0%)

>500

3 (5.9%)

6 (12.8%)

5 (9.8%)

Month 9

N

41

42

51

≤450

31 (75.6%)

32 (76.2%)

41 (80.4%)

>450 to ≤480

4 (9.8%)

4 (9.5%)

4 (7.8%)

>480 to ≤500

1 (2.4%)

2 (4.8%)

3 (5.9%)

>500

5 (12.2%)

4 (9.5%)

3 (5.9%)

Month 12

N

37

35

48

≤450

25 (67.6%)

26 (74.3%)

35 (72.9%)

>450 to ≤480

4 (10.8%)

4 (11.4%)

5 (10.4%)

>480 to ≤500

2 (5.4%)

1 (2.9%)

4 (8.3%)

>500

6 (16.2%)

4 (11.4%)

4 (8.3%)

QTcB Interval, Aggregate
 (msec)

Baseline

N

53

73

59

≤450

37 (69.8%)

58 (79.5%)

46 (78.0%)

>450 to ≤480

4 (7.5%)

8 (11.0%)

4 (6.8%)

>480 to ≤500

5 (9.4%)

3 (4.1%)

4 (6.8%)

>500

7 (13.2%)

4 (5.5%)

5 (8.5%)

Month 1

N

53

71

58

≤450

38 (71.7%)

60 (84.5%)

41 (70.7%)

>450 to ≤480

8 (15.1%)

3 (4.2%)

10 (17.2%)

>480 to ≤500

4 (7.5%)

5 (7.0%)

3 (5.2%)

>500

3 (5.7%)

3 (4.2%)

4 (6.9%)

Month 3

N

53

53

56

≤450

41 (77.4%)

38 (71.7%)

47 (83.9%)

>450 to ≤480

6 (11.3%)

4 (7.5%)

4 (7.1%)

>480 to ≤500

2 (3.8%)

6 (11.3%)

2 (3.6%)

>500

4 (7.5%)

5 (9.4%)

3 (5.4%)

Month 6

N

51

47

51

≤450

37 (72.5%)

40 (85.1%)

42 (82.4%)

>450 to ≤480

6 (11.8%)

2 (4.3%)

3 (5.9%)

>480 to ≤500

5 (9.8%)

3 (6.4%)

3 (5.9%)

>500

3 (5.9%)

2 (4.3%)

3 (5.9%)

Month 9

N

41

42

51

≤450

33 (80.5%)

33 (78.6%)

41 (80.4%)

>450 to ≤480

4 (9.8%)

5 (11.9%)

3 (5.9%)

>480 to ≤500

2 (4.9%)

1 (2.4%)

4 (7.8%)

>500

2 (4.9%)

3 (7.1%)

3 (5.9%)

Month 12

N

37

35

48

≤450

33 (89.2%)

29 (82.9%)

37 (77.1%)

>450 to ≤480

1 (2.7%)

3 (8.6%)

8 (16.7%)

>480 to ≤500

2 (5.4%)

2 (5.7%)

1 (2.1%)

>500

1 (2.7%)

1 (2.9%)

2 (4.2%)

QTcF Interval, Aggregate
 (msec)

Baseline

N

53

73

59

≤450

44 (83.0%)

59 (80.8%)

42 (71.2%)

>450 to ≤480

2 (3.8%)

6 (8.2%)

9 (15.3%)

>480 to ≤500

4 (7.5%)

2 (2.7%)

5 (8.5%)

>500

3 (5.7%)

6 (8.2%)

3 (5.1%)

Month 1

N

53

71

58

≤450

42 (79.2%)

57 (80.3%)

49 (84.5%)

>450 to ≤480

3 (5.7%)

8 (11.3%)

1 (1.7%)

>480 to ≤500

5 (9.4%)

2 (2.8%)

2 (3.4%)

>500

3 (5.7%)

4 (5.6%)

6 (10.3%)

Month 3

N

53

53

56

≤450

42 (79.2%)

40 (75.5%)

43 (76.8%)

>450 to ≤480

3 (5.7%)

4 (7.5%)

2 (3.6%)

>480 to ≤500

6 (11.3%)

4 (7.5%)

5 (8.9%)

>500

2 (3.8%)

5 (9.4%)

6 (10.7%)

Month 6

N

51

47

51

≤450

42 (82.4%)

37 (78.7%)

36 (70.6%)

>450 to ≤480

4 (7.8%)

2 (4.3%)

7 (13.7%)

>480 to ≤500

2 (3.9%)

1 (2.1%)

3 (5.9%)

>500

3 (5.9%)

7 (14.9%)

5 (9.8%)

Month 9

N

41

42

51

≤450

32 (78.0%)

36 (85.7%)

38 (74.5%)

>450 to ≤480

2 (4.9%)

1 (2.4%)

3 (5.9%)

>480 to ≤500

3 (7.3%)

3 (7.1%)

4 (7.8%)

>500

4 (9.8%)

2 (4.8%)

6 (11.8%)

Month 12

N

37

35

48

≤450

30 (81.1%)

27 (77.1%)

38 (79.2%)

>450 to ≤480

2 (5.4%)

4 (11.4%)

7 (14.6%)

>480 to ≤500

3 (8.1%)

0

2 (4.2%)

>500

2 (5.4%)

4 (11.4%)

1 (2.1%)

Note: N is the number of subjects with a non-missing value for the ECG parameter at the specified time point.

Download RTF file

TSFECG01A
TSFECG03
Source Code
---
title: TSFECG02
subtitle: Categorized Corrected QT Interval Values Over Time
---

------------------------------------------------------------------------

{{< include ../../_utils/envir_hook.qmd >}}

```{r setup, echo = FALSE, warning = FALSE, message = FALSE}
options(docx.add_datetime = FALSE, tidytlg.add_datetime = FALSE)
envsetup_config_name <- "default"

# Path to the combined config file
envsetup_file_path <- file.path("../..", "envsetup.yml")

Sys.setenv(ENVSETUP_ENVIRON = '')
library(envsetup)
loaded_config <- config::get(config = envsetup_config_name, file = envsetup_file_path)
envsetup::rprofile(loaded_config)


dpscomp <- compound
dpspdr <- paste(protocol,dbrelease,rpteff,sep="__")

aptcomp <- compound
aptpdr <- paste(protocol,dbrelease,rpteff,sep="__")

###### Study specific updates (formerly in envre)

dpscomp <- "standards"
dpspdr <- "jjcs__NULL__jjcs - core"

apt <- FALSE
library(junco)
default_str_map <- rbind(default_str_map, c("&ctcae", "5.0"))

```

## Output

:::: panel-tabset
## {{< fa regular file-lines sm fw >}} Preview

```{r variant1, results='hide', warning = FALSE, message = FALSE}

# Program Name:              tsfecg02

# Prep Environment

library(envsetup)
library(tern)
library(dplyr)
library(rtables)
library(junco)

# Define script level parameters:

tblid <- "TSFECG02"
fileid <- tblid
titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map

popfl <- "SAFFL"
trtvar <- "TRT01A"
ctrl_grp <- "Placebo"

selparamcd <- c("QTC", "QTCBAG", "QTCFAG")
selvisit <- c(
  "Baseline",
  "Month 1",
  "Month 3",
  "Month 6",
  "Month 9",
  "Month 12"
)

# Process Data:

adsl <- pharmaverseadamjnj::adsl %>%
  filter(.data[[popfl]] == "Y") %>%
  select(
    USUBJID,
    all_of(c(popfl, trtvar)),
    SEX_DECODE,
    AGEGR1,
    RACE_DECODE,
    ETHNIC_DECODE
  )

adsl$colspan_trt <- factor(
  ifelse(adsl[[trtvar]] == ctrl_grp, " ", "Active Study Agent"),
  levels = c("Active Study Agent", " ")
)


filtered_adeg <- pharmaverseadamjnj::adeg %>%
  filter(PARAMCD %in% selparamcd) %>%
  filter(AVISIT %in% selvisit) %>%
  filter(ANL02FL == "Y") %>%
  filter(!is.na(AVALCAT1)) %>%
  select(
    STUDYID,
    USUBJID,
    PARAMCD,
    PARAM,
    AVALCAT1,
    AVALCA1N,
    AVISIT,
    ANL02FL,
    APOBLFL,
    ABLFL,
    ONTRTFL
  ) %>%
  inner_join(adsl)

## main analysis variable is AVALCAT1 : these have the same levels for all selected parameters
## no need to create an map dataframe for usage in layout

colspan_trt_map <- create_colspan_map(
  adsl,
  non_active_grp = ctrl_grp,
  non_active_grp_span_lbl = " ",
  active_grp_span_lbl = "Active Study Agent",
  colspan_var = "colspan_trt",
  trt_var = trtvar
)

ref_path <- c("colspan_trt", " ", trtvar, ctrl_grp)

# Define layout and build table:

extra_args_rr <- list(
  method = "wald",
  denom = "n_df",
  .stats = c("denom", "count_unique_fraction")
)
# extra_args_rr2 <- list(method = "wald", denom = "n_df", .stats = c("denom",  "count_unique_denom_fraction")) # version with explicit denominator (usefull for testing purpose)

lyt <- basic_table(
  show_colcounts = TRUE,
  colcount_format = "N=xx"
) %>%
  split_cols_by(
    "colspan_trt",
    split_fun = trim_levels_to_map(map = colspan_trt_map)
  ) %>%
  split_cols_by(trtvar) %>%
  split_rows_by(
    "PARAM",
    label_pos = "topleft",
    child_labels = "default",
    split_label = "QTc Interval",
    section_div = " ",
    ## ensure only selected params are included
    split_fun = drop_split_levels
  ) %>%
  split_rows_by(
    "AVISIT",
    label_pos = "topleft",
    child_labels = "default",
    split_label = "Study Visit",
    section_div = " ",
    ## ensure only the selected visits are included
    split_fun = drop_split_levels
  ) %>%
  analyze(
    "AVALCAT1",
    a_freq_j,
    extra_args = extra_args_rr,
    show_labels = "hidden",
    indent_mod = 0L
  ) %>%
  append_topleft(c("   Criteria, n (%)"))


result <- build_table(lyt, filtered_adeg, alt_counts_df = adsl)

# Post-Processing:

result <- remove_col_count(result)

# Add titles and footnotes:

result <- set_titles(result, titles)

# Convert to tbl file and output table

tt_to_tlgrtf(string_map = string_map, tt = result, file = fileid)
```
```{r result1, echo=FALSE, message=FALSE, warning=FALSE, test = list(result_v1 = "result")}
tt_to_flextable_j(result, tblid, string_map = string_map) 
```

[Download RTF file](`r paste0(tolower(tblid), '.rtf')`)
::::

Made with ❤️ by the J&J Team

  • Edit this page
  • Report an issue
Cookie Preferences