Parameter
Analysis Visit A: Drug X B: Placebo C: Combination
Category (N=134) (N=134) (N=132)
——————————————————————————————————————————————————————————————————————
QT Duration
BASELINE
Value at Visit
n 134 134 132
<=450 msec 115 (85.8%) 117 (87.3%) 104 (78.8%)
>450 to <=480 msec 6 (4.5%) 10 (7.5%) 9 (6.8%)
>480 to <= 500 msec 4 (3%) 3 (2.2%) 6 (4.5%)
>500 msec 9 (6.7%) 4 (3%) 13 (9.8%)
WEEK 1 DAY 8
Value at Visit
n 134 134 132
<=450 msec 113 (84.3%) 106 (79.1%) 106 (80.3%)
>450 to <=480 msec 10 (7.5%) 10 (7.5%) 11 (8.3%)
>480 to <= 500 msec 4 (3%) 4 (3%) 3 (2.3%)
>500 msec 7 (5.2%) 14 (10.4%) 12 (9.1%)
Change from Baseline
n 134 134 132
<=30 msec 76 (56.7%) 75 (56%) 75 (56.8%)
>30 to <=60 msec 7 (5.2%) 13 (9.7%) 11 (8.3%)
>60 msec 51 (38.1%) 46 (34.3%) 46 (34.8%)
WEEK 2 DAY 15
Value at Visit
n 134 134 132
<=450 msec 111 (82.8%) 114 (85.1%) 112 (84.8%)
>450 to <=480 msec 10 (7.5%) 9 (6.7%) 9 (6.8%)
>480 to <= 500 msec 7 (5.2%) 2 (1.5%) 5 (3.8%)
>500 msec 6 (4.5%) 9 (6.7%) 6 (4.5%)
Change from Baseline
n 134 134 132
<=30 msec 71 (53%) 87 (64.9%) 89 (67.4%)
>30 to <=60 msec 11 (8.2%) 9 (6.7%) 9 (6.8%)
>60 msec 52 (38.8%) 38 (28.4%) 34 (25.8%)
WEEK 3 DAY 22
Value at Visit
n 134 134 132
<=450 msec 106 (79.1%) 112 (83.6%) 118 (89.4%)
>450 to <=480 msec 13 (9.7%) 7 (5.2%) 3 (2.3%)
>480 to <= 500 msec 4 (3%) 5 (3.7%) 2 (1.5%)
>500 msec 11 (8.2%) 10 (7.5%) 9 (6.8%)
Change from Baseline
n 134 134 132
<=30 msec 63 (47%) 80 (59.7%) 81 (61.4%)
>30 to <=60 msec 14 (10.4%) 8 (6%) 11 (8.3%)
>60 msec 57 (42.5%) 46 (34.3%) 40 (30.3%)
WEEK 4 DAY 29
Value at Visit
n 134 134 132
<=450 msec 117 (87.3%) 103 (76.9%) 114 (86.4%)
>450 to <=480 msec 7 (5.2%) 14 (10.4%) 6 (4.5%)
>480 to <= 500 msec 4 (3%) 7 (5.2%) 3 (2.3%)
>500 msec 6 (4.5%) 10 (7.5%) 9 (6.8%)
Change from Baseline
n 134 134 132
<=30 msec 79 (59%) 80 (59.7%) 79 (59.8%)
>30 to <=60 msec 11 (8.2%) 7 (5.2%) 10 (7.6%)
>60 msec 44 (32.8%) 47 (35.1%) 43 (32.6%)
WEEK 5 DAY 36
Value at Visit
n 134 134 132
<=450 msec 107 (79.9%) 117 (87.3%) 112 (84.8%)
>450 to <=480 msec 16 (11.9%) 5 (3.7%) 13 (9.8%)
>480 to <= 500 msec 5 (3.7%) 9 (6.7%) 3 (2.3%)
>500 msec 6 (4.5%) 3 (2.2%) 4 (3%)
Change from Baseline
n 134 134 132
<=30 msec 72 (53.7%) 82 (61.2%) 73 (55.3%)
>30 to <=60 msec 10 (7.5%) 11 (8.2%) 11 (8.3%)
>60 msec 52 (38.8%) 41 (30.6%) 48 (36.4%)
Experimental use!
WebR is a tool allowing you to run R code in the web browser. Modify the code below and click run to see the results. Alternatively, copy the code and click here to open WebR in a new tab.
Code
library(tern)library(dplyr)adsl <- random.cdisc.data::cadsladeg <- random.cdisc.data::cadeg# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels.adsl <-df_explicit_na(adsl)adeg <-df_explicit_na(adeg)adeg_labels <-var_labels(adeg)adeg_f <- adeg %>%filter( PARAMCD =="QT", ANL01FL =="Y" ) %>%mutate(AVALCAT1 =case_when( AVAL <=450~"<=450 msec", AVAL <=480~">450 to <=480 msec", AVAL <=500~">480 to <= 500 msec", AVAL >500~">500 msec",is.na(AVAL) ~"<Missing>" ),CHGCAT1 =case_when( CHG <=30~"<=30 msec", CHG <=60~">30 to <=60 msec", CHG >60~">60 msec",is.na(CHG) ~"<Missing>" ) ) %>%mutate(AVALCAT1 =factor( AVALCAT1,levels =c("<=450 msec",">450 to <=480 msec",">480 to <= 500 msec",">500 msec","<Missing>" ) ),CHGCAT1 =factor( CHGCAT1,levels =c("<=30 msec",">30 to <=60 msec",">60 msec","<Missing>" ) ) ) %>%var_relabel(AVALCAT1 ="Value at Visit",CHGCAT1 ="Change from Baseline" )
library(teal.modules.clinical)## Data reproducible codedata <-teal_data()data <-within(data, {library(dplyr) ADSL <- random.cdisc.data::cadsl ADEG <- random.cdisc.data::cadeg# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <-df_explicit_na(ADSL) ADEG <-df_explicit_na(ADEG) adeg_labels <-col_labels(ADEG) ADEG <- ADEG %>%filter( ANL01FL =="Y"# no need to filter for PARAMCD here ) %>%mutate(AVALCAT1 =case_when( AVAL <=450~"<=450 msec", AVAL <=480~">450 to <=480 msec", AVAL <=500~">480 to <= 500 msec", AVAL >500~">500 msec",is.na(AVAL) ~"<Missing>" ),CHGCAT1 =case_when( CHG <=30~"<=30 msec", CHG <=60~">30 to <=60 msec", CHG >60~">60 msec",is.na(CHG) ~"<Missing>" ) ) %>%mutate(AVALCAT1 =factor( AVALCAT1,levels =c("<=450 msec",">450 to <=480 msec",">480 to <= 500 msec",">500 msec","<Missing>" ) ),CHGCAT1 =factor( CHGCAT1,levels =c("<=30 msec",">30 to <=60 msec",">60 msec","<Missing>" ) ) )col_labels(ADEG) <-c( adeg_labels,"AVALCAT1"="Value at Visit","CHGCAT1"="Change from Baseline" )})datanames <-c("ADSL", "ADEG")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADSL <- data[["ADSL"]]ADEG <- data[["ADEG"]]## Setup Appapp <-init(data = data,modules =modules(tm_t_summary_by(label ="ECG Actual Values and Changes from Baseline by Visit",dataname ="ADEG",arm_var =choices_selected(choices =variable_choices(ADSL, c("ARM", "ARMCD")),selected ="ARM" ),by_vars =choices_selected(choices =variable_choices(ADEG, c("PARAM", "AVISIT")),selected =c("AVISIT") ),summarize_vars =choices_selected(choices =variable_choices(ADEG, c("AVALCAT1", "CHGCAT1")),selected =c("AVALCAT1", "CHGCAT1") ),useNA ="ifany",paramcd =choices_selected(choices =value_choices(ADEG, "PARAMCD", "PARAM"),selected ="QT" ) ) ))shinyApp(app$ui, app$server)
Experimental use!
shinylive allow you to modify to run shiny application entirely in the web browser. Modify the code below and click re-run the app to see the results. The performance is slighly worse and some of the features (e.g. downloading) might not work at all.
#| standalone: true#| viewerHeight: 800#| editorHeight: 200#| components: [viewer, editor]#| layout: vertical# -- WEBR HELPERS --options(webr_pkg_repos = c("r-universe" = "https://pharmaverse.r-universe.dev", getOption("webr_pkg_repos")))# -- APP CODE --library(teal.modules.clinical)## Data reproducible codedata <- teal_data()data <- within(data, { library(dplyr) ADSL <- random.cdisc.data::cadsl ADEG <- random.cdisc.data::cadeg # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) ADEG <- df_explicit_na(ADEG) adeg_labels <- col_labels(ADEG) ADEG <- ADEG %>% filter( ANL01FL == "Y" # no need to filter for PARAMCD here ) %>% mutate( AVALCAT1 = case_when( AVAL <= 450 ~ "<=450 msec", AVAL <= 480 ~ ">450 to <=480 msec", AVAL <= 500 ~ ">480 to <= 500 msec", AVAL > 500 ~ ">500 msec", is.na(AVAL) ~ "<Missing>" ), CHGCAT1 = case_when( CHG <= 30 ~ "<=30 msec", CHG <= 60 ~ ">30 to <=60 msec", CHG > 60 ~ ">60 msec", is.na(CHG) ~ "<Missing>" ) ) %>% mutate( AVALCAT1 = factor( AVALCAT1, levels = c( "<=450 msec", ">450 to <=480 msec", ">480 to <= 500 msec", ">500 msec", "<Missing>" ) ), CHGCAT1 = factor( CHGCAT1, levels = c( "<=30 msec", ">30 to <=60 msec", ">60 msec", "<Missing>" ) ) ) col_labels(ADEG) <- c( adeg_labels, "AVALCAT1" = "Value at Visit", "CHGCAT1" = "Change from Baseline" )})datanames <- c("ADSL", "ADEG")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADSL <- data[["ADSL"]]ADEG <- data[["ADEG"]]## Setup Appapp <- init( data = data, modules = modules( tm_t_summary_by( label = "ECG Actual Values and Changes from Baseline by Visit", dataname = "ADEG", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD")), selected = "ARM" ), by_vars = choices_selected( choices = variable_choices(ADEG, c("PARAM", "AVISIT")), selected = c("AVISIT") ), summarize_vars = choices_selected( choices = variable_choices(ADEG, c("AVALCAT1", "CHGCAT1")), selected = c("AVALCAT1", "CHGCAT1") ), useNA = "ifany", paramcd = choices_selected( choices = value_choices(ADEG, "PARAMCD", "PARAM"), selected = "QT" ) ) ))shinyApp(app$ui, app$server)