TL Catalog
  1. Tables
  2. Pharmacokinetics
  3. TPK01A
  • 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. Pharmacokinetics
  3. TPK01A

TPK01A

Matrix Active Study Agent/Analyte Concentrations (units) Over Time


Output

  • Preview
Code
# Program Name:              tpk01a

# Prep environment:

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

# Define script level parameters:

tblid <- "TPK01a"
fileid <- tblid
titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map
popfl <- "PKFL"
trtvar <- "TRT01A"

# Flags indicating whether to include certain statistics in the table
add_geometric_mean <- TRUE
add_cv <- TRUE
add_interquartile_range <- TRUE

# Process data:

adsl <- pharmaverseadamjnj::adsl |>
  filter(.data[[popfl]] == "Y") |>
  select(USUBJID, all_of(trtvar), PKFL) |>
  
  # Drop the control group
  filter(.data[[trtvar]] != "Placebo") |>
  mutate({{ trtvar }} := fct_drop(.data[[trtvar]])) |>
  
  mutate(colspan_trt = "Active Study Agent")

adpc <- pharmaverseadamjnj::adpc |>
  filter(PARAMCD == "XAN") |>
  select(USUBJID, all_of(trtvar), AVISIT, ATPT, AVAL) |>
  inner_join(adsl) |>
  
  # Concatenate and reorder time points
  mutate(AVISIT_ATPT = factor(paste(AVISIT, ATPT, sep = " - "), levels = c(
    "Day 1 - Pre-dose",
    "Day 1 - 5 Min Post-dose",
    "Day 1 - 30 Min Post-dose",
    "Day 1 - 1h Post-dose",
    "Day 1 - 1.5h Post-dose",
    "Day 1 - 2h Post-dose",
    "Day 1 - 4h Post-dose",
    "Day 1 - 0-6h Post-dose",
    "Day 1 - 6h Post-dose",
    "Day 1 - 8h Post-dose",
    "Day 1 - 6-12h Post-dose",
    "Day 1 - 12h Post-dose",
    "Day 1 - 16h Post-dose",
    "Day 1 - 12-24h Post-dose",
    "Day 2 - 24h Post-dose",
    "Day 2 - Pre-dose",
    "Day 2 - 36h Post-dose",
    "Day 2 - 24-48h Post-dose",
    "Day 3 - 48h Post-dose", 
    "Day 3 - Pre-dose"
  )))

# Define layout and build table:

lyt <- basic_table() |>
  split_cols_by(
    var = "colspan_trt",
    split_fun = drop_split_levels
  ) |>
  
  split_cols_by(
    var = trtvar,
    show_colcounts = TRUE,
    colcount_format = "N=xx",
    split_fun = add_overall_level("Combined", first = FALSE)
  ) |>
  
  split_rows_by(
    var = "AVISIT_ATPT",
    split_label = "Time Point",
    label_pos = "topleft",
    section_div = " "
  ) |>
  
  analyze(
    vars = "AVAL",
    afun = a_summary,
    extra_args = list(
      .stats = c(
        "n",
        "mean_sd",
        "median",
        if (add_geometric_mean) "geom_mean" else NULL, 
        "range",
        if (add_cv) "cv" else NULL,
        if (add_interquartile_range) "quantiles" else NULL
      ),
      .labels = c(
        n = "N",
        mean_sd = "Mean (SD)",
        median = "Median",
        geom_mean = "Geometric mean",
        range = "Min, max",
        cv = "CV (%)",
        quantiles = "Interquartile range"
      ),
      .formats = c(
        mean_sd = jjcsformat_xx("xx.xx (xx.xx)"),
        median = jjcsformat_xx("xx.xx"),
        geom_mean = jjcsformat_xx("xx.xx"),
        range = jjcsformat_xx("xx.xx, xx.xx"),
        cv = jjcsformat_xx("xx.x"),
        quantiles = jjcsformat_xx("xx.xx, xx.xx")
      ),
      .indent_mods = c(
        n = 0,
        mean_sd = 1,
        median = 1,
        geom_mean = 1,
        range = 1,
        cv = 1,
        quantiles = 1
      )
    )
  )

result <- build_table(lyt, df = adpc, alt_counts_df = adsl)

# 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, orientation = "portrait")

TPK01a: [Matrix] [Active Study Agent/Analyte] Concentrations ([units]) Over Time; Pharmacokinetics Analysis Set (Study jjcs - core)

Active Study Agent

Xanomeline High Dose

