# Dealing/Interpretating confounding variables in cox regression (time-varying covariates using counting process notation)

I have 3 predictors which are correlated by approx. 0.57.

One measures the intensity of a task. One measures the success (profitability above x) of a task and one the failure of a task (profitability below x). above a certain threshold I code them as 1 otherwise as 0. With a higher intensity of the task the probability of success or failure also increases.

My hypothesis are that each of the 3 predictors increases the probability of quitting.

Additionally I have 4 models. Model 1-3 is one of the predictors + control variables (Age, Gender, ..). Model 4 is the combination of the 3 predictors and the control variables.

My goal is to determine the influence of the 3 predictors quitting. I want to find out which variable has a significant influence on quitting.

When I run Model 1-3 using coxph I get the result that in each Model the predictors is significant. I assume this is a result of a confounding variable.

When I run Model 4 I get the result that only one variable (intensity of task) out of the 3 predictors is significant. The other are not significant and have a exp coeff of 0.97 and 0.96.

When I use comparing nested models with anova. Run the Cox regression first with the intensity of task, then see whether adding the other predictors adds significant information with anova(). Then reverse the order, starting with the other predictors and seeing whether adding the intensity of tasks adds anything I get the result, that intensity of tasks adds significant information. The other way around it doesn't add significant information.

What can I conclude from this result? Does this mean that intensity of task is a significant predictor of quitting and the others are not? That the result of Model 1-3 is confounded by the intensity of task?

Is there a way to test directly for confounding?

You begin by stating that the 3 variable are highly correlated. Your first 3 models, which exclude two highly correlated variables in each model, are therefore more likely to find that each individual variable in isolation from other highly correlated variables is significant. You are fundamentally demonstrating confounding- there is no other direct test needed.

If you run the model with all three variables of interest and no adjusters, the confounding/correlation may be more evident.

The best approach, particularly with a Cox or logistic regression, is to use a multiple regression model that includes all relevant predictors. In Cox or logistic regression, in addition to the issue of correlations among predictors that concerns you, omitting a predictor related to outcome can lead to bias in estimates of the coefficients for the predictors you include, even if the omitted predictor is uncorrelated to the included predictors; see the answer by Harrell on the page linked above. So given the way that you have structured the analysis, your Model 4 is the most reliable way to start. That is, "intensity of task" is the only predictor significantly associated with outcome of the 3 you are considering (when other covariates are also taken into account).

Your tests of multiple nested models is instructive, as in your case it pretty much replicated what you found with Model 4, but it wouldn't be considered the most reliable way to proceed in general. For example, what one tests with the standard R anova() function is whether the second predictor adds significant information about outcome after what was provided for by the first predictor has been accounted for. In cases with predictors that are less distinct in their relationships with outcome than your 3 seem to be, that might not work well and lead you to make a false-negative finding. Furthermore, as that multiple nested models process involves multiple tests on the same data you should be correcting for multiple comparisons, which would make it harder to find truly significant predictors.

Note that there are other ways to perform analysis of variance that do not depend on the order of entry of predictors into the analysis; see this page for discussion of different types of ANOVA. For example, consider the anova() function that acts on objects created with the rms package. In your case without interactions and no multi-level categorical predictors the results would be those you got with Model 4, but in more complicated models that latter version of anova() gives more useful results that take all levels of a categorical predictor and interactions involving any predictor into account.

Finally, it seems that you have taken a continuous measure of profitability and broken that apart into dichotomous measures of "success" or "failure." Binning continuous predictors is generally a bad idea. So although your model to this point seems to rule out predictors other than "intensity of task" as significant, I wonder whether having continuous measures of "success" and "failure" probabilities might yet show them also to have significant relationships with outcome.

My answer does not address the issue of your use of time-varying covariates, mentioned in the title but not discussed within the question itself. Note that some types of time-varying covariates can lead to misleading conclusions related to survivorship bias. Be very careful with time-varying covariates.

Models 1 to 3 can't involve confounding as there are no confounding variables. Model 4 results are going to be due to the relationship among the predictors, but that doesn't mean the results are wrong. Nor should significance be the only test. You may want to include the confounders precisely because they are confounders.

If you want to estimate the parameters (as opposed to just doing prediction) then you might consider ridge regression or principal components regression or some other method that you could find by searching for collinearity issues.

• thank you Peter. I just ran Model 4 using ridge regression. The result is that all 3 variables are significant. The hazard ratio (HR) for intensity of tasks is 1.23 the HR for the two other variables is around 0.96. I'm really struggling with the conclusion of my analyses now. Because without ridge regression I would have said (Based on Model 4) that intensity of task is the only significant predictor. Can you tell me how to interpret the result of Model 4 with ridge regression in comparison to the result without, considering a cox regression model with time-varying variables? – Gerd08 Sep 23 '19 at 12:43
• In the regular analysis, the variances of the parameter estimates were over-estimated due to the correlation among the independent variables. Ridge regression allows some bias into the estimates in order to lower the variance of the estimates. (I am assuming you used ridge for survival analysis). – Peter Flom - Reinstate Monica Sep 24 '19 at 10:41