# Direction of main effects in cox regression and negative binomial regression changes when adding variables

For a research I am conducting I am looking at the effect of two categorical variables (dummy with values 0 and 1 for each group) on the speed and quantity with which customers make future purchases. The variables are simply made as follows:

• speed is measured as the days until the next purchase
• Quantity is measured as a count variable counting the number of products purchased at the next purchase My goal is to understand how the two categorical variables affect the speed and quantity. For Speed I used a hazard Cox regression to analyze the time until the event of the next purchase. For quantity I used a negative binomial model (to accoutn for overdispersion) to analyse the quantity of products. In both analyses I add first one variable, and then both and then their interaction in a hierarchical fashion.

However the signs of the coefficient of one categorical variable change everytime I add the other one. I checked multicollinearity because the correlation between the variables is .130 and the VIF scores are around 1.

Here is an example of the negative binomial count model results (*significant below .001) :

Models Model 1 Model 2 Model 3
Variables B coefficient B coefficient B coefficient
------------- -------------- ------------- -------------
Intercept 2.30* 2.31* 2.32
Categorical 1 5.20* -2.20* -2.30
Categorical 2 5.30* 2.72
Interaction 7.32

Could anyone help me explain why this is happening or suggest how to deal with this issue? I do not know how to explain this and it happens both with the cox regression as with the negative binomial model..

• This is an interaction. It will be easier to explain if you tell us what the two categorical variables are. But you can also search for other questions on CV that involve interactions. I know this has been answered before. Jul 17 at 14:52
• Hi Peter, thank you! categorical variable 1 indicates whether the customer made their first purchase with a discount (=1) or regularly (=0), and categorical variable 2 indicates the same but for the second purchase. Does this help? Jul 18 at 8:00