# Cox Models treatments depending on time until event

I'm trying to get the "productivity" of treatments like sending an email, calling or sending an SMS and their combinations in the paying debtor's probability.

I couldn't find one model that satisfies the most basic hypothesis I need to fulfill. For example, I can't use a simple decision tree, with, for example, quantity of SMS as a variable, because more SMS means that during the period we have that client, we sent him, let's suppose 3 SMS, but because he didn't pay (if he would had paid during the first days he wouldn't have received any SMS). In a logistic regression I would have the same issue.

So I thought that the time should be important in this type of analysis. Let's say someone with the same 'survival' time getting more SMS has (I think) more chances to pay (die in the model).

So I was thinking that we should stratified clients regarding their survival time. But I was wondering how can I add this to those models or if there is a more suitable model to do this. I read about stratified Cox Models, but I wasn't sure if it was going to be able to capture this.

My question is, what model would you recommend to do this and how would you insert the fact that if we have more time since the client was loaded in the system, the treatments (which are supposed to have a positive impact) will increase but because is more difficult that this client pays.

Maybe some model where the class is is someone heal or not depending on how much medicine you gave him...So, you will have both effects, more medicine more chances to heal, but more medicine is related to more time with no healing. Really don't know.

Probably you should look at those who have the same survival time but different quantity of treatment. In this way you take advantage of the variability in the treatment variable to identify its effect.

• yep, good point, but how can I know that they have the same survival time? I mean people that didn't pay, they could be in any group considering time. So, let's suppose I give them 10 days of treatment (I select people that didn't pay before) and then I look the following days if they paid or not. The problem is that they will be receiving more treatments if they don't pay. So I can't tie the result to the 1st 10 days of treatments. Nov 13, 2014 at 15:26

I'd leave this as a comment, but it's far too long.

I would imagine sending an SMS to increase the hazard of a repayment for a short period, but not have a lasting effect. Thus I would code it as a time-varying covariate. Something like this:

ID t.start t.end event SMS.1.sent.time SMS.2.sent.time
A  1       10    1     8               NA
B  1       12    0     5               11


would be recoded to

ID t.start t.end event SMS.sent.within.3.days
A  1       8     0     0
A  8       10    1     1
B  1       5     0     0
B  5       8     0     1
B  8       11    0     0
B  11      12    0     1


where each subject is split up into separate lines based on if they received an SMS in the last 3 days. (Or whatever time period you would want, maybe you have a sense of what would work, and you could try several.) The vignette for R's mstate package has some sample code like this.

To make things even more complicated, you could also include a running counter of total SMS sent, which would probably have a negative interaction with SMS.sent.within.x.days, because if you've sent someone n messages, the n+1th (in particular) probably won't help.