clogit_with_tryCatch | R Documentation |
When model fitting failed, a more useful message would show.
clogit_with_tryCatch(formula, data, ...)
formula |
Model formula. |
data |
data frame. |
... |
further parameters to be added to survival::clogit. |
When model fitting is successful, an object of class "clogit".
When model fitting failed, an error message is shown.
## Not run:
library(dplyr)
adrs_local <- tern_ex_adrs %>%
dplyr::filter(ARMCD %in% c("ARM A", "ARM B")) %>%
dplyr::mutate(
RSP = dplyr::case_when(AVALC %in% c("PR", "CR") ~ 1, TRUE ~ 0),
ARMBIN = droplevels(ARMCD)
)
dta <- adrs_local
dta <- dta[sample(nrow(dta)), ]
mod <- clogit_with_tryCatch(formula = RSP ~ ARMBIN * AGE + strata(STRATA1), data = dta)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.