# Guidelines for comparing treatments when some patients receive different number of treatments

I am working with a retrospective database where the researchers want to compare the effects between 2 treatments. Things get complicated with the fact that some of the patients receive treatments more than once and some even have treatment switching regimes at certain time points. What are some guidelines that people have for designing the set up of these models?

• To start, you might try using three groups. 1=No Treatment, 2=Single Treatment, 3=Some sort of multiple Treatment. Presumably, there will be few in 3, but maybe enough to give an idea whether 2 and 3 differ (either by formal test or eyeball). If worrisome difference, remove 3's from your analysis. (Unless there are lots of them, in which case keep them as a separate category). If no difference, combine 2's & 3's. (Maybe some people need two tries for the treatment to work; it's still the treatment). // Whatever you do, honestly present as a section or footnote of the report on your analysis. Apr 15, 2020 at 0:12

You should look into using the g-methods for sequential treatments. These are described in part 3 of the (currently free) book What If by Hernán and Robins. The most common of these methods is inverse probability weighting (IPW) for the estimation of marginal structural models (MSMs). This is an extension of IPW (i.e., propensity score weighting) for single time point observational studies.

IPW is described in Robins, Hernán, and Brumback (2000), and there are other tutorials out there. Essentially, you imagine the analysis you would perform if you could randomly assign each participant to each treatment at each time point. This is likely a regression of the outcome on treatment at each time point and perhaps their interaction (if specific sequences of treatments are relevant beyond the effects of treatment at each time point). What distinguishes your study from this ideal study is that participants non-randomly enter treatments at each time point, so it's unclear if differences in outcomes are due to the treatment or to differences among the participants in each treatment. This is confounding. IPW is a method to adjust for confounding. It does so by creating a weighted sample in which confounding is eliminated. See the references I mentioned for instructions on how to perform IPW. In R, you can use the WeightIt package to estimate the weights.

• I'm famaliar with IPTW and g comp(g comp doesnt do well in the longitudinal setting from what I know), but my concern is more focused on the design for the analyses. Do you know of any people who implement repeated measures IPTW with a cross over design where patients are treated and then not treated?
– Jin
Apr 22, 2020 at 3:38
• That is the typical use of IPTW for MSMs. There's nothing special about that design; it's exactly the kind of design this method was designed to handle.
– Noah
Apr 22, 2020 at 4:05
• Ah I see I'm more familiar with using them to control for confounding in retrospective data. Are they also optimal for studies where some patients are receiving more treatments compared to others?
– Jin
Apr 22, 2020 at 4:15
• Actually looking at this, i think my problem is different from how you describe it. Not every patient has the same amount of time points. How can I make a regression of the outcome at each time point if not everyone has the same number of time points?
– Jin
Apr 29, 2020 at 0:17