Thanks @Kevin_Haynes , this is a very good topic to discuss.
When I usually think about ‘immortal time bias’, it is in the context of either an incidence rate characterization or a population-level effect estimation study, where I have some ‘time-at-risk’ following some target cohort ,and I’m looking for outcomes. Here, the potential bias if I count time-at-risk for a given person even though they are ineligible to be observed with the outcome. So, a concrete example, If I wanted to estimate incidence of T2DM amongst people entering the database after 2020, any persons who already have T2DM (with a diagnosis code in 2019 or prior) need to be excluded from my characterization, because they cannot have a ‘new’ T2DM post-2020 and therefore have no ‘time-at-risk’.
So, in the case of chronic diseases, like T1DM and T2DM, whereby the general expectation is that once a person enters a cohort, they remain in the cohort through the end of their observation (almost definitely true for T1DM, and mostly true for T2DM, with exceptions of those who have lifestyle behaviors, drop the pounds, and get ther hbA1c under 6.5% without medication support for some extended time), I’m struggling to see the concern of ‘immortal time bias’ by using forward-looking events like medication use as part of the outcome definition.
If we were dealing with an outcome that allows for recurrent events, like deep vein thrombosis or acute myocardial infarction or COVID-19, then I definitely can see a legitimate risk for ‘immortal time bias’, because the cohort logic will require specifying not only how a person enters the cohort, but also how they exit it, and if that logic involves some ‘clean window’ of time between one event and a subsequent event in the same patient’s record, then that ‘clean window’ person is ‘immortal time’, in that you know by definition you can’t observe a new event in this interval following a preceding event.
The CohortIncidence package that @Chris_Knoll developed very elegantly handles this immortal time bias in the context of cohorts that allow for recurrent events. The CohortMethod package, which @schuemie maintains, provides additional analysis parameters (in that case, priorOutcomeLookback) to allow the user to avoid the threat of immortal time bias (as long as priorOutcomeLookback is set to some value greater than the outcome phenotype clean window), But it is quite easy to miss these subtleties if you try to compute an analysis de novo without using the OHDSI standard tools.