# IPTW in Cox Regression model using the WeightIt package - Question on ATT vs. ATE interpretation

I am currently trying to perform some IPTW adjustment in the context of Cox Regression models. I was interested in expanding my understanding of the differences between ATE vs. ATT estimation. I've come through this question What are some examples when the Average Treatment Effect on the Treated/Control (ATT,ATC) is more sought after than the ATE?, but wanted to expand a little further with a toy example, in which treat is the variable representing treatment and the other all are covariates.

Here is the code:

> library(survival)
> library(WeightIt)
> library(cobalt)

> #Create toy columns for "time" and "event" to run a Cox Model
> set.seed(123)
> options(scipen=999)
> lalonde <- cbind(lalonde,
+                  event = sample(c(0,1), size=614, replace=TRUE, prob=c(0.84,0.16)),
+                  time = runif(614, min=10, max=365))
>
> #Base Cox model
> coxmodel <- coxph(Surv(time, event) ~ treat + age+educ+race+married+nodegree+re74+re75, data=lalonde)
> coxmodel
Call:
coxph(formula = Surv(time, event) ~ treat + age + educ + race +
married + nodegree + re74 + re75, data = lalonde)

coef   exp(coef)    se(coef)      z      p
treat      -0.03587390  0.96476194  0.28913692 -0.124 0.9013
age         0.02173526  1.02197319  0.01079062  2.014 0.0440
educ        0.00365036  1.00365704  0.05442380  0.067 0.9465
racehispan  0.41862604  1.51987187  0.35729788  1.172 0.2413
racewhite   0.24639187  1.27940083  0.29143268  0.845 0.3979
married    -0.22170009  0.80115560  0.25624134 -0.865 0.3869
nodegree    0.02911170  1.02953959  0.30671247  0.095 0.9244
re74       -0.00005199  0.99994801  0.00002387 -2.178 0.0294
re75        0.00005245  1.00005245  0.00003960  1.324 0.1854

Likelihood ratio test=9.77  on 9 df, p=0.3693
n= 614, number of events= 95
>
> #Calculate Weights using ATT and ATE estimands
> weight.ate <- weightit(treat ~ age+educ+race+married+nodegree+re74+re75, data=lalonde, estimand="ATE", method="ps")
> weight.att <- weightit(treat ~ age+educ+race+married+nodegree+re74+re75, data=lalonde, estimand="ATT", method="ps")
>
> #ATE and ATT IPTW models
> coxmodel.ate <- coxph(Surv(time, event) ~ treat + age+educ+race+married+nodegree+re74+re75, weights=weight.ate$$weight, data=lalonde) > coxmodel.ate Call: coxph(formula = Surv(time, event) ~ treat + age + educ + race + married + nodegree + re74 + re75, data = lalonde, weights = weight.ate$$weight)

coef   exp(coef)    se(coef)   robust se      z       p
treat      -0.02004749  0.98015212  0.15624752  0.33832525 -0.059 0.95275
age         0.01963221  1.01982619  0.00867726  0.01434404  1.369 0.17110
educ       -0.09375682  0.91050415  0.04474567  0.06947575 -1.349 0.17718
racehispan  0.46512483  1.59221293  0.24029843  0.42393452  1.097 0.27257
racewhite   0.42413118  1.52826206  0.17443581  0.35277474  1.202 0.22926
married    -1.24940385  0.28667565  0.21358363  0.46879585 -2.665 0.00770
nodegree   -0.66912576  0.51215613  0.23867287  0.50240513 -1.332 0.18291
re74       -0.00004309  0.99995691  0.00001951  0.00003948 -1.091 0.27509
re75        0.00014058  1.00014059  0.00002614  0.00005028  2.796 0.00518

Likelihood ratio test=66.63  on 9 df, p=0.00000000006954
n= 614, number of events= 95
>
> coxmodel.att <- coxph(Surv(time, event) ~ treat + age+educ+race+married+nodegree+re74+re75, weights=weight.att$$weight, data=lalonde) > coxmodel.att Call: coxph(formula = Surv(time, event) ~ treat + age + educ + race + married + nodegree + re74 + re75, data = lalonde, weights = weight.att$$weight)

coef   exp(coef)    se(coef)   robust se      z     p
treat       0.12932283  1.13805747  0.28171219  0.30066781  0.430 0.667
age         0.02056776  1.02078073  0.01570762  0.01799373  1.143 0.253
educ       -0.04314595  0.95777159  0.08796343  0.09308908 -0.463 0.643
racehispan  0.48004895  1.61615351  0.50506011  0.40841181  1.175 0.240
racewhite   0.34355493  1.40995097  0.44556116  0.39978515  0.859 0.390
married    -0.59944595  0.54911579  0.45169368  0.55615322 -1.078 0.281
nodegree   -0.24558174  0.78224934  0.43330653  0.50702412 -0.484 0.628
re74       -0.00002932  0.99997068  0.00004409  0.00003812 -0.769 0.442
re75        0.00006454  1.00006454  0.00005850  0.00007373  0.875 0.381

