I am trying to do a tbl regression but i cannot add the global p and there is an error. It seems to be caused by one parameter "groupe N" because without it there is no error. I coded this parameter whit case_when.
Creation of "groupe N" :
d <- d %>%
mutate(groupeN = case_when(
chir_ypN == 0 & `chir_Nb_N0 _cPR`== 0 & `chir_Nb_N+_PR` == 0 ~"ypN0",
chir_ypN == 0 & `chir_Nb_N0 _cPR`== 1 ~ "ypN0/RC",
chir_ypN != 0 & `chir_Nb_N+_PR` == 0 & `chir_Nb_N0 _cPR`== 0 ~ "ypN+",
chir_ypN != 0 ~ "ypN+/RP"
))
-----------------------
Multivariate analysis :
PFS_cox <- coxph(
Surv(time, relapse) ~
diag_CPS_PDL1+
Groupe_ypT+
chir_ypN+
chir_Embol_lymph+
chir_Pn+
groupeN,
data = data_PFS_cox
)
PFS_multi <- tbl_regression(PFS_cox, exponentiate = TRUE) %>%
add_global_p(keep=TRUE)
PFS_combi <- tbl_merge(tbls= list(PFS_univ, PFS_multi),
tab_spanner = c("Univariate", "Multivariate"))
PFS_multi
PFS_combi
------------------------------------
The error message :
✖ There was an error running `car::Anova()`, likely due to this model type not being supported. The results displayed are based on `add_global_p(anova_fun = gtsummary::tidy_wald_test)`
✖ `add_global_p(anova_fun = gtsummary::tidy_wald_test)` failed...
Error in dplyr::mutate(., model_terms = unlist(.data$data[["model_terms"]]) %>% :
ℹ In argument: `wald_test = `%>%`(...)`.
ℹ In row 6.
Caused by error in `qr.solve()`:
! singular matrix 'a' in solve
In addition: Warning message:
In stop(e, call. = FALSE) : additional arguments ignored in stop()
If you could help me figure out this problem i will be very gratefull ! Thank you.