A: Drug X B: Placebo C: Combination
Parameter Change from Change from Change from
Analysis Visit Value at Visit Baseline Value at Visit Baseline Value at Visit Baseline
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
BFI All Questions
BASELINE
n 134 134 132
Mean (SD) 49.93 (7.44) 49.74 (8.29) 50.30 (9.06)
Median 48.69 49.28 49.74
Min - Max 33.72 - 65.91 25.82 - 71.47 26.04 - 69.99
WEEK 1 DAY 8
n 134 134 134 134 132 132
Mean (SD) 54.51 (8.61) 4.58 (11.23) 56.33 (7.86) 6.59 (11.81) 54.03 (8.31) 3.72 (12.66)
Median 55.15 5.47 56.39 6.96 53.76 3.71
Min - Max 34.26 - 75.42 -25.52 - 29.68 36.82 - 74.45 -25.10 - 31.05 26.89 - 75.95 -26.81 - 33.75
WEEK 2 DAY 15
n 134 134 134 134 132 132
Mean (SD) 60.98 (10.31) 11.05 (12.46) 59.68 (9.59) 9.94 (12.84) 60.11 (8.76) 9.80 (12.59)
Median 60.60 10.45 58.18 8.95 61.08 10.04
Min - Max 35.94 - 96.53 -14.02 - 45.01 40.44 - 84.70 -17.59 - 40.52 32.76 - 78.25 -26.57 - 39.56
WEEK 3 DAY 22
n 134 134 134 134 132 132
Mean (SD) 64.64 (9.88) 14.72 (11.99) 65.78 (10.17) 16.04 (13.80) 63.65 (10.50) 13.35 (13.39)
Median 65.21 15.10 66.28 15.49 63.79 12.24
Min - Max 40.49 - 95.35 -16.76 - 43.40 42.16 - 92.32 -17.70 - 46.85 29.29 - 88.41 -22.40 - 39.94
WEEK 4 DAY 29
n 134 134 134 134 132 132
Mean (SD) 69.43 (11.12) 19.51 (13.83) 69.79 (11.46) 20.05 (14.38) 70.68 (10.23) 20.37 (12.99)
Median 69.22 19.90 70.37 20.99 70.85 20.94
Min - Max 38.38 - 95.48 -17.34 - 49.18 45.79 - 93.33 -19.66 - 58.05 30.53 - 90.61 -14.01 - 60.23
WEEK 5 DAY 36
n 134 134 134 134 132 132
Mean (SD) 74.31 (12.44) 24.38 (14.75) 74.73 (12.96) 24.99 (14.67) 75.89 (13.54) 25.59 (17.18)
Median 76.12 25.20 74.13 22.81 76.70 25.32
Min - Max 39.45 - 103.92 -7.53 - 56.23 38.19 - 109.61 -18.42 - 64.15 43.79 - 102.40 -16.11 - 67.78
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::cadsladqs <- random.cdisc.data::cadqs# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels.adsl <-df_explicit_na(adsl)adqs <-df_explicit_na(adqs)# This example focuses on "BFI All Questions" starting from baseline.adqs <- adqs %>% dplyr::filter( PARAM =="BFI All Questions", AVISIT !="SCREENING" )# Define the split function for AVISITsplit_fun <- drop_split_levels
library(teal.modules.clinical)## Data reproducible codedata <-teal_data()data <-within(data, { ADSL <- random.cdisc.data::cadsl ADQS <- random.cdisc.data::cadqs# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <-df_explicit_na(ADSL) ADQS <-df_explicit_na(ADQS)})datanames <-c("ADSL", "ADQS")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADSL <- data[["ADSL"]]ADQS <- data[["ADQS"]]## Setup Appapp <-init(data = data,modules =modules(tm_t_summary_by(label ="Efficacy Data and Change from Baseline by Visit",dataname ="ADQS",arm_var =choices_selected(choices =variable_choices(ADSL, c("ARM", "ARMCD")),selected ="ARM" ),by_vars =choices_selected(choices =variable_choices(ADQS, c("PARAM", "AVISIT")),selected =c("AVISIT") ),summarize_vars =choices_selected(choices =variable_choices(ADQS, c("AVAL", "CHG")),selected =c("AVAL", "CHG") ),useNA ="ifany",paramcd =choices_selected(choices =value_choices(ADQS, "PARAMCD", "PARAM"),selected ="BFIALL" ),add_total =FALSE,parallel_vars =TRUE ) ),filter =teal_slices(teal_slice("ADQS", "AVISIT", selected =NULL),teal_slice("ADQS", "AVAL", selected =NULL) ))shinyApp(app$ui, app$server)
Warning: The 'plotly_relayout' event tied a source ID of
'teal-main_ui-filter_panel-active-ADQS-filter-ADQS_AVAL-inputs-histogram_plot'
is not registered. In order to obtain this event data, please add
`event_register(p, 'plotly_relayout')` to the plot (`p`) that you wish to
obtain event data from.
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.
#| '!! shinylive warning !!': |#| shinylive does not work in self-contained HTML documents.#| Please set `embed-resources: false` in your metadata.#| standalone: true#| viewerHeight: 800#| editorHeight: 200#| components: [viewer, editor]#| layout: vertical# -- WEBR HELPERS --options(webr_pkg_repos = c("r-universe" = "https://insightsengineering.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 ADQS <- random.cdisc.data::cadqs # Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <- df_explicit_na(ADSL) ADQS <- df_explicit_na(ADQS)})datanames <- c("ADSL", "ADQS")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADSL <- data[["ADSL"]]ADQS <- data[["ADQS"]]## Setup Appapp <- init( data = data, modules = modules( tm_t_summary_by( label = "Efficacy Data and Change from Baseline by Visit", dataname = "ADQS", arm_var = choices_selected( choices = variable_choices(ADSL, c("ARM", "ARMCD")), selected = "ARM" ), by_vars = choices_selected( choices = variable_choices(ADQS, c("PARAM", "AVISIT")), selected = c("AVISIT") ), summarize_vars = choices_selected( choices = variable_choices(ADQS, c("AVAL", "CHG")), selected = c("AVAL", "CHG") ), useNA = "ifany", paramcd = choices_selected( choices = value_choices(ADQS, "PARAMCD", "PARAM"), selected = "BFIALL" ), add_total = FALSE, parallel_vars = TRUE ) ), filter = teal_slices( teal_slice("ADQS", "AVISIT", selected = NULL), teal_slice("ADQS", "AVAL", selected = NULL) ))shinyApp(app$ui, app$server)