A: Drug X B: Placebo C: Combination
(N=134) (N=134) (N=132)
—————————————————————————————————————————————————————————————————————————————————————————
Total patient-years at risk 337.9 331.8 341.6
Number of adverse events observed 343 380 397
AE rate per 100 patient-years 101.51 114.51 116.22
95% CI (90.77, 112.25) (103.00, 126.02) (104.79, 127.65)
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.
The type of confidence interval can be specified through the conf_type argument.
A: Drug X B: Placebo C: Combination
(N=134) (N=134) (N=132)
—————————————————————————————————————————————————————————————————————————————————————————
Total patient-years at risk 337.9 331.8 341.6
Number of adverse events observed 343 380 397
AE rate per 100 patient-years 101.51 114.51 116.22
95% CI (91.05, 112.84) (103.28, 126.62) (105.07, 128.24)
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::cadsladaette <- random.cdisc.data::cadaette# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels.adsl <-df_explicit_na(adsl)adaette <-df_explicit_na(adaette)# Create analysis dataset anl from the 2 parameters AEREPTTE & AETOT1anl_events <- adaette %>%filter(PARAMCD =="AETOT1") %>%select(USUBJID, ARM, ARMCD, n_events = AVAL) %>%mutate(n_events =as.integer(n_events))anl_tte <- adaette %>%filter(PARAMCD =="AEREPTTE") %>%select(USUBJID, ARM, ARMCD, AVAL)anl <-full_join(anl_tte, anl_events, by =c("USUBJID", "ARM", "ARMCD"))
library(teal.modules.clinical)## Data reproducible codedata <-teal_data()data <-within(data, {library(dplyr) ADSL <- random.cdisc.data::cadsl ADAETTE <- random.cdisc.data::cadaette# Ensure character variables are converted to factors and empty strings and NAs are explicit missing levels. ADSL <-df_explicit_na(ADSL) ADAETTE <-df_explicit_na(ADAETTE)# Create analysis dataset anl from the 2 parameters AEREPTTE & AETOT1 anl_events <- ADAETTE %>%filter(PARAMCD %in%c("AETOT1", "AETOT2", "AETOT3")) %>%select(USUBJID, STUDYID, PARAMCD, ARM, ARMCD, n_events = AVAL) %>%mutate(n_events =as.integer(n_events)) anl_tte <- ADAETTE %>%filter(PARAMCD =="AEREPTTE") %>%select(USUBJID, STUDYID, ARM, ARMCD, AVAL, AVALU) ADAETTE <-full_join(anl_tte, anl_events, by =c("USUBJID", "STUDYID", "ARM", "ARMCD"))})datanames <-c("ADSL", "ADAETTE")datanames(data) <- datanamesjoin_keys(data) <- default_cdisc_join_keys[datanames]## Reusable Configuration For ModulesADSL <- data[["ADSL"]]ADAETTE <- data[["ADAETTE"]]## Setup Appapp <-init(data = data,modules =modules(tm_t_events_patyear(label ="AE Rate Adjusted for Patient-Years at Risk - All Occurrences Table",dataname ="ADAETTE",arm_var =choices_selected(choices =variable_choices(ADSL, c("ARM", "ARMCD")),selected ="ARMCD" ),paramcd =choices_selected(choices =value_choices(ADAETTE, "PARAMCD"),selected ="AETOT1" ),events_var =choices_selected(choices =variable_choices(ADAETTE, "n_events"),selected ="n_events",fixed =TRUE ) ) ))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.