0

There are many great answers on Cross-Validated explaining that the p-values for cox.zph (or other regression models) in R refer to the difference between a factor level and its reference (here & here, for example).

If one desires to get the overall significance of the categorical variable as a whole (as in the top row of the output in the question here, for example), it seems tests (ANOVA & log-likelihood ratio test) with and without the categorical variable or should be performed.

I have about 20 non-binary categorical variables; do I really have to fit all of these one-by-one to get an idea about whether a non-binary predictor is really important for the model? This seems wrong.

I tried using rms::anova() as suggested in the top comment on this question but I am met with 50+ errors that are all either one or more coefficients may be infinite or Ran out of iterations and did not converge

JED HK
  • 409
  • The errors/warnings suggest that the problem is with your model rather than with the post-model anova() calculation. I suspect that there are some combinations of predictor values that don't have any events. The Wald-test of rms::anova() needs a proper covariance matrix among the coefficient estimates (e.g., available via the vcov() function). If your original model is not converging and you have "infinite" estimates of coefficients, then you won't have the necessary covariance matrix. – EdM Sep 13 '22 at 16:08
  • That could definitely be possible because I added many strata terms to account for nonproportionality. But now that leaves me with some trouble to deal with this issue – JED HK Sep 13 '22 at 19:16

0 Answers0