Likelihood ratio test=5.19  on 9 df, p=0.8171
n= 614, number of events= 95


Basically, we can see that the effect of treat is slightly different between the two models (ATE and ATT) and obviously when compared with the standard, unweighted Cox Model. Apart from the statistical significance, I have two questions:

1. Can I use the weight generated through the WeightIt package directly into a coxph call to run an IPTW analysis? I did not find any worked example on this on the vignette, so just to be sure that I am running correctly.
2. What is the right interpretation of the coefficients found for ATT and ATE models? Given the aforementioned question, I am currently interpreting the coefficient for ATE model as "what would be the effect when applying treat over the whole population of analysis", while the ATT one as "what would be the effect when withholding treat from those currently treated in the population$$`$$, but I am not sure that this is the correct one.

Neither coefficient corresponds to either the ATT or ATE, despite what you requested using the weights. That's because covariate adjustment changes the estimand when using Cox regression models. The estimand is the conditional hazard ratio, conditional on the covariates included in the model. Because those same variables are used to define the ATT and ATE, the coefficients in the two models have the same interpretation, which is essentially uninterpretable in the sense that the hazard ratio is conditional but only conditional assuming the hazard ratio does not vary with the covariates, and the hazard ratio cannot be interpreted causally because selection bias is introduced as soon as someone dies.

If you want to interpret the coefficient on treatment as a marginal hazard ratio with an interpretation similar to the ATT or ATE, you should not include covariates in the outcome model. Then the coefficient on treatment will have the usual interpretation based on the weights you use. For the ATT, this is the marginal hazard ratio of treatment among the treated (i.e., the effect of the treatment for those who received it, or, equivalently, the effect of withholding treatment from those who received it), and for the ATE, this is the marginal hazard ratio of treatment in the population.

Note these interpretational problems are also present with simpler models like linear regression, but they are more pronounced here with non-causal, non-collapsible, and assumption-laden effect measures like the hazard ratio from a Cox model.

• Thank you - just to make sure I grasp the correct meaning, when you say "the effect of the treatment for those who received it, or, equivalently, [the effect of withholding treatment from those who received it]" - does the part in brackets refers to ATC? Otherwise, I think I miss something on this interpretation since the two sentences does not seem equivalent to me May 10, 2022 at 20:50
• They mean the same thing: the difference between the outcomes for the treated group and the outcomes for the same group were they not to be treated (i.e., were treatment instead to be withheld from them). See Greifer and Stuart (2021) for further discussion on interpreting these estimands. The ATC refers to the control group (i.e., those who actually didn't receive treatment).
– Noah
May 10, 2022 at 21:01
• @Noah I thought we could do covariate adjustment for covariates that could not be balanced by the weights, and still interpret ATT ant ATE as such. Or have I (and others perhaps) misunderstood this)? By the way, the weightit package is ABSOLUTELY WONDERFUL. May 26, 2022 at 7:50
• @AdamRobinsson It really depends. For noncollapsible estimands, the coefficient on treatment never corresponds to the marginal ATT or ATE when covariates are included. See my post here. For continuous outcomes, it is possible to retain the estimands after regression adjustment. You can also always use g-computation to retain the estimand, but this is harder with survival outcomes. Thank you for the kind words!
– Noah
May 26, 2022 at 14:28

The difference of ATT vs ATE has been discussed in previous posts, such as this one. The short answer is that the ATE is the (average) treatment effect on the population, while the ATT is the (average) treatment effect on those treated.

I have recently looked into the application of propensity score matching techniques in survival analysis. Two interesting papers I found are 'Austin, P. C. (2014). The use of propensity score methods with survival or time‐to‐event outcomes: reporting measures of effect similar to those used in randomized experiments. Statistics in medicine, 33(7), 1242-1258' and 'Austin, P. C., & Fine, J. P. (2019). Propensity‐score matching with competing risks in survival analysis. Statistics in medicine, 38(5), 751-777'.

I also found related worked examples here and here in the supplementary material.

My intuitive understanding is that you can use IPTWs directly as you did if the treatment of interest is given at a unique time and, as usual, all the key variables are accounted for. The issue with a time-varying treatment is that a standard propensity score model would not ensure that the matched control units/individuals survive at least up to the time their treated pairs are treated. Since treatment is endogenous to survival (you can't be treated if your are not alive), they outcome of this model may be biased. This may not be your case though, depending on the data.

• Thank you. I have red the documents, but still cant grasp the interpretation of the different coefficients arising from the two models ATE vs. ATT. Besides, do you think my call of the coxph with the weights included is correct? May 10, 2022 at 10:50
• Since the first part was answered by Noah, I may just add that your call looks correct to me. May 11, 2022 at 8:29