Xanomeline Low Dose

Combined

Time Point

N=72

N=96

N=168

Day 1 - Pre-dose

N

72

96

168

Mean (SD)

0.00 (0.00)

0.00 (0.00)

0.00 (0.00)

Median

0.00

0.00

0.00

Geometric mean

NA

NA

NA

Min, max

0.00, 0.00

0.00, 0.00

0.00, 0.00

CV (%)

NA

NA

NA

Interquartile range

0.00, 0.00

0.00, 0.00

0.00, 0.00

Day 1 - 5 Min Post-dose

N

72

96

168

Mean (SD)

0.10 (0.00)

0.10 (0.01)

0.10 (0.01)

Median

0.10

0.10

0.10

Geometric mean

0.10

0.10

0.10

Min, max

0.09, 0.11

0.09, 0.11

0.09, 0.11

CV (%)

4.9

5.3

5.1

Interquartile range

0.10, 0.10

0.10, 0.10

0.10, 0.10

Day 1 - 30 Min Post-dose

N

72

96

168

Mean (SD)

0.54 (0.02)

0.55 (0.03)

0.55 (0.03)

Median

0.54

0.54

0.54

Geometric mean

0.54

0.55

0.54

Min, max

0.50, 0.60

0.50, 0.60

0.50, 0.60

CV (%)

4.4

4.8

4.6

Interquartile range

0.52, 0.56

0.53, 0.57

0.52, 0.56

Day 1 - 1h Post-dose

N

72

96

168

Mean (SD)

0.93 (0.04)

0.93 (0.04)

0.93 (0.04)

Median

0.93

0.93

0.93

Geometric mean

0.93

0.93

0.93

Min, max

0.86, 1.02

0.85, 1.01

0.85, 1.02

CV (%)

4.0

4.4

4.2

Interquartile range

0.90, 0.95

0.90, 0.96

0.90, 0.96

Day 1 - 1.5h Post-dose

N

72

96

168

Mean (SD)

1.20 (0.04)

1.20 (0.05)

1.20 (0.05)

Median

1.20

1.20

1.20

Geometric mean

1.20

1.20

1.20

Min, max

1.12, 1.31

1.11, 1.29

1.11, 1.31

CV (%)

3.7

4.0

3.9

Interquartile range

1.17, 1.22

1.16, 1.24

1.17, 1.23

Day 1 - 2h Post-dose

N

72

96

168

Mean (SD)

1.39 (0.05)

1.39 (0.05)

1.39 (0.05)

Median

1.38

1.39

1.39

Geometric mean

1.39

1.39

1.39

Min, max

1.31, 1.50

1.29, 1.49

1.29, 1.50

CV (%)

3.4

3.7

3.6

Interquartile range

1.36, 1.41

1.35, 1.43

1.35, 1.43

Day 1 - 4h Post-dose

N

72

96

168

Mean (SD)

1.73 (0.05)

1.74 (0.05)

1.74 (0.05)

Median

1.73

1.74

1.73

Geometric mean

1.73

1.74

1.73

Min, max

1.65, 1.84

1.64, 1.83

1.64, 1.84

CV (%)

3.0

3.2

3.1

Interquartile range

1.69, 1.78

1.69, 1.79

1.69, 1.78

Day 1 - 0-6h Post-dose

N

72

96

168

Mean (SD)

26.85 (1.51)

26.72 (1.44)

26.78 (1.47)

Median

26.80

26.63

26.67

Geometric mean

26.81

26.68

26.74

Min, max

24.49, 29.19

24.53, 29.25

24.49, 29.25

CV (%)

5.6

5.4

5.5

Interquartile range

25.46, 28.28

25.56, 28.01

25.52, 28.17

Day 1 - 6h Post-dose

N

72

96

168

Mean (SD)

1.82 (0.05)

1.82 (0.05)

1.82 (0.05)

Median

1.82

1.82

1.82

Geometric mean

1.82

1.82

1.82

Min, max

1.74, 1.92

1.73, 1.91

1.73, 1.92

CV (%)

3.0

3.0

3.0

Interquartile range

1.77, 1.87

1.77, 1.88

1.77, 1.87

Day 1 - 8h Post-dose

N

72

96

168

Mean (SD)

1.84 (0.05)

1.84 (0.05)

1.84 (0.05)

Median

1.84

1.84

1.84

Geometric mean

1.84

1.84

1.84

Min, max

1.76, 1.94

1.75, 1.94

1.75, 1.94

CV (%)

3.0

