A: Drug X B: Placebo C: Combination All Patients
Analysis Visit (N=134) (N=134) (N=132) (N=400)
——————————————————————————————————————————————————————————————————————————
BASELINE
n 134 134 132 400
Mean (SD) 17.7 (9.9) 18.7 (9.8) 19.5 (9.1) 18.6 (9.6)
Median 17.5 18.2 19.0 18.0
Min - Max 0.0 - 44.1 1.5 - 54.4 0.6 - 39.8 0.0 - 54.4
WEEK 1 DAY 8
n 134 134 132 400
Mean (SD) 16.8 (9.1) 18.9 (9.2) 19.6 (9.3) 18.4 (9.2)
Median 16.0 18.2 19.0 18.0
Min - Max 0.1 - 36.3 0.7 - 39.9 0.9 - 44.7 0.1 - 44.7
WEEK 2 DAY 15
n 134 134 132 400
Mean (SD) 17.8 (9.6) 18.8 (9.7) 16.5 (8.2) 17.7 (9.2)
Median 15.9 18.0 17.0 17.0
Min - Max 0.4 - 44.3 0.2 - 44.3 0.3 - 34.7 0.2 - 44.3
WEEK 3 DAY 22
n 134 134 132 400
Mean (SD) 18.4 (9.3) 17.6 (9.6) 16.8 (9.5) 17.6 (9.5)
Median 18.1 17.7 15.1 17.2
Min - Max 0.6 - 41.7 0.0 - 38.6 0.5 - 39.2 0.0 - 41.7
WEEK 4 DAY 29
n 134 134 132 400
Mean (SD) 19.2 (11.0) 17.2 (10.6) 17.9 (9.3) 18.1 (10.3)
Median 17.4 15.9 17.7 17.3
Min - Max 0.9 - 54.2 0.4 - 48.0 0.2 - 41.3 0.2 - 54.2
WEEK 5 DAY 36
n 134 134 132 400
Mean (SD) 19.2 (9.5) 18.0 (9.9) 18.5 (9.4) 18.6 (9.6)
Median 19.8 18.3 19.3 19.0
Min - Max 0.0 - 43.4 0.1 - 40.6 0.0 - 37.5 0.0 - 43.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
# Preparation of an illustrative datasetlibrary(tern)adsl <- random.cdisc.data::cadsladlb <- random.cdisc.data::cadlbadlb_labels <-var_labels(adlb)# For illustration purposes, the example focuses on ALT# Measurements starting from baseline and excluding all screening visitsadlb <-subset(adlb, AVISIT !="SCREENING"& PARAMCD =="ALT")adlb$AVISIT <-droplevels(adlb$AVISIT)var_labels(adlb) <- adlb_labels# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels.adsl <-df_explicit_na(adsl)adlb <-df_explicit_na(adlb)
library(teal.modules.clinical)## Data reproducible codedata <-teal_data()data <-within(data, { ADSL <- random.cdisc.data::cadsl ADLB <- random.cdisc.data::cadlb# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <-df_explicit_na(ADSL) ADLB <-df_explicit_na(ADLB)})datanames <-c("ADSL", "ADLB")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADSL <- data[["ADSL"]]ADLB <- data[["ADLB"]]## Setup Appapp <-init(data = data,modules =modules(tm_t_summary_by(label ="Laboratory Test Results by Visit",dataname ="ADLB",arm_var =choices_selected(choices =variable_choices(ADSL, c("ARM", "ARMCD")),selected ="ARM" ),by_vars =choices_selected(# note: order matters here. If `PARAM` is first, the split will be first by `PARAM`and then by `AVISIT`choices =variable_choices(ADLB, c("PARAM", "AVISIT")),selected =c("PARAM", "AVISIT") ),summarize_vars =choices_selected(choices =variable_choices(ADLB, c("AVAL")),selected =c("AVAL") ),useNA ="ifany",paramcd =choices_selected(choices =value_choices(ADLB, "PARAMCD", "PARAM"),selected ="ALT" ) ) ),filter =teal_slices(teal_slice("ADLB", "AVAL", selected =NULL)))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, { ADSL <- random.cdisc.data::cadsl ADLB <- random.cdisc.data::cadlb # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) ADLB <- df_explicit_na(ADLB)})datanames <- c("ADSL", "ADLB")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADSL <- data[["ADSL"]]ADLB <- data[["ADLB"]]## Setup Appapp <- init( data = data, modules = modules( tm_t_summary_by( label = "Laboratory Test Results by Visit", dataname = "ADLB", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD")), selected = "ARM" ), by_vars = choices_selected( # note: order matters here. If `PARAM` is first, the split will be first by `PARAM`and then by `AVISIT` choices = variable_choices(ADLB, c("PARAM", "AVISIT")), selected = c("PARAM", "AVISIT") ), summarize_vars = choices_selected( choices = variable_choices(ADLB, c("AVAL")), selected = c("AVAL") ), useNA = "ifany", paramcd = choices_selected( choices = value_choices(ADLB, "PARAMCD", "PARAM"), selected = "ALT" ) ) ), filter = teal_slices(teal_slice("ADLB", "AVAL", selected = NULL)))shinyApp(app$ui, app$server)