(note that this estimand is not conditioned on the survival status) is obtained by maximizing the weighted likelihood of $$\prod_{i=1}^n f(Y_{i;z_1,\ldots,z_t}|\mathbf{\theta}_{it})^{w_{it}},$$ where $i$ indexes the subjects and $\mathbf{\theta}_{it}$ are the parameters involved in the model for $Y_{i;z_1,\ldots,z_t}$ and $$\label{chap3:w_treat}
    \small
    w_{it}=[\prod_{j=1}^tP(Z_{ij}=z_{ij}|z_{i1},\ldots,z_{i,j-1},y_{i1},\ldots,y_{i,j-1},x_{i1},\ldots,x_{i,j-1},w_{i1},\ldots,w_{i,j-1},v_i;\mathbf{\tau}_j)]^{-1}.$$ By weighting using the inverse probability of receiving the observed treatment regime given all covariates and previous treatments, the association between treatment and all observed confounders, including confounding by indication, are broken. Under these four assumptions, inference about the treatment effects under a pseudo-population in which treatment is randomized can then be obtained.

Similarly, this weighting method can be used to remove bias due to dropout. Let $R_i=1$ indicate that the subject’s cognitive score is observed and $R_i=0$ indicate that the subject’s cognitive score is missing. The weight used to account for missing cognitive score is $$\label{chap3:w_miss}
    \scriptsize
    w_{it}^r=[\prod_{j=1}^tP(R_{ij}=r_{ij}|r_{i1},\ldots,r_{i,j-1},z_{i1},\ldots,z_{i,j-1},y_{i1},\ldots,y_{i,j-1},x_{i1},\ldots,x_{i,j-1},w_{i1},\ldots,w_{i,j-1},v_i;\mathbf{\gamma}_j)]^{-1}.$$

Finally, death is typically treated as equivalent to dropout in MSM [@do; @pool]. Let $D_{it}=1$ indicate that subject $i$ is dead at time $t$ and $D_{it}=0$ indicate that the subject survived at time $t$ (thus $D_{it}=1-S_{it}$). The weight for death censoring is then $$\label{chap3:w_death}
    \small
    w_{it}^d=[\prod_{j=1}^tP(D_{ij}=d_{ij}|z_{i1},\ldots,z_{i,j-1},y_{i1},\ldots,y_{i,j-1},x_{i1},\ldots,x_{i,j-1},w_{i1},\ldots,w_{i,j-1},v_i;\mathbf{\lambda}_j)]^{-1}.$$

Assuming that these three weights are independent of each other, the final weight that 