Search code examples
rsurvival-analysiscox-regression

R coxph() warning: Loglik converged before variable - valid results for other variables?


I fit cox regressions and I am interested in the effect of a predictor x, which is the last variable in the model (variable 7). I include some variables like sex and age in the model, because I want to adjust the model for them.

Using R function coxph() gives me the warning "Loglik converged before variable 3". In fact, I am not interested in variable 3, because it is just one of the variables I want to adjust for. But the word "before" makes me wonder whether this mean that results of all variables following variable 3 (which includs my predictor x) are not valid. Or are only the results of variable 3 affected?

This is the output: Output

More information: Actually, I am running multiple cox regressions and the described warning occurs only in some of the models for variable 3. I do want to adjust for variable 3 and thus to keep it in the code.

There is some discussion about this warning(1), but I have not found an answer to my question so far. Thank you.

(1) For example, here or here


Solution

  • Thanks for doing a search on prior answers. (And thanks for citing one of my answers :-) The warning message only applies to the control3 variable. The key to investigating the validity of the statistical inference about predictorx lies part of Therneau's answer that you cited. You are interested in one of the other variables and fortunately only one of your variables "exploded". That means you can do a LRT comparing the models with and without the variable(s) of interest to get a proper statistical result. The results are essentially saying there were no events in the subset of cases with a positive value of `control3 . I'm guessing that control3 is a 0/1 variable and if you looked at the table:

     with( your_data, table(control3, your_status_variable))
    

    .... that you would find zero events in cases with control3 == 1.