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.
 A: 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.
A: 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.
This doesn't really solve your problem, but hopefully will be helpful.
As for your main question, if you're mainly interested in the comparative effects of treatment, examine only the subjects that received a treatment (omit those that repaid without prompting). If you really want the counterfactual, what "would have happened" in the absence of treatment, I think you need to make sure you have data with comparable observation times both with and without treatment.
A: Subjects who didn't pay are censored observations. Maybe you can try a Cox proportional hazards model for censored data. Your regressor of interest could be the quantity of treatment.Now, the conditional-independence assumption requires that the variables that affect treatment assignment and treatment-specific outcomes are observable.
Indeed the dependence between treatment assignment and treatment-specific outcomes can be removed
by conditioning on these observable variables.
In your case the number of days elapsed since the date subjects were supposed to pay might be the variable to condition on. Little problem, you still need some variability in the amount of treatment. That is, we assume that the longer subjects didn't pay, the more treatment they receive (that's why you would control for the number of days elapsed since payment due date), but to identify the treatment effect you also need that two people with the same elapsed time might have different quantity of treatment.
Hope this helps.
