Survival analysis to estimate kanban tasks completion times
It's a matter of defining exactly which problem you want to solve, and there might be many variants:

If the goal is really to estimate &quot;time completion&quot;, then imho you should use only completed tasks, since the other tasks haven't been &quot;completed&quot;. Note that in this case you're counting time actually spent on the task.
If the goal is to estimate &quot;time of solving the task&quot;, whether by completing it or cancelling it, then you're counting the duration between the time the task was initialized and the time it was either completed or cancelled. Note that in this case the duration may include time spent on other tasks.

In both cases above, I don't see any proper way to include tasks which are still pending. My idea for these cases would be to calculate a different statistic, something like &quot;rate of completed tasks after X days&quot; for instance.