The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

tm.ttni

R-CMD-check pkgdown

Teal module and reusable table builder for Time to Next Intervention (TTNI) and related time-to-event endpoints.

TTNI is a time-to-event efficacy endpoint (time to next anticancer intervention), distinct from safety incidence endpoints (such as TEAE/OSEI).

Design rule

Detected arms KM counts / quartiles / landmarks HR, 95% CI, log-rank p
1 arm Yes No
2 arms Yes Yes, vs ref_arm
3+ arms Yes, Total column by default No

Forcing compute_hr = TRUE on a multi-arm data set is ignored with a warning.

Install and run

# from the package root
pkgload::load_all()
shiny::runApp("app.R")

Or call the builder without Shiny:

library(tm.ttni)

two <- make_synthetic_ttni_data("two_arm")
build_ttni_table(two$ADSL, two$ADTTE, ref_arm = "Placebo")

multi <- make_synthetic_ttni_data("multi_arm")
build_ttni_table(multi$ADSL, multi$ADTTE)  # no HR

What is calculated

Always:

The interactive table does not print method footnotes by default. Callers may still pass footnotes = default_ttni_footnotes() to build_ttni_table() when a TFL-style footer is required.

Topic Definition
Mean (SD) Descriptive mean and standard deviation of AVAL in the analysis set (includes censored times). This is not a Kaplan-Meier mean.
Kaplan-Meier Product-limit estimates. Median and 95% CI use tern median_ci_3d on one row. Confidence intervals use the log-log method unless conf_type is changed. Non-estimable values are shown as NE.
Follow-up time Reverse Kaplan-Meier estimates.
Landmark rates Kaplan-Meier event-free percentages at the selected months.
Time unit AVAL stored in days is converted to months (/ 30.4375) when AVALU is DAYS.
Hazard ratio / 95% CI Unstratified Cox model (Efron ties); two-arm designs only.
p-value Unstratified log-rank test; two-arm designs only.
Min, Max {1} / {2} Observed range of AVAL. tern annotations mark a bound that is a censored observation.

Two-arm only:

Not implemented (group-sequential / SAP-specific):

Data dependencies

Dataset Required Recommended
ADSL USUBJID, arm/group (e.g. TRT01A) SAFFL, ITTFL, SEX, RACE, COUNTRY
ADTTE USUBJID, PARAMCD, AVAL, CNSR PARAM, AVALU, EVNTDESC

AVAL stored in days is converted to months (/ 30.4375) when AVALU is DAYS. CDISC Pilot ADTTE has no AVALU; the demo loader treats those values as days.

Module architecture

Layer 1  Arm design     detect_arm_design()
Layer 2  Data adapters  standardize_adsl() / standardize_adtte()
Layer 3  Data prep      prep_ttni_data()   # empty result is not an error
Layer 4  Table builder  build_ttni_table(prepped = ...)
Layer 5  UI / Server    teal.picks PARAMCD, group, population; shinyvalidate, Show R Code
Layer 6  Entry point    tm_t_ttni() → teal::module()

PARAMCD, the treatment / group column, and the population flag are teal.picks selectors. PARAMCD uses values() on a fixed PARAMCD column (default TTNI). Group and population use variables() with multiple = FALSE on adsl_name (defaults TRT01A, and SAFFL / ITTFL). The reference arm, landmarks, Total, follow-up, and statistic checkboxes stay ordinary Shiny inputs. Legacy choices_selected (PARAMCD) and character column vectors (group and population) are still accepted and signal a deprecation warning.

tm_t_ttni(
  cat = teal.picks::picks(
    teal.picks::datasets("ADTTE", "ADTTE"),
    teal.picks::variables("PARAMCD", "PARAMCD", multiple = FALSE, fixed = TRUE),
    teal.picks::values(c("TTNI", "OS"), "TTNI", multiple = FALSE)
  ),
  group_vars = teal.picks::picks(
    teal.picks::datasets("ADSL", "ADSL"),
    teal.picks::variables(c("TRT01A", "SEX"), "TRT01A", multiple = FALSE)
  ),
  population_var = teal.picks::picks(
    teal.picks::datasets("ADSL", "ADSL"),
    teal.picks::variables(c("SAFFL", "ITTFL"), "SAFFL", multiple = FALSE)
  )
)

The server returns table, prepped_data, no_data, and source_code.

Demo data

The example app resolves data in this order:

  1. Existing global ADSL / ADTTE
  2. Local CDISC Pilot XPTs in data-raw/ (adsl.xpt, adtte.xpt)
  3. random.cdisc.data (radsl / radtte) when available
  4. Synthetic fixtures from make_synthetic_ttni_data()

Download the public CDISC Pilot files (do not commit them):

source("data-raw/process_data.R")

The demo’s HR-off example is the public CDISC Pilot three-arm study (PARAMCD = TTDE; Placebo / Xanomeline High Dose / Xanomeline Low Dose). Study-specific dose-level labels are not hardcoded; generic arms are used. The module shows KM summaries without HR on that three-arm table.

These files are CDISC clinical test data. Attribute them to cdisc-org/sdtm-adam-pilot-project and do not redistribute them for a fee.

Standalone Usage

build_ttni_table() is the reusable engine. It can be called directly in standalone scripts, reporting pipelines, or other Shiny applications without requiring the full teal framework.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.