3.0

3.0

Interquartile range

1.79, 1.90

1.79, 1.90

1.79, 1.90

Day 1 - 6-12h Post-dose

N

72

96

168

Mean (SD)

22.67 (1.69)

22.52 (1.61)

22.58 (1.64)

Median

22.62

22.43

22.47

Geometric mean

22.60

22.47

22.53

Min, max

20.01, 25.27

20.06, 25.34

20.01, 25.34

CV (%)

7.4

7.1

7.3

Interquartile range

21.11, 24.26

21.23, 23.97

21.18, 24.15

Day 1 - 12h Post-dose

N

72

96

168

Mean (SD)

0.55 (0.03)

0.55 (0.03)

0.55 (0.03)

Median

0.55

0.55

0.55

Geometric mean

0.55

0.55

0.55

Min, max

0.49, 0.62

0.49, 0.62

0.49, 0.62

CV (%)

6.2

5.4

5.7

Interquartile range

0.53, 0.58

0.53, 0.57

0.53, 0.57

Day 1 - 16h Post-dose

N

72

96

168

Mean (SD)

0.16 (0.02)

0.16 (0.02)

0.16 (0.02)

Median

0.17

0.16

0.16

Geometric mean

0.16

0.16

0.16

Min, max

0.13, 0.20

0.13, 0.20

0.13, 0.20

CV (%)

11.0

10.0

10.4

Interquartile range

0.15, 0.18

0.15, 0.18

0.15, 0.18

Day 1 - 12-24h Post-dose

N

72

96

168

Mean (SD)

14.30 (2.04)

14.13 (1.95)

14.20 (1.99)

Median

14.26

14.02

14.07

Geometric mean

14.15

13.99

14.06

Min, max

11.07, 17.44

11.13, 17.52

11.07, 17.52

CV (%)

14.3

13.8

14.0

Interquartile range

12.41, 16.24

12.56, 15.88

12.50, 16.10

Day 2 - 24h Post-dose

N

72

96

168

Mean (SD)

0.01 (0.00)

0.01 (0.00)

0.01 (0.00)

Median

0.01

0.01

0.01

Geometric mean

0.01

0.01

0.01

Min, max

0.01, 0.02

0.01, 0.02

0.01, 0.02

CV (%)

20.9

19.7

20.2

Interquartile range

0.01, 0.02

0.01, 0.02

0.01, 0.02

Day 2 - Pre-dose

N

72

94

166

Mean (SD)

0.01 (0.00)

0.01 (0.00)

0.01 (0.00)

Median

0.01

0.01

0.01

Geometric mean

0.01

0.01

0.01

Min, max

0.01, 0.02

0.01, 0.02

0.01, 0.02

CV (%)

20.9

19.7

20.2

Interquartile range

0.01, 0.02

0.01, 0.02

0.01, 0.02

Day 2 - 36h Post-dose

N

72

96

168

Mean (SD)

0.00 (0.00)

0.00 (0.00)

0.00 (0.00)

Median

0.00

0.00

0.00

Geometric mean

0.01

0.01

0.01

Min, max

0.00, 0.00

0.00, 0.00

0.00, 0.00

CV (%)

0.0

0.0

0.0

Interquartile range

0.00, 0.00

0.00, 0.00

0.00, 0.00

Day 2 - 24-48h Post-dose

N

72

96

168

Mean (SD)

0.28 (0.53)

0.22 (0.49)

0.25 (0.50)

Median

0.00

0.00

0.00

Geometric mean

0.02

0.01

0.02

Min, max

0.00, 1.78

0.00, 1.89

0.00, 1.89

CV (%)

191.0

217.2

204.4

Interquartile range

0.00, 0.18

0.00, 0.00

0.00, 0.00

Day 3 - 48h Post-dose

N

72

96

168

Mean (SD)

0.00 (0.00)

0.00 (0.00)

0.00 (0.00)

Median

0.00

0.00

0.00

Geometric mean

0.01

0.01

0.01

Min, max

0.00, 0.00

0.00, 0.00

0.00, 0.00

CV (%)

0.0

0.0

0.0

Interquartile range

0.00, 0.00

0.00, 0.00

0.00, 0.00

Day 3 - Pre-dose

N

72

92

164

Mean (SD)

0.00 (0.00)

0.00 (0.00)

0.00 (0.00)

Median

0.00

0.00

0.00

Geometric mean

0.01

0.01

0.01

Min, max

0.00, 0.00

0.00, 0.00

0.00, 0.00

