Closed jeanneyue closed 2 months ago
Hi @jeanneyue,
Can you provide some more details about your data so that we can help you look into the issue?
In the example below I set all records as events and used the same AVAL
values that you provided and did not get an error, so the issue is likely coming from somewhere else in your data.
Thanks!!
library(teal.modules.clinical)
ADSL <- tmc_ex_adsl
ADTTE <- tmc_ex_adtte %>% head(9)
ADTTE$CNSR <- rep(0, nrow(ADTTE))
ADTTE$AVAL <- c(16.73, 7.76, 18.77, 10.91, 9.04, 11.51, 6.51, 11.21, 10.42)
arm_ref_comp <- list(
ACTARMCD = list(
ref = "ARM B",
comp = c("ARM A", "ARM C")
),
ARM = list(
ref = "B: Placebo",
comp = c("A: Drug X", "C: Combination")
)
)
app <- init(
data = cdisc_data(
ADSL = ADSL,
ADTTE = ADTTE,
code = "
ADSL <- tmc_ex_adsl
ADTTE <- tmc_ex_adtte
"
),
modules = modules(
tm_t_tte(
label = "Time To Event Table",
dataname = "ADTTE",
arm_var = choices_selected(
variable_choices(ADSL, c("ARM", "ARMCD", "ACTARMCD")),
"ARM"
),
arm_ref_comp = arm_ref_comp,
paramcd = choices_selected(
value_choices(ADTTE, "PARAMCD", "PARAM"),
"OS"
),
strata_var = choices_selected(
variable_choices(ADSL, c("SEX", "BMRKR2")),
"SEX"
),
time_points = choices_selected(c(10, 12), 10),
event_desc_var = choices_selected(
variable_choices(ADTTE, "EVNTDESC"),
"EVNTDESC",
fixed = TRUE
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
After I upgraded tern from 0.9.5 to 0.9.5.9022, your code and my app worked. Thanks!
What happened?
Hi, I tried to use tm_t_tte. It worked except for certain data somehow. When I have time=c(16.73 7.76 18.77 10.91 9.04 11.51 6.51 11.21 10.42) and all are events. It returned an error message: Error: Error applying analysis function (var - AVAL): missing value where TRUE/FALSE needed occured at (row) path: root
Would you please help? It is too hard for me to debug rtables.
Best, Jeanne
sessionInfo()
Relevant log output
Code of Conduct
Contribution Guidelines
Security Policy