CV (%)

0.0

0.0

0.0

Interquartile range

0.00, 0.00

0.00, 0.00

0.00, 0.00

Note: Incongruous samples are not included in this summary.

Note: Concentrations below the lowest quantifiable concentration (ie, [x.xx ng/mL]) will be treated as zero in calculating the summary statistics.

Download RTF file

TSIEX11
TPK01B
Source Code
---
title: TPK01A
subtitle: Matrix Active Study Agent/Analyte Concentrations (units) 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:              tpk01a

# Prep environment:

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

# Define script level parameters:

tblid <- "TPK01a"
fileid <- tblid
titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map
popfl <- "PKFL"
trtvar <- "TRT01A"

# Flags indicating whether to include certain statistics in the table
add_geometric_mean <- TRUE
add_cv <- TRUE
add_interquartile_range <- TRUE

# Process data:

adsl <- pharmaverseadamjnj::adsl |>
  filter(.data[[popfl]] == "Y") |>
  select(USUBJID, all_of(trtvar), PKFL) |>
  
  # Drop the control group
  filter(.data[[trtvar]] != "Placebo") |>
  mutate({{ trtvar }} := fct_drop(.data[[trtvar]])) |>
  
  mutate(colspan_trt = "Active Study Agent")

adpc <- pharmaverseadamjnj::adpc |>
  filter(PARAMCD == "XAN") |>
  select(USUBJID, all_of(trtvar), AVISIT, ATPT, AVAL) |>
  inner_join(adsl) |>
  
  # Concatenate and reorder time points
  mutate(AVISIT_ATPT = factor(paste(AVISIT, ATPT, sep = " - "), levels = c(
    "Day 1 - Pre-dose",
    "Day 1 - 5 Min Post-dose",
    "Day 1 - 30 Min Post-dose",
    "Day 1 - 1h Post-dose",
    "Day 1 - 1.5h Post-dose",
    "Day 1 - 2h Post-dose",
    "Day 1 - 4h Post-dose",
    "Day 1 - 0-6h Post-dose",
    "Day 1 - 6h Post-dose",
    "Day 1 - 8h Post-dose",
    "Day 1 - 6-12h Post-dose",
    "Day 1 - 12h Post-dose",
    "Day 1 - 16h Post-dose",
    "Day 1 - 12-24h Post-dose",
    "Day 2 - 24h Post-dose",
    "Day 2 - Pre-dose",
    "Day 2 - 36h Post-dose",
    "Day 2 - 24-48h Post-dose",
    "Day 3 - 48h Post-dose", 
    "Day 3 - Pre-dose"
  )))

# Define layout and build table:

lyt <- basic_table() |>
  split_cols_by(
    var = "colspan_trt",
    split_fun = drop_split_levels
  ) |>
  
  split_cols_by(
    var = trtvar,
    show_colcounts = TRUE,
    colcount_format = "N=xx",
    split_fun = add_overall_level("Combined", first = FALSE)
  ) |>
  
  split_rows_by(
    var = "AVISIT_ATPT",
    split_label = "Time Point",
    label_pos = "topleft",
    section_div = " "
  ) |>
  
  analyze(
    vars = "AVAL",
    afun = a_summary,
    extra_args = list(
      .stats = c(
        "n",
        "mean_sd",
        "median",
        if (add_geometric_mean) "geom_mean" else NULL, 
        "range",
        if (add_cv) "cv" else NULL,
        if (add_interquartile_range) "quantiles" else NULL
      ),
      .labels = c(
        n = "N",
        mean_sd = "Mean (SD)",
        median = "Median",
        geom_mean = "Geometric mean",
        range = "Min, max",
        cv = "CV (%)",
        quantiles = "Interquartile range"
      ),
      .formats = c(
        mean_sd = jjcsformat_xx("xx.xx (xx.xx)"),
        median = jjcsformat_xx("xx.xx"),
        geom_mean = jjcsformat_xx("xx.xx"),
        range = jjcsformat_xx("xx.xx, xx.xx"),
        cv = jjcsformat_xx("xx.x"),
        quantiles = jjcsformat_xx("xx.xx, xx.xx")
      ),
      .indent_mods = c(
        n = 0,
        mean_sd = 1,
        median = 1,
        geom_mean = 1,
        range = 1,
        cv = 1,
        quantiles = 1
      )
    )
  )

result <- build_table(lyt, df = adpc, alt_counts_df = adsl)

# 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, orientation = "portrait")
```
```{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